Specific configuration and Tomcat under the same, please refer to:
Http://note.youdao.com/share/?id=e486a2e17eefbfab6f227dc9dddd0cef&type=note
Here are some notes:
One
Tomcat cluster and load balancing implementation (session synchronization) Supplement
Because the session Sync feature of Tomcat requires multicast, Windows is enabled by default for multicast, but Linux is not enabled by default.
You can open the route add-net 224.0.0.0 netmask 240.0.0.0 dev eth0 #eth0,eth1,eth2 by instruction ... Represents a NIC, Nic two , Nic three
Use: Route add-net 224.0.0.0 netmask 240.0.0.0 Dev lo #这个代表本机, eth0,eth1,eth2 ... if the following conditions are met Represents Nic one, Nic two, Nic three ... lo stands for 127.0.0.1, or localhost
1) Receiver's address is auto
2) Multiple Tomcat of this machine do cluster
If you need to open multicast when the server is started, you need to include eht0 net 224.0.0.0 netmask 240.0.0.0 in the/etc/sysconfig/static-routes file.
For specific multicast concepts, please refer to CCNP related content.
Two
I generally refer to the project release (Hot Deployment), in the Server.xml c/> can also be added.
[HTML] view Plaincopy
- < Context path="" docBase="D:\apache-tomcat-6.0.35\logintest1" reloadable= "true" distributable="true" />
Three
In the Server.xml element
[HTML] view Plaincopy
- < Receiver className="Org.apache.catalina.tribes.transport.nio.NioReceiver"
- Address="Auto"
- Port="The "
- selectortimeout="+"
- maxthreads="6"/>
Where address is written as auto, many times the server will automatically use 127.0.0.1, which will cause problems, so when the server does not automatically read the local LAN IP, we manually set up a bit, such as: 192.168.0.2, so a contest with auto insurance.
Four
Server.xml we add some of the content part of the specific meaning and trial, the official has a description, reference can be.
The above describes the site cluster solution--nginx+tomcat session sharing program Linux, including the session,tomcat aspects of the content, I hope to be interested in PHP tutorial friends helpful.