Environment:
CentOS 6.6
Java version:1.6.0.38
Tomcat version:6.0.39
Terracotta version:3.7.5
Terracotta 3.7.5:
360:https://yunpan.cn/cbjgjarciynli Access Password 66BD
Official website: http://terracotta.org/downloads/open-source/destination?name=terracotta-3.7.5.tar.gz&bucket= Tcdistributions&file=terracotta-3.7.5.tar.gz
Note:tc-config.xml on both sides of the terracotta node need to be exactly the same
start-tc-server.sh need to add java_home environment variable
1, all Tomcat nodes can only be on one server, and Tomcat on other servers will not be able to join the terracotta, starting Tomcat also reported error, unknown reason
2, the local test is not a problem, but put in the code, every 2 minutes of pop-up logon situation, the reason is unknown
Terracotta requires three ports to be monitored:
9510: Listening for client connected ports
9520: Monitor Terracotta Developer console connected ports
9530:port for communication between terracotta
Node1:
[[email protected] ~]# tar -zxf terracotta-3.7.5.tar.gz -c /usr/local/[[ email protected] ~]# cd /usr/local/terracotta-3.7.5/[[email protected] terracotta-3.7.5]# cp config-samples/tc-config-express-reference.xml config-samples/ tc-config.xml[[email protected] terracotta-3.7.5]# cp sessions/ terracotta-session-1.3.5.jar common/terracotta-toolkit-1.6-runtime-5.5.0.jar /usr/local/server/ Tomcat1/lib/[[email protected] terracotta-3.7.5]# cp sessions/terracotta-session-1.3.5.jar common/terracotta-toolkit-1.6-runtime-5.5.0.jar /usr/local/server/tomcat2/lib/[[email protected] ~]# grep -i ' terracotta ' /usr/local/server/tomcat1/conf/context.xml< Valve classname= "Org.terracotta.session.TerracottaTomcat60xSessionValve" tcconfigurl= " 192.168.31.160:9510,192.168.31.170:9510 "/>[[email protected] ~]# grep -i ' terracotta ' /usr/local/server/tomcat2/conf/context.xml<valve classname= " Org.terracotta.session.TerracottaTomcat60xSessionValve " tcconfigurl=" 192.168.31.160:9510,192.168.31.170:9510 "/>[[email protected] ~]#
[[email protected] ~]# touch /opt/terracotta/realm.properties[[email protected] ~]# /usr/local/terracotta-3.7.5/bin/start-tc-server.sh -f /usr/local/terracotta-3.7.5/ Config-samples/tc-config.xml -n server1 &[[email protected] ~]# ps -ef |grep terracotta | grep -v greproot 1800 1223 0 17:11 pts/0 00:00:00 /bin/sh /usr/ local/terracotta-3.7.5/bin/start-tc-server.sh -f /usr/local/terracotta-3.7.5/config-samples/ tc-config.xmlroot 1813 1800 6 17:11 pts/0 &NBSP;&NBSP;&NBSP;&NBSP;00:00:12&NBSP;/USR/LOCAL/JDK1.6.0_38/BIN/JAVA&NBSP;-SERVER&NBSP;-XX: maxdirectmemorysize=9223372036854775807 -xms512m -xmx512m -xx:+heapdumponoutofmemoryerror -dcom.sun.management.jmxremote -dtc.install-root=/usr/local/terracotta-3.7.5/bin/. -dsun.rmi.dgc.server.gcinterval=31536000000 -cp /usr/local/terracotta-3.7.5/bin/. /lib/tc.jar com.tc.server.tcservermain -f /usr/local/terracotta-3.7.5/config-samples/ tc-config.xml[[email protected] ~]#
Node2:
[Email protected] ~]# tar-zxf terracotta-3.7.5.tar.gz-c/usr/local/[[email protected] ~]# cd/usr/local/terracotta-3.7 .5/[[email protected] terracotta-3.7.5]# CP config-samples/tc-config-express-reference.xml config-samples/ Tc-config.xml[[email protected] ~]#/usr/local/terracotta-3.7.5/bin/start-tc-server.sh-f/usr/local/ Terracotta-3.7.5/config-samples/tc-config.xml-n Server2 &
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/83/FE/wKiom1eDD-TyaRKSAACDz0aqn6g599.png "style=" float: none; "title=" 1.png "alt=" Wkiom1edd-tyarksaacdz0aqn6g599.png "/>
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/83/FD/wKioL1eDD-TDWVQ-AABFfgsk4kM728.png "style=" float: none; "title=" 2.png "alt=" Wkiol1edd-tdwvq-aabffgsk4km728.png "/>
[Email protected] ~]#/usr/local/server/tomcat1/bin/startup.sh[[email protected] ~]#/usr/local/server/tomcat2/bin/ Startup.sh[[email protected] ~]#/etc/init.d/nginx start
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/83/FE/wKiom1eDEByybkTGAABECD61PdM125.png "style=" float: none; "title=" 1.png "alt=" Wkiom1edebyybktgaabecd61pdm125.png "/>
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/83/FD/wKioL1eDEBygv4gaAABEOnXhN8E960.png "style=" float: none; "title=" 2.png "alt=" Wkiol1edebygv4gaaabeonxhn8e960.png "/>
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/83/FE/wKiom1eDEB3jneJrAABLBSuZ0YA079.png "style=" float: none; "title=" 3.png "alt=" Wkiom1edeb3jnejraablbsuz0ya079.png "/>
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/83/FE/wKiom1eDEB3QXIasAABP_hWfm_Y120.png "style=" float: none; "title=" 4.png "alt=" Wkiom1edeb3qxiasaabp_hwfm_y120.png "/>
Open the Terracotta development tool DEV-CONSOL (Note: The Linux server needs to have a graphical interface installed)
[Email protected] ~]#/usr/local/terracotta-3.7.5/bin/dev-console.sh
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/83/FE/wKiom1eDEEqjZglsAADDTizr8tc704.png "style=" float: none; "title=" 1.png "alt=" Wkiom1edeeqjzglsaaddtizr8tc704.png "/>
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/83/FD/wKioL1eDEEuy7_0YAAEUcSL0Fiw464.png "style=" float: none; "title=" 2.png "alt=" Wkiol1edeeuy7_0yaaeucsl0fiw464.png "/>
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/83/FD/wKioL1eDEEuBdlgRAAEyZTKk628570.png "style=" float: none; "title=" 3.png "alt=" Wkiol1edeeubdlgraaeyztkk628570.png "/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/83/FE/wKiom1eDEEuhKcCFAAEkMdPpQvo611.png "style=" float: none; "title=" 4.png "alt=" Wkiom1edeeuhkccfaaekmdppqvo611.png "/>
The above is the installation method.
This article from "Pengcheng-soy sauce bottle" blog, declined reprint!
Deploying the Terracotta cluster storage tomcat session