Service configuration: Number of 3 units: Tomcat_69 tomcat_108 nginx_134 redis: Installed on the tomcat_69 above, The port is 63791. Copy the Redis-tomcat dependency package to the/usr/local/tomcat7/lib directory: http://down.51cto.com/data/21260362. Configuring Tomcat_ 69 under the Context.xml[[email protected]_server conf]# vim /usr/local/tomcat7/conf/context.xml <valve classname= "Com.orangefunction.tomcat.redissessions.RedisSessionHandlerValve" />< Manager classname= "Com.orangefunction.tomcat.redissessions.RedisSessionManager" host= "localhost" port= "6379" database= "0" maxinactiveinterval= "/>3". tomcat_108 under Configuration context.xml[[email Protected]_server ~]# vim /usr/local/tomcat7/conf/context.xml<valve classname= " Com.orangefunction.tomcat.redissessions.RedisSessionHandlerValve " /><manager classname=" Com.orangefunction.tomcat.redissessions.RedisSessionManager " host=" 10.200.134.69 " port=" 6379 " database= "0" maxinactiveinterval= "/>4". Edit a Tomcat test page vim /usr/local/tomcat7/webapps/root/index.jsp<%@ page language= "Java" %>8. #查看redis [[Email protected]_server lib]# redis-cli 127.0.0.1:6379> KEYS] "31cc406da697e01839c9b04c1cadcb05" 2) " 4865467a9dc8da88c3eee06731d81606 "3)" e029f555ee14331949d4ca53d3374890 "127.0.0.1:6379>
This article is from the "9527" blog, please be sure to keep this source http://liangey.blog.51cto.com/9097868/1722140
Nginx+tomcat+redis (single point)