HA enterprises (keepalived) high-availability cluster Profile

About a .keepalived

1.keepalived basic concepts

  • Keepalived is a lightweight Linux under other high-availability solutions. HA (High Avalilability, HA), in fact, two different kinds of meaning: a broad sense, refers to the high availability of the entire system, the narrow sense, is the host of redundancy and takeover
  • keepalived LVS is initially designed specifically for each service node status monitoring cluster system, which node status of each server according to the third, the fourth, the exchange detecting mechanism TCP / IP reference model of the fifth layer, If a server anomaly occurs, or fails to work, keepalived will be detected and removed from the failed server node cluster system appear, these work only done automatically, without human intervention, need to manually complete the repair occurs only the failure of the service node.
  • Keepalived later joined the VRRP function, purpose VRRP (Virtual Router Redundancy Protocol, Virtual Router Redundancy Protocol) is emerging to solve the problem of static routing single point of failure can be achieved through VRRP network uninterrupted stable operation, and therefore the one hand keepalived having the server status detection and fault isolation features, on the other hand also has a function HA cluster.

2.VRRP agreement with the works
a.VRRP agreement:

  • In the real network environment. Communication between the host is through static routes configured or default gateway to complete, between the host and the router event of failure, the communication will fail, and therefore in this communication mode, the router becomes a single point of bottlenecks, to solve this problem on the introduction of VRRP protocol.
  • It is a protocol of the master standby mode, the switching device can be transparent without affecting the data communication between the host network failures by the VRRP, which involves two concepts: the physical router and virtual router.

b.VRRP works

  • VRRP can be two sets of multiple physical or virtual routers into a virtual routing, virtual routing through the Virtual IP (one or more) provide services, and to work together in a virtual router inside more than a dozen physical router, the same time only one physical router to provide services, this physical standby routing device called a router, he has the external virtual IP, offers a variety of network functions, and other physical router does not have the external virtual IP, nor to provide external network function, receiving only VRRP state master through high information, these routers systems are called roles of bACKUP, when the primary route fails, the backup router in bACKUP role will be re-election, generate a new master router into the mASTER role, continue to provide services outside the whole switching is transparent to the user.
  • Each virtual router has a unique identification number, become VRID, a VRID with a set of IP addresses constitute a virtual router in the VRRP agreement, all IP packets are sent through the multi-play, and in a virtual the router, the router only in the Master role would have been to send VRRP packets, the router is in BACKUP role only accept packets of information sent from the Master role for health monitoring Master, the situation usually does not happen to seize BACKUP unless it's a higher priority, and when the Master is unavailable, BACKUP will not receive information Master sent me, so he finds Master fails, then the election will be more than BACKUP, BACKUP highest priority will be the new the Master, this election is switched roles very quickly. Thus ensuring the continuous availability of services.

Two .keepalived works on the operating status and fault isolation server

  keepalived作为一个高性能集群软件,它能实现对集群中服务器运行状态的监控以及故障隔离,下面介绍对服务器运行状态和故障隔离的工作原理。 

Keepalived three working TCP / IP reference model, four, five, i.e. respectively: the network layer, the transport layer, application layer, according to TCP, IP barrier parameter model can realize the function, the following operation mechanism Keepalived :

In the network layer:
the layer four protocol network (IP Internet protocol, Internet Control Message Protocol may ICMP, Address Resolution Protocol ARP, Reverse Address Resolution Protocol RARP) Keepalived in the network layer using the most common mode of operation by ICMP protocol sent to the server in the cluster each node an ICMP packets, similar to the ping function, if a node does not return a response packet, it is considered that the node is faulty, Keepalived will report this node fails, and from server cluster nodes removed.

In the transport layer:
Providing two main protocols: transmission control protocol (TCP) and User Datagram Protocol the UDP, the transmission control protocol (TCP) to provide reliable data output services, IP address and port, a connection on behalf of the TCP, to obtain TCP service You need to establish a connection on a port and a receiver port of the transmitter, and the transport layer utilized in keepalived port connection and the TCP protocol scanning techniques to determine whether the normal cluster node, such as a common web server port 80, keepalived Once the transport layer ports detect these signals and no data is returned in response to the data, it is considered abnormal these ports, the node and then force them to weed out the corresponding port from the server cluster.

At the application layer:

Can run FTP, TELNEL, SMTP, DNS, and other various types of high-level protocols, Keepalived mode of operation is also more comprehensive and complicated, the user can customize Keepalived work, for example, by programming or scripting to run Keepalived , while according to the parameters set by the user Keepalived to detect various programs or services are functioning correctly, when the detection result and inconsistent Keepalived set by the user, will Keepalived removed from the corresponding server in the server cluster.

Keepalived LVS is initially designed, since the state detection can be achieved Keepalived cluster node and IPVS load balancing can be implemented, therefore, by means of the third-party modules Keepalived IPVS can easily develop a load balancing system is here Because of a misunderstanding that Keepalived can work together and IPVS, it is generally considered Keepalived is a load-balancing software, this understanding is wrong.

Guess you like

Origin blog.csdn.net/Y950904/article/details/92801692