苹果nfs文件服务器,Linux服务器文件同步(NFS服务)

服务器:

服务端:10.26.68.245

客户端:10.26.32.14

一、服务端配置:

1、如果没有安装的话执行

yum install nfs-utils -y

2、启动服务

centos6

/etc/init.d/rpcbind start 先启动rpcbind服务

/etc/init.d/nfs start 再启动nfs服务

centos7

systemctl start rpcbind 先启动rpcbind服务

systemctl start nfs 再启动nfs服务

3、设置开机启动

centos6

chkconfig --level 35 nfs on nfs服务开机启动

chkconfig --level 35 rpcbind on    rpcbind服务开机启动

chkconfig --list nfs 查看nfs开机启动列表

chkconfig --list rpcbind 查看rbcbind开机启动列表

centos 7

systemctl enable rpcbind 先启动rpcbind服务

systemctl enable nfs 启动nfs服务

4.创建同步文件夹

mkdir -p /var/www/html/img

chown -R nfsnobody:nfsnobody /var/www/html/img 更改所属组

5.编辑nfs挂载权限配置文件

vi /etc/exports

/var/www/html/img 10.26.32.14(rw,sync,all_squash,insecure)

/var/www/html/img 客户端1IP(rw,sync,all_squash,insecure)

5.设置nfs端口

vi /etc/sysconfig/nfs

MOUNTD_PORT="4002"

STATD_PORT="4003"

LOCKD_TCPPORT="4004"

LOCKD_UDPPORT="4004"

6.停止nfs服务

systemctl stop nfs-server

systemctl stop rpcbind

启动nfs服务

systemctl stop nfs-server

systemctl stop rpcbind

7、查看使用的nfs端口

rpcinfo -p

100000    4   tcp    111  portmapper

100000    3   tcp    111  portmapper

100000    2   tcp    111  portmapper

100000    4   udp    111  portmapper

100000    3   udp    111  portmapper

100000    2   udp    111  portmapper

100005    1   udp   4002  mountd

100005    1   tcp   4002  mountd

100005    2   udp   4002  mountd

100005    2   tcp   4002  mountd

100005    3   udp   4002  mountd

100005    3   tcp   4002  mountd

100024    1   udp   4003  status

100024    1   tcp   4003  status

100003    3   tcp   2049  nfs

100003    4   tcp   2049  nfs

100227    3   tcp   2049  nfs_acl

100003    3   udp   2049  nfs

100003    4   udp   2049  nfs

100227    3   udp   2049  nfs_acl

100021    1   udp  45989  nlockmgr

100021    3   udp  45989  nlockmgr

100021    4   udp  45989  nlockmgr

100021    1   tcp  43094  nlockmgr

100021    3   tcp  43094  nlockmgr

100021    4   tcp  43094  nlockmgr

二、客户端配置10.26.32.14:

1.服务端路径与本地路径挂载mount -t nfs 10.26.68.245:/var/www/html/img /var/www/html/img

三、报错与异常

1、exportfs -rv 重新加载配置文件

1.mount后服务器使用ls df等命令出现卡顿,在服务端进行了挂载操作。

取消挂载目录使用 umount /var/www

如果提示device busy 使用umount -l  /var/www/ 命令。

2.网段绑定问题

如果需要绑定一个网段下的机器,服务端设置/etc/exports ip修改为类似10.10.0.0/16

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值