个人博客

kubernetes 部署--Keepalived ⑥

16 04月
作者:西洪室|分类:技术

1. 安装keepalived

yum install keepalived -y

2. keepalived配置文件

master1配置文件


cat > /etc/keepalived/keepalived.conf <<EOL
! Configuration File for keepalived
global_defs {
    notification_email {
    feng110498@163.com
    }
    notification_email_from Alexandre.Cassen@firewall.loc
    smtp_server 127.0.0.1
    smtp_connect_timeout 30
    router_id LVS_1
}
vrrp_instance VI_1 {
    state MASTER
    interface ens160
    virtual_router_id 50
    advert_int 1
    priority 120
    authentication {
    auth_type PASS
    auth_pass 1111
    }
    virtual_ipaddress {
    192.168.22.100/24
    }
}
EOL


master2配置文件

cat > /etc/keepalived/keepalived.conf <<EOL
! Configuration File for keepalived
global_defs {
    notification_email {
    feng110498@163.com
    }
    notification_email_from Alexandre.Cassen@firewall.loc
    smtp_server 127.0.0.1
    smtp_connect_timeout 30
    router_id LVS_1
}
vrrp_instance VI_1 {
    state MASTER
    interface ens160
    virtual_router_id 50
    advert_int 1
    priority 110
    authentication {
    auth_type PASS
    auth_pass 1111
    }
    virtual_ipaddress {
    192.168.22.100/24
    }
}
EOL

master3配置文件


cat > /etc/keepalived/keepalived.conf <<EOL
! Configuration File for keepalived
global_defs {
    notification_email {
    feng110498@163.com
    }
    notification_email_from Alexandre.Cassen@firewall.loc
    smtp_server 127.0.0.1
    smtp_connect_timeout 30
    router_id LVS_1
}
vrrp_instance VI_1 {
    state MASTER
    interface ens160
    virtual_router_id 50
    advert_int 1
    priority 100
    authentication {
    auth_type PASS
    auth_pass 1111
    }
    virtual_ipaddress {
    192.168.22.100/24
    }
}
EOL


加载并启动服务

systemctl enable keepalived
systemctl start keepalived
systemctl status keepalived


浏览1339 评论0
返回
目录
返回
首页
Zabbix Server 4.2.0 安装(Mysql8.0 + Php72 + Nginx1.14.2) kubernetes 部署--kubeadm部署kubernetes集群 ⑦

发表评论