CMS多重服务器搭载(通过nfs挂载方式)

来源:互联网 发布:csol优化软件 编辑:程序博客网 时间:2024/06/06 17:39

**首先,确定存在Linux服务器①,②,③,④四台服务器,当然可以更多,以四台为例:
①,②服务器上前后台都运行;③运行定时器;④是数据库服务器,以及存放源码,确定都可以联网**

第一步:查看这四台服务器的nfs以及rpcbind是否已安装;
rpm -qa | grep nfs—-查看是否安装nfs
rmp -qa | grep rpcbind—-查看是否安装 rpcbind
如果未安装,则安装这两个软件;
yum install nfs-utils
yum install rpcbind

第二步:在源码服务器④上修改 /etc/exports 文件,添加需要挂载的文件目录
—-其中ro是readonly rw是read write
目录一 ip①(ro,no_root_squash,no_all_squash,sync)
目录一 ip②(ro,no_root_squash,no_all_squash,sync)
目录一 ip③(ro,no_root_squash,no_all_squash,sync)

目录二 ip①(rw,no_root_squash,no_all_squash,sync)
目录二 ip②(rw,no_root_squash,no_all_squash,sync)
目录二 ip③(rw,no_root_squash,no_all_squash,sync)

目录三 ip①(rw,no_root_squash,no_all_squash,sync)
目录三 ip②(rw,no_root_squash,no_all_squash,sync)
目录三 ip③(rw,no_root_squash,no_all_squash,sync)

第三步:在源码服务器④上修改,查看服务器防火墙开关状态
rpm qa | grep iptables—-查看是否安装防火墙
service iptables status —-查看防火墙状态
如果防火墙打算一直关闭,当前步骤忽略
如果防火墙打算一直开启,那么编辑 /etc/sysconfig/nfs 在最后添加
RQUOTAD_PORT=10000
LOCKD_TCPPORT=10001
LOCKD_UDPPORT=10001
MOUNTD_PORT=10002
STATD_PORT=10003
然后再修改 /etc/sysconfig/iptables 添加—-
-A INPUT -p tcp -m state –state NEW -m tcp –dport 1521 -j ACCEPT
-A INPUT -p tcp -m state –state NEW -m tcp –dport 111 -j ACCEPT
-A INPUT -p udp -m state –state NEW -m udp –dport 111 -j ACCEPT
-A INPUT -p tcp -m state –state NEW -m tcp –dport 2049 -j ACCEPT
-A INPUT -p udp -m state –state NEW -m udp –dport 2049 -j ACCEPT
-A INPUT -p tcp -m state –state NEW -m tcp –dport 10000:10003 -j ACCEPT
-A INPUT -p udp -m state –state NEW -m udp –dport 10000:10003 -j ACCEPT

第四步:在服务器①,②,③上修改 /etc/rc.d/rc.local文件

mount -t nfs源服务器④ip地址:目录一 当前服务器目录一
mount -t nfs 源服务器④ip地址:目录二 当前服务器目录二
mount -t nfs 源服务器④ip地址:目录三 当前服务器目录三

完成!

0 0