in the nginx-1.12.0 directory#cd nginx-1.12.0/#./configure --prefix=/usr/local/nginx \ //安装目录--user=nginx \ //用户--group=nginx //用户组5. Compiling and installing#make make install6. Add a home page file#cd /usr/local/nginx/html#echo “this is benet web”>test.html7. Establish a soft connection for easy management#ln –s /usr/local/nginx/sbin/nginx /usr/local/sbin8. Start Nginx#nginx9. Turn off the firewall and enhance security features#systemctl stop firewa
In the Internet era, the backend system architecture, often can hear the high-availability cluster, load-balanced cluster and other system architecture solutions, including load balancing hardware-based F5, big-IP, and software-based LVS (based on the Linux operating system implementation, performance and hardware-based performance comparable), Nginx, HAProxy (based on third-party application implementation) and so on, this article describes the insta
installation is complete, check that all files are generated.
[root@haproxy ~]# rpm -ql haproxy/etc/haproxy/etc/haproxy/haproxy.cfg/etc/logrotate.d/haproxy/etc/rc.d/init.d/haproxy/usr/bin/halog/usr/sbin/
/-Default listening port: 80-Default Web directory:/usr/local/nginx/html
Next, set up the test page and start the Nginx serviceecho "
For convenience, the website is accessed directly using an IP address. The client accesses the http://192.168.100.201/test.html for testing.
The process of building Nginx server 2 and the installation steps of Nginx server 1 are the same, the different place is to build the test page.echo "
Deploying HAProxy
in the nginx-1.12.0 directory#cd nginx-1.12.0/#./configure --prefix=/usr/local/nginx \ //安装目录--user=nginx \ //用户--group=nginx //用户组5. Compiling and installing#make make install6. Add a home page file#cd /usr/local/nginx/html#echo “this is benet web”>test.html7. Establish a soft connection for easy management#ln –s /usr/local/nginx/sbin/nginx /usr/local/sbin8. Start Nginx#nginx9. Turn off the firewall and enhance security features#systemctl stop firewa
systems, these programs are generally less scalable. This is why they must be optimized to make every CPU time slice (Cycle) do more work. ---- Baidu encyclopedia
Installation:[Root @ sherry ~] # Yum install haproxy-y
Configuration File description:[Root @ sherry ~] # Vim/etc/haproxy. cfgGlobalLog 127.0.0.1 local2 # Chroot/var/lib/
haproxy. cfg
Enter the user name and password, and monitor the status on the following page.
Http://x.x.x.x: 1080/haproxy-Stats
Add the haproxy startup command to the/etc/rc. Local file, as shown in figure
/Opt/haproxy/sbin/haproxy-F
Main Standby modeProgramme IThat is also where the VIP is, Haproxy is where to start the main standby mode.[Email protected] ~]# Cat/etc/ha.d/haresources#gao services#10.0.0.103 Www.lvnian.orgMASTER ipaddr::10.0.0.103/24/ Eth0 Haproxyd [[email protected] ~]#Note the point:# #haproxy If you manage heartbeat, then the Haproxy script above must be/etc/init.d/directo
access to different pages, so that we are able to visually observe the effect of load balancing. Because Apache installation configuration is not the focus of this article, specifically can refer to my previous blog "RedHat 7 installation configuration Apache 2.4" (http://jiangjianlong.blog.51cto.com/3735273/1858650)650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/8C/22/wKioL1hjY7GQIT2oAAB9sPo9Z-
**************************************** *************(2) install the kernel versionBefore installation, check the kernel version. Here is 2.6.18.Make TARGET = linux26 PREFIX =/usr/local/hapropxyMake install PREFIX =/usr/local/haproxy(3) set the configuration fileCd/usr/local/haproxyVi haproxy. cfg**************************************** *************###########
high availability, you can configure the previous keepalived, the configuration method is basically the same, you need to add a haproxy to do the backup, Note that there is a need to turn on the keepalived multicast address on the firewall: 224.0.0.18 port experimental topology:650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/8C/25/wKiom1hjWMDjyjgrAABFsadWUew333.png-wh_500x0-wm_3 -wmp_4-s_357656
, the solution is to prompt 21 line keyword Redispatch before adding the keyword to option Redispatch, and then start again after modification.650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/73/B1/wKioL1YEp7LxpIhgAAAtufCNt5M883.jpg "title=" Qq20150925094908.png "alt=" Wkiol1yep7lxpihgaaatufcnt5m883.jpg "/>There was an error when starting the service again, unable to load/usr/share/haproxy when starting the
load balancer device uses TCP buffering to establish extremely long requests and has a large response time.Haproxy Advantages1, Haproxy can be used as MySQL, mail or other non-web load balancer, we often use it as MySQL (read) load balancing;2, with a powerful monitoring server status of the page;3, Haproxy support virtual host;4, HAProxy can run full 10gbps-new
Haproxy achieves load balancing and dynamic/static Separation
After haprxy Server Load balancer and dynamic/static separation, haproxy is more professional in these two aspects than nginx, including session persistence, cookie guidance, and url monitoring backend, mysql Server Load balancer is not available in nginx, but it cannot be said that haprox can replace nginx, and nginx cache is not available in pr
HAProxy high concurrency Problem Solving
Directory
1. Problem Description2. Problem Analysis3 HAProxy Positioning3.1 connect (...)3.2 tcpv4_connect_server3.3 call of tcpv4_connect_server3.4 call of connect_server3.4 modify source code to add custom logs3.5 srv_dynamic_maxconn4 solutions5. Email Exchange with the author of HAProxy5.1 email description5.2 reply from the recipient5.3 resend the verification an
TCP counter listenoverflows a large increase
View Method
Cat/proc/net/netstat | awk '/tcpext/{print $21,$22} '
reason
The queue length of the system call listen function (int listen (int sockfd, int backlog) is determined by min (backlog, kernel parameter net.core.somaxconn), corresponding to the listen of the socket When the queue is full, the listenoverflows counter adds 1 when a new connection is added.
Solution
Adjust system Parameters Net.core.somaxconn = 65535 #默认为128
Cat 65535 >/proc/sys
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.