1.服务端部署

#安装

    sudo apt-get install nfs-kernel-server
    sudo apt-get install nfs-common
    sudo apt-get instal  rpcbind

#启动

    sudo service nfs-kernel-server start
    sudo service nfs-common start
    sudo service rpcbind start

#测试nfs是否启动成功

    showmount -e localhost

2.客户端部署

#安装

    sudo apt-get install nfs-common
    sudo apt-get install  rpcbind

#启动

    sudo service nfs-common start
    sudo service rpcbind start

3.服务端配置

#编辑配置文件

vim /etc/exports   #编辑配置可以分享多个目录
/data/www_upload  172.16.0.0/16(rw,sync,all_squash)
/data/blog_upload  172.16.0.0/16(rw,sync,all_squash)
/data/bbs_upload 172.16.0.0/16(rw,sync,all_squash)

#重载nfs配置

    sudo exportfs -rv

4.客户端挂载

sudo mount -t nfs 172.16.1.31:/data/www_upload /data/www/upload
sudo mount -t nfs 172.16.1.31:/data/blog_upload /data/blog/upload
sudo mount -t nfs 172.16.1.31:/data/bbs_upload /data/bbs/upload