NFS 是Network File System的缩写,即网络文件系统,一种使用于分散式文件系统的协定
NFS通过网络让不同的机器、不同的操作系统能够彼此分享个别的数据,例如将/home设置为共享目录,然后共享给网络中的其它服务器,这样每台机器就不必单独建立自己的/home路径了,NFS独立于操作系统,容许不同硬件及操作系统的系统共同进行文件的分享,是在类Unix系统间实现磁盘文件共享的一种方法
NFS本身没有提供信息传输的协议和功能,而是使用RPC服务完成这部分功能。可以说NFS本身就是使用RPC服务的一个程序,或者说NFS也是一个RPC SERVER。所以只要用到NFS的地方都要启动RPC服务,不论是NFS server还是NFS client,可以这么理解RPC和NFS之间的关系:NFS是一个文件系统,而RPC负责信息的传输
一,系统环境
Linux Distribution:Ubuntu 14
二,安装Linux NFS
sean@sean:~$ sudo apt-get install nfs-kernel-server
[sudo] password for sean:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
keyutils libgssglue1 libnfsidmap2 libtirpc1 nfs-common rpcbind
Suggested packages:
open-iscsi watchdog
The following NEW packages will be installed:
keyutils libgssglue1 libnfsidmap2 libtirpc1 nfs-common nfs-kernel-server
rpcbind
0 upgraded, 7 newly installed, 0 to remove and 159 not upgraded.
Need to get 460 kB of archives.
After this operation, 2,049 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libgssglue1 amd64 0.4-2ubuntu1 [19.7 kB]
Get:2 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libnfsidmap2 amd64 0.25-5 [32.2 kB]
Get:3 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libtirpc1 amd64 0.2.2-5ubuntu2 [71.3 kB]
Get:4 http://cn.archive.ubuntu.com/ubuntu/ trusty/main keyutils amd64 1.5.6-1 [33.6 kB]
Get:5 http://cn.archive.ubuntu.com/ubuntu/ trusty-updates/main rpcbind amd64 0.2.1-2ubuntu2.2 [37.1 kB]
Get:6 http://cn.archive.ubuntu.com/ubuntu/ trusty-updates/main nfs-common amd64 1:1.2.8-6ubuntu1.2 [181 kB]
Get:7 http://cn.archive.ubuntu.com/ubuntu/ trusty-updates/main nfs-kernel-server amd64 1:1.2.8-6ubuntu1.2 [85.8 kB]
Fetched 460 kB in 16s (27.2 kB/s)
Selecting previously unselected package libgssglue1:amd64.
(Reading database ... 168701 files and directories currently installed.)
Preparing to unpack .../libgssglue1_0.4-2ubuntu1_amd64.deb ...
Unpacking libgssglue1:amd64 (0.4-2ubuntu1) ...
Selecting previously unselected package libnfsidmap2:amd64.
Preparing to unpack .../libnfsidmap2_0.25-5_amd64.deb ...
Unpacking libnfsidmap2:amd64 (0.25-5) ...
Selecting previously unselected package libtirpc1:amd64.
Preparing to unpack .../libtirpc1_0.2.2-5ubuntu2_amd64.deb ...
Unpacking libtirpc1:amd64 (0.2.2-5ubuntu2) ...
Selecting previously unselected package keyutils.
Preparing to unpack .../keyutils_1.5.6-1_amd64.deb .