NFS应用实例
服务端部分
1安装nfs
sudo yum install nfs-utils rpcbind
2添加允许客户端挂载的设备及相关权限(默认没有内容)
3启动服务
sudo service rpcbind start
sudo service nfs start
客户端部分
1安装nfs
sudo yum install nfs-utils rpcbind
2挂载nfs服务器目录到客户端
sudo mount -t nfs 10.139.98.4:/mnt/lanmao_seal/nfs_lanmao /mnt/nfs_lanmao
sudo mount -t nfs 10.139.98.4:/mnt/lanmao_seal/data /data
服务端部分
1安装nfs
sudo yum install nfs-utils rpcbind
2添加允许客户端挂载的设备及相关权限(默认没有内容)
sudo vim /etc/exports
/mnt/lanmao_seal/data 10.139.51.142(rw,no_root_squash,all_squash,anonuid=65534,anongid=65534,async)
/mnt/lanmao_seal/data 10.253.43.161(rw,no_root_squash,all_squash,anonuid=65534,anongid=65534,async)
/mnt/lanmao_seal/nfs_lanmao 10.139.51.142(rw,no_root_squash,all_squash,anonuid=65534,anongid=65534,async)
/mnt/lanmao_seal/nfs_lanmao 10.253.43.161(rw,no_root_squash,all_squash,anonuid=65534,anongid=65534,async)
#65534是nfsnobody用户和组的id号,安装nfs服务后会自动创建nfsnobody用户和组。
3启动服务
sudo service rpcbind start
sudo service nfs start
存储目录的所有者和组权限该为nfsnobody和nfsnobody(服务端存储文件的目录)
客户端部分
1安装nfs
sudo yum install nfs-utils rpcbind
2挂载nfs服务器目录到客户端
sudo mount -t nfs 10.139.98.4:/mnt/lanmao_seal/nfs_lanmao /mnt/nfs_lanmao
sudo mount -t nfs 10.139.98.4:/mnt/lanmao_seal/data /data