keepalived high availability

Introduction to keepalived

Here we use keepalived to achieve high availability cluster, because heartbeat has some problems on centos6, which affects the experimental effect
keepalived achieves high availability through VRRP (Virtual Router Redundancy Protocl).
In this protocol, multiple routers with the same function will be formed into a group, and there will be 1 master role and N (N>=1) backup roles in this group.
The master will send VRRP protocol packets to each backup through multicast. When the backup cannot receive the VRRP packets sent by the master, it will consider the master to be down. At this point, it is necessary to decide who becomes the new master according to the priority of each backup.
Keepalived has three modules, namely core, check and vrrp. The core module is the core of keepalived, responsible for the startup and maintenance of the main process and the loading and parsing of global configuration files, the check module is responsible for health checks, and the vrrp module is used to implement the VRRP protocol

keepalived configure high availability

准备两台机器134和136,136作为master,134作为backup
两台机器都执行yum install -y keepalived
两台机器都安装nginx,其中136上已经编译安装过nginx,134上需要yum安装nginx: yum install -y nginx
设定vip为100

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324790278&siteId=291194637