#nfs#

之前在ubuntu中安装了一个nfs server(参考:http://ju.outofmemory.cn/entry/87593)

例子:
Ubuntu 14.04下NFS安装配置

1、执行命令:sudo apt-get install nfs-kernel-server ;
2、执行命令:mkdir /home/jacobxu/nfs-jacoxu 建立一个nfs服务的专有的文件夹;
3、建立好文件夹后,接着执行命令:sudo vi /etc/exports 配置nfs;
4、在文章的最后一行添加:/home/jacobxu/nfs-jacoxu *(rw,sync,no_root_squash,no_subtree_check)
/home/jacobxu/nfs-jacoxu *(rw,sync,no_root_squash,no_subtree_check)这一行的含义是:
/home/jacobxu/nfs-jacoxu:与nfs服务客户端共享的目录,这个路径必须和你前面设置的文件的路径一致!
*:允许所有的网段访问,也可以使用具体的IP
rw:挂接此目录的客户端对该共享目录具有读写权限
sync:资料同步写入内存和硬盘
no_root_squash:root用户具有对根目录的完全管理访问权限。
no_subtree_check:不检查父目录的权限。
5、修改完上述配置文件保存退出。
6、执行命令:sudo /etc/init.d/rpcbind restart 重启rpcbind 服务。nfs是一个RPC程序,使用它前,需要映射好端口,通过rpcbind 设定。
7、执行命令:sudo /etc/init.d/nfs-kernel-server restart 重启nfs服务。
8、挂载指令:
sudo mount -t nfs 192.168.111.128:/home/jacobxu/nfs-jacoxu /nfs-jacoxu-node001/
到任意一台服务器中执行挂载指令,则可以将指定ip服务器上的共享路径,挂载到本地。


当我在另一台ubuntu上试图挂载时,提示以下错误:

root@workgroup1:~# mount -t nfs 172.15.77.157:/opt/dataset ~/nfsm
mount: wrong fs type, bad option, bad superblock on 172.15.77.157:/opt/dataset,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

安装了这个应该可以了:

sudo apt-get install nfs-common


你可能感兴趣的:(#nfs#)