Cenos6.1搭建nfs文件共享服务
当前配置为centos6.x下的配置流程(当前PROD的server版本),centos7.x的配置流程有一定的区别;
服务端配置10.10.10.10
1.rpm -qa | grep nfs
2.rpm -qa | grep rpcbind
3.yum -y install nfs-utils rpcbind
4.mkdir -p /home/attach_file
备注:(/home/attach_file为需要共享的文件目录)
5.chmod 666 /home/attach_file
6.vim /etc/exports 命令修改要添加的共享目录然后:wq保存,目录如下:
/home/attach_file 10.10.10.11/24(rw,no_root_squash,no_all_squash,sync)
说明:10.10.10.11为客户端的ip
7.exportfs -r
8./etc/init.d/rpcbind start 启动rpcbind服务
9./etc/init.d/nfs start 启动nfs服务
10.设置开机自启动:
chkconfig nfs on
chkconfig rpcbind on
11.查看是否设置了开机自启动:
chkconfig --list nfs
chkconfig --list rpcbind
12.查看服务状态,服务端这两个service正常状态下是开启的:
service rpcbind status
service nfs status
客户端配置:10.10.10.11
1.yum -y install nfs-utils
2.mkdir -p /home/attach_file
3.chmod 666 /home/attach_file
4./etc/init.d/nfs start 启动nfs服务
5.showmount -e 10.10.10.10(该ip为服务器ip)
6.mount -t nfs 10.10.10.10:/home/attach_file /home/attach_file -o proto=tcp -o nolock
7.设置开机自启动:
chkconfig nfs on
8.查看服务状态,客户端这个service正常状态下是开启的:
service nfs status

浙公网安备 33010602011771号