nfs服务

发布时间 2023-10-26 14:48:46作者: yuyongqi

netstat -ntlp
yum install nfs rpcbind
yum install nfs-utils rpcbind 安装服务端,基于rpcbind
cat /etc/exports 准备编辑配置文件
vim /etc/exports
mkdir -p /data/install/day09/nfs

(/data/install/day09/nfs *(rw,no_root_squash)     权限

/data/install/day09/nfs 共享目录

*这里是共享给所有人,指的客户端IP地址,可以写IP范围或指定单个IP)

cd /data/install/day09/nfs

systemctl restart nfs 启动一下
netstat -ntlp 

ll 检验

连接客户端

yum install rpcbind 安装rpcbind

systemctl restart rpcbind 

yum install showmount 安装showmount

showmount -e 192.168.1.62 检查nfs共享的情况

mkdir /mnt/nfs-client 创建挂载目录

mount 192.168.1.62:/data/install/day09/nfs /mnt/nfs-client 挂载

df -h 查看

cd /mnt/nfs-client

touch 1021-nfs 检验

ll

 

 

ifconfig 显示或配置网络设备

cd /etc/sysconfig/network-scripts/ifcfg-eth0
cd /etc/sysconfig
cd /network-scripts
ll
cat network-scripts
cd network-scripts
ll
cd ..
cd
cd network-scripts
cd /etc/sysconfig
cd network-scripts
vimifcfg-ens33
vim ifcfg-ens33
cd
/root/system_init.sh
cd /root/system_init.sh
vim /root/system_init.sh
./system_init.sh
bash /root/system_init.sh
ip a
vim /root/system_init.sh
cat /root/system_init.sh
yum install nfs rpcbind
yum install -y nfs-utils rpcbind
cat /etc/exports
vim /etc/exports
mkdir -p /data/install/day09/nfs
cd /data/install/day09/nfs
systemctl restart nfs
netstat -ntlp
ll