Use apache proxy tomcat cluster and implement session replication
1. System structure diagram
two。 Prepare for
Host tomcatA: shutting down iptables
Host tomcatB: shutting down iptables
Host apache: close iptables, close selinux
3. Install softwar
To install tomcat, please refer to: http://blog.csdn.net/kairui123/article/details/71247618
Install apache:yum install httpd
4. Configure appche
ProxyRequests off / / whether to enable forward agent SetHandler balancer-manager ServerAdmin www.creazyrui.com DocumentRoot / var/www/html ServerName www.creazyrui.com
Parameter explanation:
Loadfactor: specify weight
Route: specify host
5. Configure tomcat
At the end, the Welcome to tomcat welcome to tomcat / / element tells tomcat that the distributed reference / / will configure all the above files and modify the jvmRoute= to all the tomcat servers in the cluster.
6. Add pages and test