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 > Servers >
Share
Shulou(Shulou.com)06/02 Report--
1. profile
Keepalived is a VRRP protocol based high availability solution for LVS services, which can be used to avoid single point failures. An LVS service will have two servers running Keepalived, one as the primary server (MASTER) and one as the backup server (BACKUP), but it appears as a virtual IP to the outside world. The primary server will send a specific message to the backup server. When the backup server does not receive this message, that is, when the primary server goes down, the backup server will take over the virtual IP and continue to provide services, thus ensuring high availability. Keepalived is a perfect implementation of VRRP, so before introducing keepalived, let's introduce the principle of VRRP.
1. Introduction to VRRP Protocol
In a real network environment, two hosts that need to communicate do not have a direct physical connection in most cases. In this case, how do you choose the route between them? There are two common solutions to the problem of how the host chooses the next hop route to the destination host:
Configure static routes on hosts using dynamic routing protocols (RIP, OSPF, etc.)
Obviously, configuring dynamic routing on a host is impractical because of the administrative, maintenance, and support issues. Configuring static routes becomes popular, but routers (or default gateways) often become single points of failure. VRRP aims to solve the problem of static routing single point failure. VRRP dynamically hands over the routing task to one VRRP router in the virtual router of LAN through an election protocol.
2. VRRP Working Mechanism
In a VRRP virtual router, there are multiple physical VRRP routers, but these multiple physical machines cannot work at the same time, but a MASTER is responsible for routing work, the others are BACKUP, MASTER is not static, VRRP allows each VRRP router to participate in the election, and the final winner is MASTER. MASTER has some privileges, such as having the IP address of the virtual router that our hosts use as static routes. The privileged MASTER is responsible for forwarding packets sent to gateway addresses and responding to ARP requests.
VRRP implements the function of virtual router through election protocol, and all protocol messages are sent in the form of IP multicast packets (multicast address 224.0.0.18). A virtual router consists of a VRID(range 0-255) and a set of IP addresses that appear as a well-known MAC address. Therefore, in a virtual router, no matter who is MASTER, the outside is the same MAC and IP(called VIP). The client host does not need to modify its own routing configuration because of the change of MASTER. For the client, this master-slave switch is transparent.
In a virtual router, only VRRP routers that are MASTER will always send VRRP advertisement messages, BACKUP will not preempt MASTER unless its priority is higher. When MASTER is unavailable (BACKUP does not receive notification information), the one with the highest priority among multiple BACKUP will be preempted as MASTER. This preemption is very fast (
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.