linux - mount.nfs: access denied by server while mounting 192.168.8.104:/mnt/sdb/var/lib/glance/images -
before asking question, searched stackoverflow, answers no use: mount: nfs access denied server
in vm, have sda
, sdb
hard disk in vm.
then vm have ips:192.168.8.101
, 192.168.8.104
.
when mount sdb
's directory vm's directory under /var
:
[root@ha-node1 sdb]# mount -t nfs 192.168.8.104:/mnt/sdb/var/lib/glance/images /var/lib/glance/images
get below error:
mount.nfs: access denied server while mounting 192.168.8.104:/mnt/sdb/var/lib/glance/images
and directories under /mnt
permissions perfect.
[root@ha-node1 sdb]# ll -d /mnt/ drwxr-xr-x. 4 root root 26 jul 26 00:43 /mnt/ [root@ha-node1 sdb]# ll -d /mnt/sdb drwxr-xr-x 4 root root 4096 jul 26 10:05 /mnt/sdb [root@ha-node1 sdb]# ll -d /mnt/sdb/var/ drwxr-xr-x 3 root root 4096 jul 26 10:05 /mnt/sdb/var/ [root@ha-node1 sdb]# ll -d /mnt/sdb/var/lib/ drwxr-xr-x 3 root root 4096 jul 26 10:05 /mnt/sdb/var/lib/ [root@ha-node1 sdb]# ll -d /mnt/sdb/var/lib/glance/ drwxr-xr-x 3 root root 4096 jul 26 10:05 /mnt/sdb/var/lib/glance/ [root@ha-node1 sdb]# ll -d /mnt/sdb/var/lib/glance/images/ drwxr-xr-x 2 root root 4096 jul 26 10:05 /mnt/sdb/var/lib/glance/images/
the network connection ok.
[root@ha-node1 sdb]# ping 192.168.8.104 ping 192.168.8.104 (192.168.8.104) 56(84) bytes of data. 64 bytes 192.168.8.104: icmp_seq=1 ttl=64 time=0.024 ms 64 bytes 192.168.8.104: icmp_seq=2 ttl=64 time=0.030 ms 64 bytes 192.168.8.104: icmp_seq=3 ttl=64 time=0.032 ms 64 bytes 192.168.8.104: icmp_seq=4 ttl=64 time=0.031 ms
the nfs service works normal :
[root@ha-node1 sdb]# systemctl status nfs.service ● nfs-server.service - nfs server , services loaded: loaded (/usr/lib/systemd/system/nfs-server.service; enabled; vendor preset: disabled) active: active (exited) since wed 2017-07-26 00:26:23 cst; 11h ago process: 1916 execstart=/usr/sbin/rpc.nfsd $rpcnfsdargs (code=exited, status=0/success) process: 1786 execstartpre=/usr/sbin/exportfs -r (code=exited, status=0/success) main pid: 1916 (code=exited, status=0/success) cgroup: /system.slice/nfs-server.service jul 26 00:26:22 ha-node1 systemd[1]: starting nfs server , services... jul 26 00:26:23 ha-node1 systemd[1]: started nfs server , services.
in log grep mount:
[root@ha-node1 sdb]# cat /var/log/messages | grep mount jul 24 14:44:07 ha-node1 systemd: tmp.mount: directory /tmp mount on not empty, mounting anyway. jul 26 00:12:08 ha-node1 systemd: started dracut pre-mount hook. jul 26 00:12:11 ha-node1 systemd: started dracut mount hook. jul 26 00:12:15 ha-node1 systemd: started remount root , kernel file systems. jul 26 00:23:44 ha-node1 rpc.mountd[4312]: version 1.3.0 starting jul 26 00:26:02 ha-node1 systemd: started dracut pre-mount hook. jul 26 00:26:04 ha-node1 systemd: started dracut mount hook. jul 26 00:26:08 ha-node1 systemd: started remount root , kernel file systems. jul 26 00:26:22 ha-node1 rpc.mountd[1561]: version 1.3.0 starting jul 26 00:43:03 ha-node1 kernel: ext4-fs (sdb): mounted filesystem ordered data mode. opts: (null) jul 26 00:43:13 ha-node1 kernel: ext4-fs (sdc): mounted filesystem ordered data mode. opts: (null) jul 26 10:07:03 ha-node1 rpc.mountd[1561]: refused mount request 192.168.8.104 /mnt/sdb/var/lib/glance/images (/): not exported
it shows not exported
, tried exportfs -r
, no use.
someone can tell me this, why can not nfs mount sdb self directory?
the directories exported outer world controled file:'/etc/exports ' under linux os. add: /mnt/sdb/var/lib/glance/images *(rw,sync,no_subtree_check) in file , try again. example you, access right should modified accroding requirement. read manual of exports please.
Comments
Post a Comment