Home > Backend Development > PHP Tutorial > Nginx + Tomcat + Redis load balancing and session sharing

Nginx + Tomcat + Redis load balancing and session sharing

WBOY
Release: 2016-07-29 09:06:35
Original
990 people have browsed it

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. conf

file Ctrl+F

Look for

requirepass

Cancel the previous #number and set your own password

TomcatConfigurationSession

Share

1: check the place The

jar

package needs to be copied to the tomcat server

lib

directory 2: configuration conf directory context.xml

host="127.0.0.1" port="6379" Password "root" database="0" maxInactiveInterval="60" //>

Host:

points to the

ip

address where the load server is located

such as

redis

The database has a password set: To set up a consistent

Nginxload balancing multiple Tomcatopen

nginx.conf

find the upstream

node

directly 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.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template