yum install -y nfs-utils
[root@hf-02 ~]# showmount -e 192.168.74.129
clnt_create: RPC: Port mapper failure - Unable to receive: errno 113 (No route to host)
[root@hf-02 ~]#
A机器关闭防火墙
[root@hf-01 ~]# systemctl stop firewalld
[root@hf-01 ~]# getenforce
Disabled
[root@hf-01 ~]#
B机器关闭防火墙
[root@hf-02 ~]# systemctl stop firewalld
[root@hf-02 ~]#
[root@hf-02 ~]# getenforce
Enforcing
[root@hf-02 ~]# setenforce 0
[root@hf-02 ~]# getenforce
Permissive
[root@hf-02 ~]#
[root@hf-02 ~]# showmount -e 192.168.202.130
Export list for 192.168.74.129:
/home/nfstestdir 192.168.74.0/24
[root@hf-02 ~]#
[root@hf-02 ~]# mount -t nfs 192.168.74.129:/home/nfstestdir /mnt/
[root@hf-02 ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/sda3 18G 873M 17G 5% /
devtmpfs 489M 0 489M 0% /dev
tmpfs 494M 0 494M 0% /dev/shm
tmpfs 494M 13M 481M 3% /run
tmpfs 494M 0 494M 0% /sys/fs/cgroup
/dev/sda1 197M 75M 122M 39% /boot
192.168.74.129:/home/nfstestdir 18G 7.4G 11G 42% /mnt
[root@hf-02 ~]#
[root@hf-02 ~]# cd /mnt/
[root@hf-02 mnt]# ls
[root@hf-02 mnt]# touch aminglinux.111
[root@hf-02 mnt]# ls -l
总用量 0
-rw-r--r--. 1 1000 1000 0 8月 24 00:34 aminglinux.111
[root@hf-02 mnt]#
[root@hf-01 ~]# ls -l /home/nfstestdir/
总用量 0
-rw-r--r-- 1 mysql mysql 0 8月 24 00:34 aminglinux.111
[root@hf-01 ~]#