Website cluster solution - nginx+tomcat session sharing solution linux php session sessionfactory session lost

WBOY
Release: 2016-07-29 08:50:27
Original
959 people have browsed it

The specific configuration is the same as that under tomcat. Please refer to:

http://note.youdao.com/share/?id=e486a2e17eefbfab6f227dc9dddd0cef&type=note

Here are some notes:

1,

tomcat cluster Supplementary to the implementation of load balancing (session synchronization)

Because tomcat’s session synchronization function requires multicast, multicast service is enabled by default in windows, but not enabled by default in linux.

You can open route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0 through the command #eth0, eth1, eth2... represents network card one, network card two, network card three

If the following conditions are met, Please use: route add -net 224.0.0.0 netmask 240.0.0.0 dev lo #This represents the local machine, eth0, eth1, eth2... represents network card one, network card two, network card three... lo represents 127.0.0.1, which is localhost

1) The address of the Receiver is auto

2) Multiple tomcats on this machine are used as a cluster

If you need to activate multicast when the server starts, you need to add eht0 net in the /etc/sysconfig/static-routes file 224.0.0.0 netmask 240.0.0.0.

For specific multicast concepts, please refer to CCNP related content.

Second,

I usually refer to project release (hot deployment), and you don’t need to add it in C/> in server.xml.

[html] view plaincopy

  1. ​​​<Contextpath=""docBase="D:apache-tomcat-6.0.35 logintest1"reloadable= "true" distributable="true" />

3. In the

server.xml element,

[html] view plaincopy

  1.                                                        Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
  2.                                                      Le Selectortimeout
  3. =
  4. "100"
  5. maxthreads = "6" /& gt; 127.0.0.1, this will cause problems, so when the server does not automatically read the local LAN IP, we set it manually, such as: 192.168.0.2, which is safer than trying auto.
  6. 4. The specific meanings and trials of some of the new content we added in
  7. server.xml are officially explained, just refer to them. The above introduces the website cluster solution-nginx+tomcat session sharing solution linux, including Session and tomcat content. I hope it will be helpful to friends who are interested in PHP tutorials.
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template