In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
Keepalived Profile:
Keepalived, keep alive, in the network is to keep online, that is, HA, used to prevent the occurrence of single point failure, the most important in keepalived is VRRP protocol, it is keepalived to achieve high availability basis.
1. VRRP Protocol
Network design must consider redundancy disaster recovery, line disaster recovery, equipment disaster recovery, so as to prevent the occurrence of single point failure, so in the router or layer 3 switch to achieve redundancy, here we must use vrrp protocol, that is, vrrp is a fault tolerance protocol, in order to eliminate the default router in the static default routing environment single point failure caused by the design of the active standby mode protocol, so that in the event of failure and equipment function switching can not affect internal and external data communication, There is no need to modify the network parameters of the internal network.
VRRP protocol virtualizes two or more router devices into one device, providing virtual router IP (one or more) externally, and inside the virtual router, the master who has operation authority over the virtual router is the Master, or is elected by algorithm. The master implements various network functions for the virtual router IP, such as ARP request, ICMP and data forwarding; other devices do not own the IP, and the status is BACKUP. Except for receiving VRRP status notification information from the Master, they do not perform external network functions. When a host fails, Backup takes over the original master network functions.
When configuring VRRP protocol, it is necessary to configure the virtual router id of each router, that is, VRID and priority value. Routers with the same VRID value are grouped into the same group. VRID is a positive integer from 0 to 255. Routers in the same group elect Master by using priority weight value. The priority weight value is Master, the weight value is Backup, and the priority weight value is also a positive integer from 0 to 255.
VRRP protocol uses multicast data to transmit VRRP data. VRRP data uses a special virtual source MAC address to send data instead of the MAC address of its own network card. When vrrp runs, only the Master router regularly sends vrrp notification information, indicating that the Master works normally. Backup is only responsible for receiving Vrrp data and does not send data. If no notification information is received from the Master within a certain period of time, each Backup will declare itself as the Master, send notification information, and resume the Master election state.
Related terms:
Virtual router: composed of a Master router and multiple Backup routers, the host uses the virtual router as the default gateway;
Virtual IP address: IP address of virtual router, a virtual router can have one or more IP addresses;
VRID: identifies a virtual router. A group of routers with the same VRID is a virtual router.
Master router: A router that undertakes forwarding tasks in a virtual router;
Backup router: only responsible for receiving data in the virtual router. When the Master router fails, it can replace the Master router:
VRRP has two ways to select the position of each router in a virtual router based on priority weights:
1)Non-preemptive: If the Backup router is operating in a non-preemptive mode, as long as the Master router does not fail, the Backup router will not become the Master router even if it is later configured with a higher priority;
2)Preemption mode: If the Backup router works in the preemption mode, after receiving the VRRP message, it will compare its priority with the priority in the advertisement. If its priority is higher than the current Master priority, it will actively preempt to become the Master router; otherwise, it will maintain the Backup state.
II.Keepalived Principle
1. Keepalived component:
Keepalived is modular design, different modules are responsible for different functions;
Keepalived components: core, check, vrrp, lipipfwc, lipipvs-2.4, lipipvs-2.6
core: is the core of keepalived, responsible for starting and maintaining the main process, loading and parsing the global configuration file, etc.;
check: responsible for healthchecker(health check), including various health check methods and corresponding configuration analysis;
vrrp: vrrpd child process, vrrpd child process is used to implement vrrp protocol;
libipfwc: iptables library, used when configuring LVS;
lipipvs *: Configure LVS;
2. keepalived process
Keepalived starts with three processes:
Parent process: memory management, child process management;
Child process: VRRP child process;
Child process: healthchecker child process;
The two child processes are watched by WatchDog, and each child process is responsible for its own business. The healthchecker child process is responsible for checking the health status of each server. If the healthchecker child process checks that the Master server is unavailable, it will notify the brother vrrpd child process on the local machine to delete the notification and remove the virtual ip.
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.