NFS出错,不能挂载
[root@db weblogs]# mount -o rw -t nfs 192.168.0.131:/usr/local/apache/logs/accesslog /weblogs/web1
mount: mount to NFS server '192.168.0.131' failed: RPC Error: Program not registered.
登陆到131上查看/var/log/message
Sep 23 09:53:46 web1 portmap[21711]: warning: cannot open /etc/hosts.deny: Permission denied
Sep 23 09:53:46 web1 portmap[22049]: connect from 192.168.0.135 to getport(nfs): request from unauthorized host
Sep 23 09:53:46 web1 portmap[21711]: warning: cannot open /etc/hosts.deny: Permission denied
Sep 23 09:53:46 web1 portmap[22050]: connect from 192.168.0.135 to getport(nfs): request from unauthorized host
Sep 23 09:53:46 web1 portmap[21711]: warning: cannot open /etc/hosts.deny: Permission denied
Sep 23 09:53:46 web1 portmap[22051]: connect from 192.168.0.135 to getport(nfs): request from unauthorized host
Sep 23 09:53:46 web1 portmap[21711]: warning: cannot open /etc/hosts.deny: Permission denied
Sep 23 09:53:46 web1 portmap[22052]: connect from 192.168.0.135 to getport(nfs): request from unauthorized host
Sep 23 09:53:46 web1 portmap[21711]: warning: cannot open /etc/hosts.deny: Permission denied
Sep 23 09:53:46 web1 portmap[22053]: connect from 192.168.0.135 to getport(nfs): request from unauthorized host
Sep 23 09:53:46 web1 portmap[21711]: warning: cannot open /etc/hosts.deny: Permission denied
Sep 23 09:53:46 web1 portmap[22054]: connect from 192.168.0.135 to getport(nfs): request from unauthorized host
Sep 23 09:53:48 web1 setroubleshoot: SELinux is preventing /sbin/portmap (portmap_t) "read" access to hosts.deny (etc_runtime_t). For complete SELinux messages. run sealert -l d32f9195-edbb-4292-b514-af3ebe8b7cba
[root@web1 accesslog]# setsebool -P portmap_disable_trans=1
查看日志
[root@web1 accesslog]# tail -f /var/log/messages
Sep 23 09:46:57 web1 portmap[21711]: warning: cannot open /etc/hosts.deny: Permission denied
Sep 23 09:46:57 web1 portmap[21897]: connect from 192.168.0.135 to getport(nfs): request from unauthorized host
Sep 23 09:46:57 web1 portmap[21711]: warning: cannot open /etc/hosts.deny: Permission denied
Sep 23 09:46:57 web1 portmap[21898]: connect from 192.168.0.135 to getport(nfs): request from unauthorized host
Sep 23 09:46:57 web1 portmap[21711]: warning: cannot open /etc/hosts.deny: Permission denied
Sep 23 09:46:57 web1 portmap[21899]: connect from 192.168.0.135 to getport(nfs): request from unauthorized host
Sep 23 09:46:59 web1 setroubleshoot: SELinux is preventing /sbin/portmap (portmap_t) "read" access to hosts.deny (etc_runtime_t). For complete SELinux messages. run sealert -l d32f9195-edbb-4292-b514-af3ebe8b7cba
Sep 23 09:46:59 web1 last message repeated 11 times
Sep 23 09:53:15 web1 dbus: Can't send to audit system: USER_AVC avc: received policyload notice (seqno=3) : exe="?" (sauid=81, hostname=?, addr=?, terminal=?)
Sep 23 09:53:15 web1 setsebool: The portmap_disable_trans policy boolean was changed to 1 by root
看来这样不能解决问题
更改/etc/hosts.allow
添加ALL: 192.168.0.135
重新挂载
[root@db weblogs]# mount -o rw -t nfs 192.168.0.131:/usr/local/apache/logs/accesslog /weblogs/web1
成功