centos7安装nfs服务


1.安装nfs组件

yum install nfs-utils nfs-utils-lib -y


2.设置开机启动

centos7的变动较大

server端

systemctl enable rpcbind

systemctl enable nfs-server


设置要共享的目录

vi /etc/exports

/sharedfile  10.0.42.0/24(rw,sync,no_root_squash,no_subtree_check)

启动nfs服务

systemctl start rpcbind

systemctl start nfs-server


3.在client端挂载nfs

临时:

mount -t nfs 10.0.42.4:/sharedfile  /mnt/nfsclient/

vi /etc/fstab

10.0.42.4:/sharedfile     /mnt/nfsclient/  nfs auto,rw,vers=3,hard,intr,tcp,rsize=32768,wsize=32768      0 0

执行下面命令使用修改的文件

mount -a && mount 




yum install nfs-utils nfs-utils-lib -y


server端

systemctl enable rpcbind

systemctl enable nfs-server


vi /etc/exports

/gomeo2o/im-file  10.69.42.0/24(rw,sync,no_root_squash,no_subtree_check)


systemctl start rpcbind

systemctl start nfs-server



client端

mount -t nfs 10.69.42.48:/gomeo2o/im-file  /gomeo2o/im-file/

vi /etc/fstab

10.69.42.48:/gomeo2o/im-file    /gomeo2o/im-file   nfs auto,rw,vers=3,hard,intr,tcp,rsize=32768,wsize=32768      0 0

10.125.192.127:/gomeo2o/im-file    /gomeo2o/im-file   nfs auto,rw,vers=3,hard,intr,tcp,rsize=32768,wsize=32768      0

mount -a && mount 



你可能感兴趣的:(分布式存储)