Deploy a robust high-availability layer-7 Load Balancing solution based on keepalived + nginx 20151214
High Availability is a common topic. Open-source high availability software has been developed quite well. Previously, it has done lvs + heartbeat 4-layer LB In debian, it has been very stable (unfortunately, the traffic is not large). Now, due to business needs, we have implemented a keepalived + nginx-ba
LVS is an open source project initiated by Dr. Zhangwensong of the National Defense University to achieve load balancing between servers. Full name for Linux virtual serverSoftware surrounds ipvsadm.tar.gz as the size of the enterprise expands. Server access is getting bigger. Only two solutions are available to solve the server's load capacity.1: Extend the hard
connections for a single process reaches the total of 7/8 , no new Accpet events are received.4. If the process to get the lock can quickly finish Accpet, and not get the lock has been waiting (waiting for delay:ngx_accept_mutex_delay), easy to cause the process busy busy, empty very emptySpecific implementation of the Ngx_process_events_and_timers process event dispatcherThis method is the core function of the process implementation. Main functions: Event distribution, surprise group processin
Tomcat Attribute Profilecontext.xml Context configuration filelogging.properties log logs related configuration fileServer.xml Master configuration fileTomcat-users.xml:manager-gui Manage user Profiles (Tomcat installation provides a Manager-gui management interface that allows access to be enabled via the file configuration)Web. XML : Tomcat's servlet.servlet-mapping filter MIME and other related configurations. Second, build nginx+tomcat load
nbproc, so that the task_queue of each process will be much shorter, and the performance will naturally improve a lot# Pidfile/var/run/haproxy-private.pid
defaults log global mode http optionhttplog optiondontlognull log 127.0.0.1 local3 retries 3 option redispatch maxconn 2000 contimeout 5000 clitimeout 50000 srvtimeout 50000
Listen webfarm 0.0.0.0: 80Mode HTTPStats uri/haproxy-Stats # monitor the haproxy statusStats realm haproxy/Sta
modulesThese two modules are primarily used for global load balancing and can access different servers depending on the client IP, as follows:http{geo $geo {default default;202.103.10.1/24a; 179.9.0.3/24B;}upstream default.server{server192.168.0.100; }upstreamA.server{ server192.168.0.101;}upstreamb.server{ server192.168.0.102;} server{listen80; location/{ proxy
Front-facing conditionsUse the Publish subscription feature of SQL Server for read-write separation and create multiple read libraries.Load balancing in this article is for multiple read libraries.Test environmentVMware 10 64-bitWindows Server R2SQL Server 2008CentOS 6.6Haproxy 1.5Virtual machine configuration(1) Virtual machine 1: Install CentOS and install Haproxy. IP is: 172.16.1.1. As a load balancer.(2
the content of the test page index JSP, change the followingvim/web/webapp1/index.jsp2.3. Set up users and groups, unzip and install Nginx4. Parameter meaning:
-user=,--group= specifying which users and groups to run
-with-file-aio Enable file modification support
-with-http_stub_status_module Enable status statistics
-with-http_gzip_static_module enabling gzip static compression
-with-http_flv_module Enable FLV module, providing time-based offset files seeking memory u
Build an LVS load balancing test environment
There are many ways to achieve Server Load balancer: local tyrants directly F5, the best performance, the most expensive
If you have no money, you can use Apache. Nginx works on the fourth layer of the network. Although its performance is normal, it is flexible. For example,
Environment: Virtual machine: VMware Workstation operating system: CentOS 5.5
First, KEEPALIVED+LVS-DR mode configuration high available load balancing
The topology is as follows:
Second, server IP configuration information
1. IP_LB Host (Master):
2.ip_lb_2 Host (Backup)
3.WEB1 Host
4.WEB2 Host
See if Ipvsadm software is available separately in master and backup
1. Check whether the Ipvsadm is insta
Before we took two articles, we explained in detail the nginx principle, installation and feature components. See Load Balancing Layer Design (2)--nginx installation (http://blog.csdn.net/yinwenjie/article/details/46620711) and architecture design: Load Balancing layer Design (3)-- Nginx Advanced "(http://blog.csdn.net
health check on every mysqlcluster Server
1. Configure haproxy. cfg on both hosts
Root@10.1.6.203: scripts # cat/etc/haproxy. cfg global maxconn 51200 # default maximum number of connections # uid 99 # gid 99 daemon # Run haproxy # quiet nbproc 1 # Number of processes in the future (you can set multiple processes to improve performance) pidfile/etc/haproxy. pid # The path where the haproxy pid is stored. the user who starts the process must have the
But if the site has an average of more than 200 requests per second, then the problem is: This is already the best Web server, what should I do? The same scenario applies to the database. To solve this problem, we need to understand the principle of "load balancing".
How Web servers do load Balancing
The most importa
HA implementation in highly available clusters heartbeat of course there are others like keepliveHow the load-balanced cluster LB is implemented.(1). Hardware lb (more famous) F5; The big-IP series, Citri, the company's NetScaler series, the A10 Company's AX-series(2). Software lb Four layer: LVS (Linux virtualserver)Note: Chinese developed, seven-storey: nginx,haproxyHigh-availability
Recently, one of the company's main website revision finished finally on the line, involving me for half a year, and now finally have time to sit down to write something, summed up their technical experience. This time, according to the number and quality of the server, I use load balancing high redundancy architecture, consider single point of failure, the web also abandoned Apache, and use Nginx, database
row in Set (0.00 sec) Error:no query specified3) Use Navicat connection Mycat, operation mode and connection physical MySQL library consistent, user admin, password admin, Port 8066
After the connection is successful, you will see the TestDB database and the test data table
Add some data to the test table to save
Perform a SELECT * from test to view the test operation and see that the data is not updated
Cause: Mycat Query Sq is routed to B, so the result set read is incon
rooms. This information can be judged according to the global information.The above about how the communication between the contents of the server, is a personal guess, QQ in the end how to do, I am afraid only after one of us into the Tencent to know. Oh. However, one thing is for sure, in the entire server architecture, there should be a place that is dedicated to keeping a global list of logged-in playe
/keepalived.conf! Configuration File for Keepalived# Global Definition SectionGlobal_defs {Notification_email {[Email protected]}Notification_email_from [email protected]Smtp_server 127.0.0.1Smtp_connect_timeout 30router_id Lvs_devel}Vrrp_instance Vi_1 {State Master # master server is Master, standby server is backupInterface eth0VIRTUAL_ROUTER_ID 51MCAST_SRC_IP 192.168.171.10 # The IP address of the main nginx ServicePriority 100Advert_int 1Authentic
working with LAYER4, such as Web 80 port load Balancing, keepalived detects that 80 ports in the back-end server group are not started, and if not, it is considered invalid and rejected· When working with Layer7, according to user's settings, if the user does not match the set, it is considered invalid and rejectedThree modules:· Core: Responsible for initiating and maintaining the main process, loading an
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.