[toc]

  1. 61.164.186.242主服务器上建立nfs服务
    共享图片目录/home/onoboss/td_chs/union_img,/home/onoboss/td_chs/images/te
  2. 61.164.186.24[1|6]安装nfs客户端
    使用mount磁盘挂载把本地目录替换为242的nfs远程目录,客户端实际上都读写242的远程目录

服务端

61.164.186.242

安装

[shell]apt-get install nfs-kernel-server[/shell]

配置

共享目录

将/home/onoboss/td_chs/union_img,/home/onoboss/td_chs/images/te目录共享给本网段61.164.186.0/24

vim /etc/exports

[shell]

/home/onoboss/td_chs/union_img 61.164.186.0/24(rw,sync,no_root_squash,no_subtree_check)
/home/onoboss/td_chs/images/te 61.164.186.0/24(rw,sync,no_root_squash,no_subtree_check)

[/shell]

目录权限

允许读写

[shell]

chmod -R 0777 /home/onoboss/td_chs/union_img
chmod -R 0777 /home/onoboss/td_chs/images/te

[/shell]

客户端

61.164.186.241,61.164.186.246

安装

[shell]apt-get install nfs-common[/shell]

配置

手动挂载

[shell]

mount 61.164.186.242:/home/onoboss/chs/union_img /home/onoboss/chs/union_img
mount 61.164.186.242:/home/onoboss/chs/images/te /home/onoboss/chs/images/te

[/shell]

开机自动挂载

vim /etc/fstab

61.164.186.242:/home/onoboss/chs/union_img      /home/onoboss/chs/union_img     nfs     nosuid,noexec,nodev,rw,bg,soft,rsize=32768,wsize=32768  0       0
61.164.186.242:/home/onoboss/chs/images/te      /home/onoboss/chs/images/te     nfs     nosuid,noexec,nodev,rw,bg,soft,rsize=32768,wsize=32768  0       0