[aws] How to do NFS file transfer between CentOS and Ubuntu(Bitnami)

Since want to file transfer between CentOS and Ubuntu(Bitnami) on AWS, setup NFS on each instance

目次

CentOS : NFS Server

IP address : 172.31.0.5/16

AWS : Add rule to allow traffic from 172.31.0.0/16 on security group

Setting NFS

Install NFS

sudo su -
yum -y install portmap
yum -y install nfs-utils
yum -y install nfs-utils-lib

Setting shared folder

vi /etc/exports
/mnt/share    172.31.0.0/255.255.0.0(rw,sync,no_root_squash)

Deny access setting

vi /etc/hosts.deny
portmap:ALL
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL

Allow access setting

vi /etc/hosts.allow
portmap: 172.31.0.0/255.255.0.0
lockd: 172.31.0.0/255.255.0.0
rquotad: 172.31.0.0/255.255.0.0
mountd: 172.31.0.0/255.255.0.0
statd: 172.31.0.0/255.255.0.0

Run NFS and chkconfig for auto run

chkconfig nfs on
chkconfig --list nfs

/etc/init.d/rpcbind start
/etc/init.d/nfs start
/etc/init.d/nfslock start

Ubuntu(Bitnami) : NFS Client

IP address : 172.31.1.5/16

AWS : Add rule to allow traffic from 172.31.0.0/16 on security group

Setting NFS

Install NFS

sudo apt-get install nfs-common

Note : if “E: Package nfs-common has no installation candidate” error would be happened, Update apt-get, then Install should be enabled.

apt-get update

 

Setting share folder access

sudo vi /etc/fstab
172.31.0.5:/mnt/share /home nfs defaults,soft,intr,clientaddr=172.31.1.5

Mount folder

sudo service rpcbind start
sudo mount -a

if mount fail, check AWS security policy or access setting on NFS server

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です