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

Nginx + Tomcat + Redis load balancing and session sharing

Jul 29, 2016 am 09:06 AM
nbsp nginx quot redis tomcat

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.

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Caching mechanism and application practice in PHP development Caching mechanism and application practice in PHP development May 09, 2024 pm 01:30 PM

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: Why is my .txt file not accessible through domain name? WordPress site file access is restricted: Why is my .txt file not accessible through domain name? Apr 01, 2025 pm 03:00 PM

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: �...

Why does an error occur when installing an extension using PECL in a Docker environment? How to solve it? Why does an error occur when installing an extension using PECL in a Docker environment? How to solve it? Apr 01, 2025 pm 03:06 PM

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

Compilation and installation of Redis on Apple M1 chip Mac failed. How to troubleshoot PHP7.3 compilation errors? Compilation and installation of Redis on Apple M1 chip Mac failed. How to troubleshoot PHP7.3 compilation errors? Mar 31, 2025 pm 11:39 PM

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

How to trigger the background asynchronous batch sending of SMS messages in the foreground without affecting the user experience? How to trigger the background asynchronous batch sending of SMS messages in the foreground without affecting the user experience? Mar 31, 2025 pm 11:45 PM

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

How to make PHP5.6 and PHP7 coexist through Nginx configuration on the same server? How to make PHP5.6 and PHP7 coexist through Nginx configuration on the same server? Apr 01, 2025 pm 03:15 PM

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

How to efficiently integrate Node.js or Python services under LAMP architecture? How to efficiently integrate Node.js or Python services under LAMP architecture? Apr 01, 2025 pm 02:48 PM

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

See all articles