Nginx + Tomcat + Redis load balancing and session sharing
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.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











You can query the Docker container name by following the steps: List all containers (docker ps). Filter the container list (using the grep command). Gets the container name (located in the "NAMES" column).

Docker container startup steps: Pull the container image: Run "docker pull [mirror name]". Create a container: Use "docker create [options] [mirror name] [commands and parameters]". Start the container: Execute "docker start [Container name or ID]". Check container status: Verify that the container is running with "docker ps".

Create a container in Docker: 1. Pull the image: docker pull [mirror name] 2. Create a container: docker run [Options] [mirror name] [Command] 3. Start the container: docker start [Container name]

Enable Redis slow query logs on CentOS system to improve performance diagnostic efficiency. The following steps will guide you through the configuration: Step 1: Locate and edit the Redis configuration file First, find the Redis configuration file, usually located in /etc/redis/redis.conf. Open the configuration file with the following command: sudovi/etc/redis/redis.conf Step 2: Adjust the slow query log parameters in the configuration file, find and modify the following parameters: #slow query threshold (ms)slowlog-log-slower-than10000#Maximum number of entries for slow query log slowlog-max-len

How does the Redis caching solution realize the requirements of product ranking list? During the development process, we often need to deal with the requirements of rankings, such as displaying a...

Installing Docker images offline requires the following steps: 1. Obtain the mirror TAR file; 2. Export the mirror file; 3. Transfer the mirror file; 4. Import the mirror file; 5. Verify the mirror installation.

NGINX and Apache have their own advantages and disadvantages and are suitable for different scenarios. 1.NGINX is suitable for high concurrency and low resource consumption scenarios. 2. Apache is suitable for scenarios where complex configurations and rich modules are required. By comparing their core features, performance differences, and best practices, you can help you choose the server software that best suits your needs.
