lnmp architecture-tomcat session

tomcat session sharing

deploy tomcat

Do the same on server2 and server3

 

 

 The saved information will be saved in the tomcat log

 

 Integration of tomcat and nginx

on server1

 

 

 

 

When the amount of concurrency starts to increase, load balancing must be done

 

Solve the problem that when a tomcat server hangs up, another server has the data submitted by the first server

Install memcached on both server2 and server3

The tomcat service cross-stores session information to memcached through the msm module

 

 

 Tomcat accesses memcache requires corresponding functional modules

 then edit the file

 

 restart tomcat

view log

[root@server2 tomcat]# cat logs/catalina.out

 

The configuration on server3 and so on

Test:  http://192.168.56.11/test.jsp

 

After closing the tomcat service on server3, it will automatically switch to server2

After closing the memcached service on server2, it will automatically switch to the memcached service on server3

 

 

Guess you like

Origin blog.csdn.net/weixin_59945551/article/details/132510762