, 5xxLoad balancing Common scheduling algorithmRR (Round Robin): Polling ScheduleLC (Least Connections): Minimum number of connectionsSH (source Hashing): Source-based access schedulingCase study: Case environmentComprehensive experiment: Build hproxy Cluster * *1. Experimental topology2, the virtual machine's experimental environmentA haproxy server, two Nginx servers, build two different websites (easy to test the cluster), a client online testing.3
HAProxy Usage Details
HAProxy details
HAProxy is a free, fast, and reliable solution for providing high availability, load balancing, and proxy services for TCP and HTTP-based applications, it is especially suitable for websites with high load and require persistent connections or layer-7 processing mechanisms. HAProxy
Build a Web cluster using Haproxy
Haproxy provides high availability, load balancing, and proxies based on TCP and HTTP applications, supporting virtual hosting, which is a free, fast, and reliable solution. The haproxy runs on the current hardware and can support tens of thousands of concurrent connections. and its operating mode makes it easy and safe
operating system when using Haproxy
2. Installation
Go to haproxy website Download address http://www.haproxy.org/
Official website Current stable version 1.7.8 version download address
Http://www.haproxy.org/download/1.7/src/haproxy-1.7.8.tar.gz
Tar zxvf haproxy-1.7.8.tar.gz
cd
supports Virtual Hosts, but it is easy to configure and has a very good server health check function. When the back-end server of the proxy fails, haproxy will automatically remove the server, and then automatically add the server after the fault is recovered. The new 1.3 introduces frontend, backend, and frontend to match rules based on any HTTP request header content, and then directs the request to the relevant backend.
Ii. Load Balancing using ha
performance is similar to Haproxy;Apache------> Poor functionalityThe Haproxy configuration file is divided into four sections:Global configuration:Global: Configuration SegmentAgent configuration:Default: Defaults configuration-----> All the same content in backend, fronte
I. Introduction to the EnvironmentTo be notified that the Web site from HTTP to use HTTPS, currently my site front-end architecture as shown:650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/7F/72/wKioL1cfFiviTO_AAAEJI0txodI055.jpg "title=" Qq20160426150836.jpg "alt=" Wkiol1cffivito_aaaeji0txodi055.jpg "/>Suppose we have two physical machines, each of which has a lot of tomcat containers on it, the front end uses the HTTP layer load balancer of hapr
haproxy+keepalived high availability for load balancingFirst, the environment5 virtual machines, respectively:1 sets of test machines (192.168.2.83);2 sets of haproxy/keepalived (192.168.2.230/192.168.2.231);2 Web Servers (192.168.2.232/192.168.2.233);Note: The VIP setting is 192.168.2.228;Second, install the configuration Web ServerBecause the installation and
not go out from itself, this ensures that the performance of the Equalizer IO will not receive large traffic impact.5, the application of a wide range, because LVS work in the 4 layer, so it can almost all applications to do load balancing, including HTTP, database, online chat room and so on.The disadvantages of LVS are:1, the software itself does not support regular expression processing, can not do static and dynamic separation , and now many sites in this area have a strong demand, this is
Tags: Linuxkeepalived + haproxy + MySQL build high availability1, the high availability of keepalived is the main preparation, there is a standby2, keepalived + haproxy built high-availability is can be scheduled for two high-availabilityTopology diagram:Keepalived: Responsible for preemption of virtual IP, using VRRP protocolHaproxy: Responsible for the access scheduling, reduce the single point of pressur
; index.html -------------> the is web2
Background monitoring management:
When the web1 server is disconnected:
When the web1 server is restored:
################################# Some tests have been completed ### ###################
Vi. Log Configuration:
######### Add the following statement #########
Vi/etc/syslog. confLocal3. */var/log/haproxy. logLocal0. */var/log/
1. Hide back-end server versionsIn our daily work we use haproxy as a load balancer, because the backend application server is more cumbersome to change, so it is decided to implement it in the load balancer.Only need to frondend or listen or backend, addRspidel ^server:.* rspidel ^x-forwarded-for:.* rspidel ^x-powered-by:.* rspidel ^via:.* rspide L ^x-aspnet-version:*The above use can refer to Rspidel.In addition, if you need to confuse some people t
install Haproxy under Redhat
First view the system kernel version number and system name
Uname-a
Linux rh64pfcrm01kf 2.6.32-358.el6.x86_64 #1 SMP Tue, 11:47:41 EST 2013 x86_64 x86_64 x86_64 gnu/linux
Haproxy Installation
Haproxy official website Download source code installation package http://www.haproxy.org/download/1.7/src/
allow the MySQL account to be accessed by multiple machines. Therefore, execute the following command in "allow:
Grant All Privileges On*.*To 'Delimiterity'@'%'IdentifiedBy 'Delimiterity' With Grant Option; Flush rivileges;
2.3 modify the authserver and world server configurations of wow
Configuration in authserver. conf
Logindatabaseinfo ="Wagner. 0.0.1; 3306; Trinity; Logon"
To:
Logindatabaseinfo ="172.167.1.239; 3306; Trinity; L
phenomena
Haproxy bind 4 Core CPU, 8 core CPU, 16 core CPU, when the pressure is measured, will appear CPU 100% is used situation.
Tracing Process
1. Through the Mpstat-p all 1 command to see where the CPU is used, you can see most of the CPU used in the SYS state.
2. View the Haproxy process through Strace-p pid-c the system call takes up the most CPU and sees the CPU used on the Connect system call.
3
Environment Preparation:
Host Name
Role
IP Address
my linux1.contoso.com
haproxy server eth0:192.168.100.121 eth1 : 172.16.100.121
Mylinux3.contoso.com
Web server 1
eth0:192.168.100.181
Mylinux4.contoso.com
Web server 2
eth0:192.168.100.182
First, the preparatory workInstall the HTTP service on MYLINUX3 and mylinux4 and start.Yum-y Install h
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.