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

AI Hentai Generator
Generate AI Hentai for free.

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



In PHP development, the caching mechanism improves performance by temporarily storing frequently accessed data in memory or disk, thereby reducing the number of database accesses. Cache types mainly include memory, file and database cache. Caching can be implemented in PHP using built-in functions or third-party libraries, such as cache_get() and Memcache. Common practical applications include caching database query results to optimize query performance and caching page output to speed up rendering. The caching mechanism effectively improves website response speed, enhances user experience and reduces server load.

Wordpress site file access is restricted: troubleshooting the reason why .txt file cannot be accessed recently. Some users encountered a problem when configuring the mini program business domain name: �...

Causes and solutions for errors when using PECL to install extensions in Docker environment When using Docker environment, we often encounter some headaches...

Problems and solutions encountered when compiling and installing Redis on Apple M1 chip Mac, many users may...

How to implement the function of triggering the background asynchronous batch sending of SMS messages in the foreground? In some application scenarios, users need to trigger batch short in the background through foreground operations...

Running multiple PHP versions simultaneously in the same system is a common requirement, especially when different projects depend on different versions of PHP. How to be on the same...

Many website developers face the problem of integrating Node.js or Python services under the LAMP architecture: the existing LAMP (Linux Apache MySQL PHP) architecture website needs...

redis...
