Hproxy provides high availability, load balancing, and reverse proxies based on TCP and HTTP applications, especially for those web sites that are heavily loaded, which typically require session hold or seven-tier processing. Haproxy runs on the current hardware, fully supports tens of thousands of concurrent connections, and its operating mode makes it easy and secure to integrate into the architecture, while protecting your Web server from being exp
I. Preparation 1. prepare the server to establish the MySQLCLuster system with two nodes, and use six servers to establish Haproxy43; mysqlcluster (MySQL Cluster) system node configuration description the IP address and port of the node Haproxy server load balancer (1) centos I. preparations
1. prepare the server
Establish a MySQL CLuster system with two nodes and build a Haproxy + mysql cluster (MySQL CLu
This series of articles focuses on learning and researching OpenStack Swift, including environment building, principles, architecture, monitoring, and performance.(1) OpenStack + Three-node Swift cluster + HAProxy + UCARP installation and configuration(2) Swift Principles and architecture(3) Swift monitoring(4) Swift performanceTo implement the system:Characteristics:
Deploy all Swift services on each node using three peer physical nodes
Haproxy + mysqlcluster (MySQL cluster) Configuration
I. Preparation
1. Prepare the server
Establish a MySQL CLuster system with two nodes and build a Haproxy + mysql cluster (MySQL CLuster) system with six servers
Node configuration instructions
Node
Corresponding IP address and port
Haproxy Server Load balancer (1) centos 6.3
1.1.1
PS: nginx/LVS/haproxy is currently the most widely used three load balancing software. I have implemented these software in multiple projects. I have referenced some materials and combined some of my experience in using it, to sum up.
Generally, Server Load balancer uses different technologies at different stages as the website scale increases. Specific Application requirements have to be analyzed. For small and medium-sized web applications, such a
Haproxy: Server Load balancer scheduler that works on the ISO 7 layer to provide Web Services Based on HTTP protocol (or work on the ISO 4 layer based on TCP protocol)
Configuration file/etc/haproxy. cfg
Configuration File
Global settings: Set the attributes of the haproxy process ---------- global settings Section
Proxies: proxy settings ----------------
Preface: We KnowTomcat+nginxLoad Balancing cluster,LVsLoad Balancing clusterAndHaproxyto build a cluster, these three clusters are comparedLVsthe performance is the best, but the building is complexNginxof theUpstreamThe module supports clustering, but there is not much fault checking on the nodes of the cluster, and no performanceHaproxyWell, so it should be saidHarpoxyis also very good. So then we started using haproxy to build the cluster. One, top
Project needs to build RABBITMQ high-availability cluster, recently in the learning and building process, recorded here can communicate with everyone (here is just a record of their own building process after learning, many of the principles of things not in detail).
Build the Environment
CentOS7 64-bit
RabbitMQ 3.6.2
Keepalived 1.2.21
Host: 192.168.0.1 192.168.0.2 192.168.0.3 install RABBITMQ service on three nodes
Implementation requirements:Using Haproxy To do load balancing, manually add or remove node server information in the configuration file, it is more troublesome. Collect the information that needs to be registered to Consul as the Haproxy node server through Registrator, and then register to Consul Key/value . Consul-template go to Consul key/value to read the information and then automatically modify the
################### #全局配置信息 ############################## #参数是进程级的, usually associated with the operating system (OS) #########GlobalMaxconn 20480 #默认最大连接数Log 127.0.0.1 local3 #[err warning Info Debug]Chroot/var/haproxy #chroot运行的路径UID #所属运行的用户uidGID #所属运行的用户组Daemon #以后台形式运行haproxyNbproc 1 #进程数量 (multiple processes can be set to improve performance)Pidfile/var/run/haproxy.pid #haproxy的pid存放路径, the user who
Web schemaDescribe the purpose of each server:1, Haproxy to achieve the back-end Web server load Balancing2, keepalived to achieve the high availability of haproxy3, Apache static page access to implement4. Dynamic page access for Aoache dynamicsWhat is keepalived?Keepalived is a routing software written in C. The main goal of this project are to provide simple and robust facilities (capability) for loadbalancing and high-availability to Li Nux system
Shell practice: use shell to automatically receive and load the haproxy configuration file, so that the configuration takes effect. haproxy automatically receives the configuration and loads 002. Introduction to the background receiving configuration process: 0031. It is a while 1 background process 0042. Currently, it is a 30 s check. Is there any new configuration? If yes, continue. If not, rest for 30 s.
Specific application needs to be specific analysis, if it is small and medium-sized Web applications, such as the daily PV less than 10 million, with Nginx can be completely; if there are many machines, you can use DNS polling, LVS consumes more machines or more, large web sites or important services, and the server is relatively long, You can consider using LVS. One is through the hardware to carry out, the common hardware has more expensive F5 and array and other commercial load balancer, its
In order to compare the effects of hproxy and nginx load Balancing, respectively on the test machine (the following experiments are tested on a single machine, that is, the load machine and the back end of the machine are on a computer) do the two load balancing environment, and their respective capture packet analysis.The following are the results of the packet capture analysis under these two load balancing environments:1) haproxy experimental recor
Document directory
About SSL certificates
Others
Install haproxy by the way:
Some practical problems and solutions
Recently, Stunnel is used as a transparent proxy, and haproxy is used as an SSL solution. Stunnel is added between the user and the original reverse proxy, so that the user and Stunnel can use SSL, the real Web after Stunnel does not need to bear the HTTPS overhead.
Record the configu
Comparison of haproxy lvs nginx Load Balancing
For the software that implements load balancing, let's take a look at it in detail. In terms of performance and stability, LVS is the best, basically reaching 60% of the performance of F5 hardware equipment, and other 10% are a little difficult.
However, the configuration is also the most troublesome because of LVS, and the Health Check requires configuring Ldirector. Other
Haproxy is a highly available, load-balanced, and TCP-and HTTP-based agent software, Haproxy is completely free, with Haproxy can quickly and reliably provide a proxy solution based on TCP and HTTP applications. Haproxy applies to those Web sites that are heavily loaded, which typically require session maintenance or s
participate in the loadThe larger the weight defaults to 1.weight, the greater the weight of the load.Max_fails: The number of allowed requests failed defaults to 1. Returns the error Proxy_next_upstream module definition when the maximum number of times is exceededFail_timeout:max_fails after a failure, the time of the pause.Backup: All other non-backup machines request backup machines when down or busy. So this machine will be the lightest pressure.
Third,
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.