实现session的高可用
环境| ip | 用途 |
|---|---|
| 192.168.233.196 | 调度器(nginx) |
| 192.168.233.17 | tomcat1 |
| 192.168.233.18 | tomcat2 |
http {
...
upstream tomcat {
server 192.168.233.17:8080 weight=1;
server 192.168.233.18:8080 weight=1;
}
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://tomcat;
#root html;
#index index.html index.htm;
}
}
}
2、在tomcat主机,server.xml文件里面的
#故障阈值3s
3、修改应用的web.xml文件开启该应用程序的分布式
root@ubuntu-17:/usr/local/tomcat/webapps/ROOT/WEB-INF# tail -3 web.xml#添加此行
至此tomcat session高可用集群配置完毕。



