linux nfs網路檔案系統
阿新 • • 發佈:2021-02-15
目錄
# 1>關閉selinux、firewall【server、client都需執行】
環境:
系統:CentOS7.9
Server端 IP: 192.168.100.21
Client端 IP: 192.168.100.22
# 1. server、client端,都需執行的操作
# 1>關閉selinux、firewall【server、client都需執行】
sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config
setenforce 0
systemctl disable firewalld.service
systemctl stop firewalld.service
systemctl status firewalld.service
# 2>安裝軟體包【server、client都需執行】
yum -y install nfs-utils
# 3> 建立目錄
mkdir /data
# 2. Server端,配置
# 配置nfs server端
vim /etc/exports
/data 192.168.100.0/24(rw,sync,no_root_squash) |
# 3. Server端,啟動並加入開機啟動
systemctl enable nfs-server.service
systemctl start nfs-server.service
# 4. Server端,更新並顯示共享
exportfs -rv
# 5. client端,檢視nfs server端的共享
showmount -e 192.168.100.21
# 7. client端,寫入開機掛載
vim /etc/fstab
192.168.100.21:/data /data nfs4 _netdev 0 0 |
# 8. 掛載
mount -a