Overview
This document is used to describe in detail the nginx+tomcat+redisload balancing implementationsessionsharing
required software and download address
software name |
Download Address |
Function description |
Nginx-v1.6.0 |
http://nginx.org/download/nginx-1.6.0.tar.gz |
Load balancing |
commons-pool-2-2.4.2.jar |
http://mirrors.hust.edu.cn/apache//commons/pool/binaries/commons-pool2-2.4.2-bin.tar .gz |
|
jedis-2.7.3.jar |
http://central.maven.org/maven2/redis/clients/jedis/2.7.3/jedis-2.7.3.jar |
|
tomcat-redis-session-manager1.2.jar |
http://download.csdn.net/download/qinxcb/8279761 |
|
Redis |
https://github.com/ServiceStack/redis-windows/blob/master/downloads/redis64-2.8.9.zip |
Redis database windows version |
Redisdatabase startup and password configuration
Reference address: http://jingyan.baidu.com/article/f25ef2546119fd482c1b8214.html
Put an address on Redis and load server and Nginx server
RedisStart
Decompression:
Cmd command
Use The cd command goes to the directory where redis-server.exe is located. Run the redis-server.exe redis.windows.conf command to start the database. Set the password. Open:
redis.windows. conffile Ctrl+F
Look forrequirepass
Cancel the previous #number and set your own password
TomcatConfigurationSession
Share1: check the place The
jarpackage needs to be copied to the tomcat server
lib directory 2: configuration conf directory context.xml
Host:
points to the ip address where the load server is locatedsuch as
redisThe database has a password set: To set up a consistent
Nginxload balancing multiple Tomcatopen
nginx.conffind the upstream
nodedirectly copy multiple Tomcat
service ports to configure the same weight. Yes;Startup sequence of various services
RedisDatabase====
》TomcatServer
====》NginxServer The above introduces Nginx + Tomcat + Redis load balancing and session sharing, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.