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
Apache Load Balancer Session sticker configuration (JK mode)
In the work, because other products and Apache reverse proxy mode of work is not very good, so need to put Apache and Application Server (TOMCAT) co-configuration of a long MOD_JK mode of the session paste pattern, in the configuration process, or encountered
Server Load balancer principles and practices part 3 basic concepts of Server Load balancer-network Basics
SeriesArticle:
Server Load balancer: requirements of Server Load
Server Load balancer II-Basic knowledge of Server Load balancer
In the previous article, we have been talking about the knowledge around Server Load balancer. Don't worry about it, and you can't eat hot tofu. A little bit every
each node, but for the application server, due to the existence of session, A better way is to distribute requests from the same session to the same node for processing. This is called sticky session load balancing, the former is called non-
can implement some shunting policies for http applications, such as targeting domain names and directory structures;2. Nginx has little dependence on the network. Theoretically, it can be pinged to implement the load function;3. Nginx installation and configuration are relatively simple and easy to test;4. It can also handle high load pressure and stability. Generally, it can support more than 10 thousand
is used, the Session should not be stored in the process. You must use StateServer or SqlServer for storage. If you stick to the storage in the process, you can choose to use the Client affinity (Client affinity), that is, all requests of the customer have the same server for response and will not be forwarded to other servers, this sacrifices reliability. When the server fails, the request cannot be forwarded to other servers for service. The result
Recently want to be able to configure load balancing, in the virtual machine above, but the Internet to find a lot of information is fragmented, for people who do not know, a lot of not enough detail, recently finally done, the specific steps to write down, convenient for you to read the studyThis experiment requires the installation of Nginx if not installed, please refer to:Linux installation nginx:http://www.cnblogs.com/aspirant/p/6714548.html(1) O
Five Policies for configuring Server Load balancer using nginx in the production environment: nginx Server Load balancer
Nginx upstream currently supports five allocation methods1. Round Robin (default)
Each request is distributed to different backend servers one by one in chronological order. If the backend servers ar
Common Parameters and basic usage of ipvsadm In the Server Load balancer cluster, and ipvsadm In the Server Load balancer Cluster
----
Fixed Scheduling Rr: Argument
Wrr: weighted argumentWeight, weighted
Sh: source hash, source address hash
Dynamic SchedulingLc: Minimum LinkActive * 256 + inactiveWlc: weighted least Li
--add TomcatService Tomcat start Services
Build a test SiteCd/usr/local/tomcat/webappMKDIR-PV Testapp/{web-inf,classes,meta-inf,lib}
Set up homepageVim testapp/index.jsp
Test Curl http://localhost:8080/testapp/index.jsp
3. ha222 Host configuration is the same as ha1114. Nginx Load Balancer Scheduler rs1 Configuration
Install packageDownload the latest stable version of nginx-1.8.0Http
Our product has two module, deployed on separate Linux machine, module 1 need to launch HTTP request to Module 2 to obtain service. Since Module 2 has multiple units, we will deploy a load balancer (elb,elastic load Balancer) before Module 2. We're deployed in AWS, so we're using AWS ELB. AWS Elb also provides anoth
When you use load balancing, you will experience session retention problems, which are commonly used in the following ways:1.IP Hash, assigning requests to different servers based on the IP of the client2.cookie, the server sends a cookie to the client, and a request with a specific cookie is assigned to its publisherNote: Cookies require browser support and sometimes reveal data
1.
The cookie differs from the session, one on the client and one on the server.Environment Nginx 1.8.0Centos6. Xsticky:1.2.5 wget https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/master.tar.gzCookie load balancing is more obvious than iphash compared to one of the features: the Equalization of the intranet NAT user. And Iphash can't do it.Yum Install
Original English version, Chinese versionTony TangTranslation Arrangement
In the first part, I briefly described the various factors that need to be taken into account during the design of a large J2EE system with upgrading and high reliability.
This article discusses Tomcat's support for cluster, Server Load balancer, fault tolerance, session replication, and ot
. worker2.lbfactor= 3.5worker.worker2.cachesize= 10worker. worker2.cache _ timeout= 600worker. worker2.socket _ keepalive
= 1 worker 'worker2' want ajp13 connection to be dropped after
5mn (timeout) worker. worker2.socket _ timeout = 300
Clarification: in the previous example, the worker request control system sends a KEEP-ALIVE signal over the connection.
Note: in ajpv13, the default port is 8009.
4. set lb Worker attributes:
A server load
CentOS by default)
Program code working on the netfilterINPUT hook on the kernel; its cluster function depends on the Cluster Server rules defined by ipvsadm;
Supports a wide range of services based on TCP, UDP, SCTP, AH, EST, AH_EST, and other protocols;
4. Key points for timing in a server Load balancer cluster:
(1) session persistence
parameters:sticky [Name=route] [Domain=.foo.bar] [path=/] [expires=1h] [HASH=INDEX|MD5|SHA1] [ no_fallback];Name: can be any string character, default is routedomain: which domain name can be used under this cookiepath: which path to enable sticky, for example path/test, Then only test this directory will use sticky do load balancing Expires:cookie expiration ti
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.