In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "introduction to the working principle of Keepalived". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
At first, Keepalived software is designed for LVS load balancing software, which is used to manage and monitor the status of each service node in the LVS cluster system. Later, it adds the VRRP function that can achieve high availability. Therefore, in addition to being able to manage LVS software, Keepalived can also be used as highly available solution software for other services such as Nginx, Haproxy, MySQL, and so on.
Keepalived adopts modular design, and different modules achieve different functions.
Keepalived has three main modules, namely, core, check and vrrp.
Core: the core of keepalived, responsible for the startup and maintenance of the main process, loading and parsing of global configuration files, etc.
Check: responsible for healthchecker (health check), including various health check methods and corresponding configuration resolution, including LVS configuration resolution. You can check the health status of IPVS backend servers based on script check.
Vrrp: the VRRPD child process, which is used to implement the VRRP protocol
Keepalived profile:
The Keepalived configuration file is: keepalived.conf
There are three main configuration areas, namely: global configuration (Global Configuration), VRRPD configuration, and LVS configuration
The global configuration also includes two subconfigurations: global definition (global definition) static IP address / routing configuration (static ipaddress/routes)
How the Keepalived service VRRP works:
Keepalived high availability pairs communicate through VRRP, and VRRP determines the master / standby through the election mechanism, and the master takes priority over the backup. Therefore, when working, the master will get all the resources first, and the standby node will wait. When the master downtime, the standby node will take over the resources of the primary node, and then replace the primary node to provide services.
Between Keepalived service pairs, only the host server will always send VRRP broadcast packets, telling the standby that it is still alive, and the standby will not be in charge at this time. When the master is not available, that is, when the standby supervisor cannot hear the broadcast packet sent by the master, it will start the relevant service to take over the resources to ensure the continuity of the business. The takeover is the fastest.
The cause of brain fissure:
The heartbeat link between highly available server pairs fails, resulting in a failure of normal communication.
Because the heartbeat is broken (including broken, aging).
Due to the failure of the network card and related drivers, ip configuration and conflict problems (directly connected to the network card)
Due to equipment failure between heartbeats (network card and switch)
There is something wrong with the arbitration machine (using the arbitration scheme)
The iptables firewall is turned on on the highly available server to block heartbeat message transmission.
The information such as the address of the heartbeat network card on the highly available server is not configured correctly, resulting in the failure of sending the heartbeat
Other reasons such as improper configuration of other services, such as different heartbeat mode, wide heartbeat conflict, software Bug and so on.
How to solve brain fissure:
① uses both serial and Ethernet cables to connect, and uses two heartbeat lines at the same time, so that one line is broken and the other is good and can still transmit heartbeat messages.
② forcibly shuts down a heartbeat node when a brain fissure is detected (this function requires the support of special devices, such as Stonith, feyce). Equivalent to the standby node can not receive the heartbeat elimination, through a separate line to send a shutdown command to turn off the power of the primary node.
③ to do a good job of brain crack monitoring and alarm (such as email and text messages, etc., or on duty). When the problem occurs, it is the first time to intervene in arbitration to reduce the loss.
The administrator can reply to the corresponding number or simple string operation to return to the server through the mobile phone. Let the server deal with the corresponding fault automatically according to the instruction so that the time to solve the fault is shorter.
This is the end of the introduction to the working principle of Keepalived. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.