Summary:
Lvs Keepalived initially used with load balancing for control and management and monitoring the state of each node in the system, is subsequently added to the cluster VRRP management function to ensure high availability cluster, to prevent single point of failure
Vrrp agreement can be considered highly available protocol router is to the same effect inside the server in the server group, and MASTER BACKUP nodes and nodes, MASTER node inside vip address external service provider, master sends a heartbeat icmp as backup (ICMP tcp is the sub-protocol is internet protocol packet for transmitting messages between the server and the IP address, use Can service message, unreasonable network communication, whether the IP address arrives, whether the class with the route, the network the message itself) when the master node does not send a heartbeat, backup node will automatically think master node dawdle out, backup host a new master node priority election, instead of the original work of the master node, reduce, due to server the failure caused the loss.
Features:
1. Support load balancing lvs
2. availability prevents single point of failure
Profile: /etc/keepalived/keepalived.conf
Global configuration global_defs {# define alarm notification_email {e-mail address [email protected] [email protected] [email protected] } notification_email_from [email protected] # Define Send e-mail addresses smtp_server 192.168.200.1 #-mail server smtp_connect_timeout 30 # defined timeout router_id LVS_DEVEL # definition of route identification information, the only same local area network }
Examples defined vrrp_instance VI_1 {# state MASTER # state parameter master / backup merely illustrative IP address of the virtual interface eth0 # card placement position virtual_router_id 51 # of the same family to have been consistent with a cluster id priority determining priority 100 # is the primary or backup greater the priority advert_int 1 # standby communication time interval authentication { auth_type PASS auth_pass 1111 # Certification } virtual_ipaddress { Virtual ip address 192.168.200.16 used between devices 192.168.200.17 192.168.200.18 } }
problem:
Why is vrrp protocol:
VRRP, full name of the Virtual Router Redundancy Protocol, the Chinese called Virtual Router Redundancy Protocol, VRRP appear to solve the problem of static single point of failure of prostrate Fu, is by means of a VRRP election mechanism to route tasks to a VRRP routers of.
What is the split brain:
In high availability (HA) systems, when contacting the two nodes heartbeat off, would have been coordinated as a whole, the action HA system, it is split into two separate body, since lost contact with each other ,, thought the other broke down, two-node HA software like split-brain people as possible to store data at the same time, competition for resources, resulting in damage of data
Split brain occur for several reasons:
1. Because the heartbeat between a server failure, resulting in not normal communication
2. heartbeat bad
3. heartbeat connection of equipment failure
4. Firewall blocks the transmission of information heartbeat
5. Configure the heartbeat is not transmitted correctly Error
Split brain solution:
1. Simultaneously with the two strip lines heartbeat
2. When detecting the split brain, heart forced to close another node
3. good monitoring alarm on split brain, a problem, you can know as soon as possible, to resolve as soon as possible