linux Centos (6.6)服务器之间文件共享挂载
目的:因为服务器设置了负载均衡,多服务器的文件上传必然要同步,这里的目的把服务器1设置为主文件服务器
服务器1:192.168.1.100
服务器2:192.168.1.20
风来了.呆狐狸
安装基础所需套件[每台]
1.nfs
- yum install nfs-utils
2.设置服务自启动
- chkconfig rpcbind on
- chkconfig nfs on
3.启动服务
- service rpcbind start
- service nfs start
[root@localhost database]# yum install portmap
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.cug.edu.cn
* epel: ftp.cuhk.edu.hk
* extras: mirrors.sina.cn
* updates: mirrors.zju.edu.cn
软件包 rpcbind-0.2.0-33.el7_2.x86_64 已安装并且是最新版本
无须任何处理
[root@localhost database]# /etc/init.d/portmap start
bash: /etc/init.d/portmap: 没有那个文件或目录
[root@localhost database]# /usr/sbin/showmount
clnt_create: RPC: Program not registered
[root@localhost database]# /etc/init.d/rpcbind start
bash: /etc/init.d/rpcbind: 没有那个文件或目录
[root@localhost database]# /etc/init.d/rpcbind start
bash: /etc/init.d/rpcbind: 没有那个文件或目录
[root@localhost database]# /etc/init.d/
iprdump iprinit iprupdate mysql mysql-proxy netconsole network
[root@localhost database]# service rpcbind start
Redirecting to /bin/systemctl start rpcbind.service
[root@localhost database]# service nfs start
Redirecting to /bin/systemctl start nfs.service
[root@localhost database]# exportfs -r
[root@localhost database]# show
show-changed-rco showconsolefont show-installed showkey showmount showrgb
[root@localhost database]# show
show-changed-rco showconsolefont show-installed showkey showmount showrgb
[root@localhost database]# showmount -e 143.89.115.4
Export list for 143.89.115.4:
/home/data *
登陆本地服务器, root
mount -t nfs -o rw 143.89.115.4:/home/data /home/shenzy/database/
Recent Comments