開始使用這個:java
mount -t nfs 192.168.119.138:/root/work /shareapp
報錯:dom
cat /var/log/messages | grep mountsocket
Nov 4 15:16:09 air02 rpc.mountd[19139]: Caught signal 15, un-registering and exiting.this
Nov 4 15:16:34 air02 rpc.mountd[19202]: Could not bind socket: (13) Permission deniedspa
Nov 4 15:16:34 air02 rpc.mountd[19202]: Could not bind socket: (13) Permission deniedrest
Nov 4 15:16:34 air02 rpc.mountd[19202]: Could not bind socket: (13) Permission deniedcode
Nov 4 15:16:34 air02 rpc.mountd[19202]: Could not bind socket: (13) Permission deniedserver
Nov 4 15:16:34 air02 rpc.mountd[19202]: Could not bind socket: (13) Permission deniedrpc
Nov 4 15:16:34 air02 rpc.mountd[19202]: Could not bind socket: (13) Permission denied
Nov 4 15:16:34 air02 rpc.mountd[19206]: Version 1.2.7 starting
換成這個ok:mount -t nfs air02:/root/work /share
輔助:
1. 使用的命令:
yum install portmap nfs-utils
service nfs start
exportfs -a
service nfs restart
service nfs start.若是在啓動以後須要修改exports,能夠exportfs -rv從新輸出.
2. 文章:
Configure as a NFS Client(http://www.server-world.info/en/note?os=Fedora_19&p=nfs&f=2) [root@www ~]# yum -y install nfs-utils [root@www ~]# vi /etc/idmapd.conf # line 5: uncomment and change to your domain name Domain = server.world [root@www ~]# systemctl start rpcbind.service [root@www ~]# systemctl start nfs-lock.service [root@www ~]# systemctl start nfs-idmap.service [root@www ~]# systemctl start nfs-mountd.service [root@www ~]# systemctl enable rpcbind.service [root@www ~]# systemctl enable nfs-lock.service [root@www ~]# systemctl enable nfs-idmap.service [root@www ~]# systemctl enable nfs-mountd.service [root@www ~]# mount -t nfs dlp.server.world:/home /home [root@www ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/fedora-root 27G 979M 25G 4% / devtmpfs 996M 0 996M 0% /dev tmpfs 1002M 0 1002M 0% /dev/shm tmpfs 1002M 276K 1002M 1% /run tmpfs 1002M 0 1002M 0% /sys/fs/cgroup tmpfs 1002M 8.0K 1002M 1% /tmp /dev/vda1 477M 77M 375M 17% /boot dlp.server.world:/home 27G 982M 25G 4% /home # home directory on NFS is mounted [root@www ~]# vi /etc/fstab /dev/mapper/fedora-root / ext4 defaults 1 1 UUID=61085d0b-960b-4835-8c0e-6f036fe7a623 /boot ext4 defaults 1 2 /dev/mapper/fedora-swap swap swap defaults 0 0 # add at the lat line: change home directory this server mounts to the one on NFS dlp.server.world:/home /home nfs defaults 0 0 Configure as a NFS Server [root@dlp ~]# yum -y install nfs-utils [root@dlp ~]# vi /etc/idmapd.conf # line 5: uncomment and change to your domain name Domain = server.world [root@dlp ~]# vi /etc/exports # write like below *note /home 10.0.0.0/24(rw,sync,no_root_squash,no_all_squash) # *note/home ⇒ shared directory 10.0.0.0/24 ⇒ range of networks NFS permits accesses rw ⇒ writable sync ⇒ synchronize no_root_squash ⇒ enable root privilege no_all_squash ⇒ enable users' authority [root@dlp ~]# systemctl start rpcbind.service [root@dlp ~]# systemctl start nfs-server.service [root@dlp ~]# systemctl start nfs-lock.service [root@dlp ~]# systemctl start nfs-idmap.service [root@dlp ~]# systemctl enable rpcbind.service [root@dlp ~]# systemctl enable nfs-server.service [root@dlp ~]# systemctl enable nfs-lock.service [root@dlp ~]# systemctl enable nfs-idmap.service