compression output # gzip on; # configure Server Load balancer. nginx is used as a reverse proxy, access nginx is the server configured for server Load balancer. You can view the server Load balancer address through log # The err
efficient than nginx with better load-balancing speed.6. Haproxy can load-balance MySQL and Detect and load-balance the DB node in the backend.7. Support Load Balancing algorithm: Round-robin (round robin), Weight-round-robin (with weighted rotation), source (original address hold), RI (request URL), Rdp-cookie (based
implementation and configuration and maintenance process is more complex, relatively speaking, nginx/haproxy+ Keepalived is a lot easier.
HAProxyfeatures of Haproxy:
Haproxy is also supported for virtual hosts.
The advantages of haproxy can be supplemented with some of Nginx's shortcomings, such as supporting session retention, cookie guidance, and the ability to detect the status of the backend server by obtaining the specified URL.
Haproxy similar to LVS, itself is just
-RCV-hop-for-Resp
!
SLB virtual-server DNS-dianxin 192.168.10.16
Extended-Stats
Port 53 UDP
Gslb-enable
Use-RCV-hop-for-Resp
!
SLB virtual-server dns_liw.g 192.168.10.18
Extended-Stats
Port 53 UDP
Gslb-enable
Use-RCV-hop-for-Resp
In a multi-link environment, enable the source/output function in port53 UDP.
Use-RCV-hop-for-resplserver mode vs. proxymode
Load servi
One, LVS three kinds of packet forwarding methodLVS provides three packet forwarding methods: NAT (Network address mapping), IP tunneling (IP tunneling), direct Routing (straight route)Different forwarding mode determines the network structure of different cluster, and the following three kinds of forwarding methods ar
192.168.5.151:80;}server{Listen 80;server_name B.Com;Location/{Proxy_pass http://b.com;Proxy_set_header Host $host;Proxy_set_header X-real-ip $remote _addr;Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;}}Save Restart NginxSet Nginx on 192.168.5.150 and 192.168.5.151 machine, open nginx.conf Add the following code at the end:server{Listen 80;server_name B.Com;Index index.html;root/data0/htdocs/www;}Save Restart NginxAfter completing the next steps, you can implement the B.Com
Project Practice 4-haproxy Server Load balancer and ACL control, haproxyacl
Haproxy implements advanced Load Balancing
Environment: With the development of the company's business, the company's server Load balancer service has achieved layer-4 Server
Load BalancingMainstream open source software: LVS, keepalived, Haproxy, Nginx and so on;OSI Layer: LVS (4), Nginx (7), Haproxy (4, 7);The Keepalived load balancing function is actually the LVSLVS Load balancer can distribute other ports than 80, such as MySQL, while Nginx only supports HTTP, https, mail;LVS Introducti
!!!
Sethandler balancer-Manager
Order deny, allow
Deny from all
Allow from localhost
Note: node-a.myserver.com, node-b.myserver.com is the domain name of the other two servers, not the domain name of the current serverFrom the above proxyrequests off, we can see that the Server Load balancer is actually a reverse proxy, but its proxy
take a server purely as a forwarding function, but also participate in the provision of services.If the above case three servers:A server ip:192.168.5.149 (master)b Server ip:192.168.5.27C Server ip:192.168.5.126We resolve the domain name to a server, and then forwarded by a server to B server and C server, then a server only do a forwarding function, now we let a server also provide site services.Let's st
:80; } server{ listen 80; server_name b.com; location/{ proxy_pass http:/ /b.com; proxy_set_header host $host; proxy_set_header x-real-ip $remote _addr; proxy_set_header x-forwarded-for $proxy _add_x_ forwarded_for; } } Save restart Nginx Set Nginx on 192.168.5.150 and 192.168.5.151 machine, open nginx.conf Add the following code at the end:server{Listen 80;server_name B.Com;Index index.html;root/data0/htdocs/www;}Save Restart NginxAfter completing the next steps, you can
In redhat9.0, lvs sets up the Server Load balancer server-Linux Enterprise Application-Linux server application information. The following is a detailed description. Install the required components:
Standard internal package linux-2.4.20-tar.gz, with the software matching the internal package s-1.0.09.tar.gz
Linux Kernel requires patching, hidden-2.4.20per10-1.diff, noarp-2.4.20-1.diff, iproute-050816-noarp
there is a machine down, it is only one of the db n one of the data can not access it, which we can accept, at least more than before the segmentation of the situation is much better, not the entire DB can not access. In general applications, such machine failure caused by the data is not accessible is acceptable, assuming our system is a high-concurrency e-commerce site? The economic losses caused by single-node machine outages are very serious. In other words, there is still a problem with ou
_add_x_forwarded_for;}}Save Restart NginxSet Nginx on 192.168.5.150 and 192.168.5.151 machine, open nginx.conf Add the following code at the end:server{Listen 80;server_name B.Com;Index index.html;root/data0/htdocs/www;}Save Restart NginxAfter completing the next steps, you can implement the B.Com load balancer configuration.Does the primary server not provide services?In the above example, we are all appl
192.168.5.151:80;}server{Listen 80;server_name B.Com;Location/{Proxy_pass http://b.com;Proxy_set_header Host $host;Proxy_set_header X-real-ip $remote _addr;Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;}}Save Restart NginxSet Nginx on 192.168.5.150 and 192.168.5.151 machine, open nginx.conf Add the following code at the end:server{Listen 80;server_name B.Com;Index index.html;root/data0/htdocs/www;}Save Restart NginxAfter completing the next steps, you can implement the B.Com
192.168.5.151:80; } server{ listen 80; server_name b.com; location/{ proxy_pass http:/ /b.com; proxy_set_header host $host; proxy_set_header x-real-ip $remote _addr; proxy_set_header x-forwarded-for $proxy _add_x_ forwarded_for; } } Save restart Nginx Set Nginx on 192.168.5.150 and 192.168.5.151 machine, open nginx.conf Add the following code at the end:server{Listen 80;server_name B.Com;Index index.html;root/data0/htdocs/www;}Save Restart NginxAfter completing the next s
1 IntroductionThe world has entered the information age. With the rapid development of society and the increasing demand for network applications, the demand for network speed and bandwidth is constantly increasing. Under such circumstances, many new technologies of High-speed exchange are emerging. Layer-2 exchange enables fast information exchange between hosts in the LAN. layer-3 Exchange is a perfect combination of exchange technology and routing technology, the layer-4 switching technology
is not a test. Of course, there is always a solution to the problem. We introduce the concept of clustering , which I call group, that is, each node of the library we introduce multiple machines, each machine holds the same data, in general, many of these machines load, when there is a downtime situation, The load balancer allocates the
group, which is the node of each library we introduce multiple machines, each of which holds the same data, and in general the load is distributed by multiple machines, and the load balancer distributes the load to the machine that is down when there is an outage. This solves the problem of fault tolerance.As shown, t
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.