这是一个简单的集群框架
192.168.142.10做负载均衡(主)
192.168.142.20(副)
先做keepalive
两台nginx做七层反向代理(动静分离)
192.168.142.30
192.168.142.40
部署tomcat做多实例部署
192.168.142.50:8080
192.168.142.50:8081
nfs共享
192.168.142.60
客户端
192.168.142.70
vip 192.168.142.188
先部署主备负载均衡器
两台负载均衡器(主从)配置完成
配置nfs服务器
在opt目录下创建kgc和benet目录
在其中配置html文件
配置nginx节点服务器,做动静分离,七层反向代理
安装nginx
systemctl stop firewalld.service
systemctl disable firewalld.service
setenforce 0
yum install httpd -y
systemctl start httpd.service
systemctl enable httpd.service
yum install nfs-utils rpcbind -y
showmount -e 192.168.142.60
systemctl start rpcbind
systemctl enable rpcbind
--192.168.142.30---
mount.nfs 192.168.142.60:/opt/kgc /var/www/html
部署tomcat(多实例部署)
<Server port="8006" shutdown="SHUTDOWN"> #22行,修改Server prot,默认为8005 -> 修改为8006
<Connector port="8081" protocol="HTTP/1.1" #69行,修改Connector port,HTTP/1.1 默认为8080 -> 修改为8081
<Connector port="8010" protocol="AJP/1.3" redirectPort="8443" /> #116行,修改Connector port AJP/1.3,默认为8009 -> 修改为8010
测试开始
关闭主服务器keepalive