Overview
This document is used to describe Nginx+tomcat+redis load Balancer implementation session sharing
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 |
Startup and password configuration for Redis databases
Reference Address: http://jingyan.baidu.com/article/f25ef2546119fd482c1b8214.html
Redis and load server put an address and Nginx server
Redis Boot
Extract:
CMD command
Use the CD command to go to the directory where the Redis-server.exe is located
Run the Redis-server.exe redis.windows.conf command to start the redis Database
Redis Setup Password
Opening:redis.windows.conf file
Ctrl+f looking for requirepass
Cancel the previous # sign and set your own password
Tomcat configuration Session sharing
1: Copy the required jar package to the Tomcat server lib directory
2: Configure conf directory under context.xml
< p="">
Host= "127.0.0.1"
Port= "6379"
password= "Root"
database= "0"
Maxinactiveinterval= "/>"
Host: point to the IP address where the load server resides
If the redis Database has a password set: To be set to a consistent
Nginx Load Balancer multiple Tomcat
Open nginx.conf
Locate the upstream node
Directly copy multiple Tomcat Service ports to configure the same weights;
Boot order for various services
Redis database == = "Tomcat server = = =" Nginx Server
The above describes the Nginx + Tomcat + Redis load balancing and session sharing, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.