1. 程式人生 > >NFS使用mount掛載無法掛載出問題後的排錯思路(七)

NFS使用mount掛載無法掛載出問題後的排錯思路(七)

nfs掛載不上 nfs ping不能服務器 nfs故障

NFS使用mount掛載無法掛載出問題後的排錯思路

  1. 首先確認NFS服務端配置和服務是OK的,

在服務端使用showmount -e localhost 檢查

[[email protected] ~]# showmount -e localhost
Export list for localhost:
/data/r_shared 192.168.221.1/24
/data/w_shared 192.168.221.1/24

2.確認NFS客戶端showmount是否OK

[[email protected] ~]# showmount -e 192.168.221.130
mount clntudp_create: RPC: Port mapper failure - RPC: Unable toreceive

如果出現以上問題的解決思路:

a. ping NFS服務器的IP,看網絡是不是通的

[[email protected] ~]# ping 192.168.221.130
PING 192.168.221.130 (192.168.221.130) 56(84) bytes of data.
64 bytes from 192.168.221.130: icmp_seq=1 ttl=64 time=0.352 ms
64 bytes from 192.168.221.130: icmp_seq=2 ttl=64 time=0.647 ms
64 bytes from 192.168.221.130: icmp_seq=3 ttl=64 time=0.192 ms

b. 通過111端口telnet一下NFS服務器192.168.1.111看能不能連上

[[email protected] w_dingjian]# telnet 192.168.1.111 111
Trying 192.168.1.111...
telnet: connect to address 192.168.1.111: No route to host
telnet: Unable to connect to remote host: No route to host

如果出現這情況,我們憑經驗可以告訴我們可能是服務端的iptables或者SELINUX問題,

我們把NFS服務端的

iptables或者SELINUX關掉,

.關閉selinux

修改配置文件需要重啟機器:

修改/etc/selinux/config 文件

vim /etc/selinux/config

SELINUX=enforcing改為SELINUX=disabled

或者:

sed -i‘s#SELINUX=enforcing#SELINUX=disabled#g‘ /etc/selinux/config #修改配置文件永久生效,但必須重啟系統

★關閉防火墻iptables

[[email protected] ~]#  /etc/init.d/iptables stop
Flushing firewall rules:                                   [  OK  ]
Setting chains to policy ACCEPT: filter                    [  OK  ]
Unloading iptables modules:                                [  OK  ]
[[email protected] ~]#  /etc/init.d/iptablesstatus
Firewall is stopped.


3.再在客戶端用showmount 一下服務器

[[email protected] ~]# showmount -e 192.168.221.130
Export list for 192.168.221.130:
/data/r_shared 192.168.221.1/24
/data/w_shared 192.168.221.1/24

現在返回到NFS服務器共享目錄的信息,就OK了,現在就可以掛載了

4.使用mount -t對其進行掛載

[[email protected] ~]# mount -t nfs192.168.221.130:/data/bbs /mnt
[[email protected] ~]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda3             17981340   2124800 14928388  13% /
/dev/sda1               295561     16842   263459   7% /boot
tmpfs                    60136         0    60136   0% /dev/shm
192.168.221.130:/data/bbs
                      17981344   2100176 14953008  13% /mnt

提示:在剛學習linux的時候,建議把iptablesSELINUX關閉,


本文出自 “Mr.Xiong`s 運維日誌” 博客,請務必保留此出處http://mrxiong2017.blog.51cto.com/12559394/1932439

NFS使用mount掛載無法掛載出問題後的排錯思路(七)