“NFS部暑”的版本间的差异

来自linux中国网wiki
跳到导航 跳到搜索
(导入1个版本)
第14行: 第14行:
 
systemctl enable nfs-server
 
systemctl enable nfs-server
  
ystemctl start rpcbind
+
systemctl start rpcbind
 
  systemctl start nfs-server
 
  systemctl start nfs-server
 
  systemctl start nfs-lock
 
  systemctl start nfs-lock

2019年10月24日 (四) 02:14的版本


info

NFS服务端 10.3.10.141 NFS client 10.3.10.142 10.3.10.143

NFS服务端

 yum install nfs-utils  rpcbind -y
 
systemctl enable rpcbind
systemctl enable nfs-server

systemctl start rpcbind
 systemctl start nfs-server
 systemctl start nfs-lock
systemctl start nfs-idmap


 创建需要共享的目录
 mkdir -p /home/lxtx/files/cailu/
chmod -R  777 /home/lxtx/files/cailu/  更改share文件夹及其子文件夹权限为77
 
 配置需要共享的目录到 /etc/exports下,xxx.xxx.xxx.xxx为需要共享的对象ip地址。
echo "/home/lxtx/files/cailu/ 10.3.10.*(rw,sync,no_root_squash)" >> /etc/exports
  
echo "/home/lxtx/files/cailu/ 192.168.11.*(rw,sync,no_root_squash)" >> /etc/exports
exportfs -a      #    使exports的修改生效

  
 检查共享目录是否设置正确
 showmount -e
Export list for centos7:
/home/lxtx/files/cailu 10.3.10.*


firewall-cmd --add-service=nfs --permanent --zone=public
 firewall-cmd --add-service=mountd --permanent --zone=public
firewall-cmd --add-service=rpc-bind --permanent --zone=public
 firewall-cmd --reload   

NFS client

yum -y install nfs-utils
 
apt-get install nfs-common
 
检查共享目录是否设置正确,xxx.xxx.xxx.xxx 为共享服务器地址(nfs master)

[root@nfs_client ~]# showmount -e 10.3.10.141
Export list for 10.3.10.141:
/home/lxtx/files/cailu 10.3.10.*

 
 mkdir /home/lxtx/files/cailu 
 chown  -R  lxtx:lxtx  /home/lxtx/files/cailu
 
#NFS server 的IP 
 mount 10.3.10.141:/home/lxtx/files/cailu  /home/lxtx/files/cailu 
 
 
客户端开机自动挂载nfs共享目录

vi /etc/fstab
10.3.10.141:/home/lxtx/files/cailu  /home/lxtx/files/cailu nfs  defaults 0 0

see also

CentOS7搭建NFS服务 Debian Linux安装NFS centos7配置nfs网络文件共享 Linux NFS服务器的安装与配置 Lvs+keepalived+httpd+NFS搭建高可用 NFS+sersync+Keepalived高可用方案