NFS 安装与配置

3/5/2016 NFS网络存储

# NFS 部署

# NFS服务器端配置

[root@<hostname> software] yum install nfs-utils
[root@<hostname> software] mkdir -p /sharedir/game /sharedir/user
[root@<hostname> software] chown -R 777 /sharedir
[root@<hostname> software] vi /etc/exports #填入如下内容
/sharedir/game 10.80.8.0/24(rw,no_root_squash)
/sharedir/user 10.80.8.0/24(rw,no_root_squash)
[root@<hostname> software] service rpcbind start
[root@<hostname> software] service nfs start
[root@<hostname> software] chkconfig rpcbind on
[root@<hostname> software] chkconfig nfs on
1
2
3
4
5
6
7
8
9
10

# NFS客户端配置

[root@<hostname> software] yum install nfs-utils
[root@<hostname> software] vi /etc/fstab #末尾追加如下内容
apbackup:/sharedir/game /data/www/game/web/static/uploadsnfsnodev,rw,rsize=32768,wsize=32768 0 0
apbackup:/sharedir/user /data/www/user/web/static/uploadsnfsnodev,rw,rsize=32768,wsize=32768 0 0
[root@<hostname> software] mount /data/www/game/web/static/uploads
[root@<hostname> software] mount/data/www/user/web/static/uploads
1
2
3
4
5
6