1. 程式人生 > >兩臺臺CentOS release 6.5 (Final)*64服務器搭建nfs——筆記

兩臺臺CentOS release 6.5 (Final)*64服務器搭建nfs——筆記

NFS

Server端
檢查環境
#cat /etc/redhat-release
#uname -m
#ifconfig|awk -F"[ :]+" ‘NR==2{print $4}‘
192.168.56.6

裝服務
#yum install -y rpcbind nfs-utis
#rpm -qa |egrep "rpcbind|nfs-utils"
起服務
#/etc/init.d/rpcbind start
#/etc/init.d/rpcbind status
#rpcinfo -p localhost
#chkconfig --level 3 rpcbind on
#chkconfig --list|grep rpcbind

#/etc/init.d/nfs start
#/etc/init.d/nfs status
#chkconfig --level 3 nfs on
#chkconfig --list|grep nfs

配置
#mkdir /data
#cat /var/lib/nfs/etab
#useradd -u 555 -g 555 oldboy
#vim /etc/exports
/data 192.168.56.0/24(rw,sync,all_squash,anonuid=555,anongid=555)
#exportfs -rv
#grep 555 /etc/passwd
#chown -R old.old /data
#showmount -e localhost

Client
檢查
#cat /etc/redhat-release
#uname -m
#ifconfig|awk -F"[ :]+" ‘NR==2{print $4}‘
192.168.56.3

#yum install -y rpcbind
#rpm -qa |grep "rpcbind"

#/etc/init.d/rpcbind start
#/etc/init.d/rpcbind status
#rpcinfo -p 192.168.56.6
#chkconfig --level 3 rpcbind on
#chkconfig --list|grep rpcbind
配置
#ping&&telnet 192.168.56.6 111

#showmount -e 192.168.56.6
#mkdir /data0
#vim /etc/rc.local
#mount -t nfs 192.168.56.6:/data /data0
#source /etc/rc.local
#df -hT

測試
分別在server和clint間建文件刪除文件

單詞:squash 壓縮 指能把共享文件的用戶轉換成匿名用戶
anonuid 匿名uid :上述匿名用戶的uid
anongid 匿名gid:上述匿名用戶的gid

兩臺臺CentOS release 6.5 (Final)*64服務器搭建nfs——筆記