KEEPALIVED 做HA实例的安装与配置

简介: --------------------------------------master-------------------------------------------------------wget http://www.

--------------------------------------master-------------------------------------------------------
wget http://www.keepalived.org/software/keepalived-2.0.9.tar.gz
tar zxvf keepalived-2.0.9.tar.gz
cd keepalived-2.0.9
./configure --perfix=/ --mandir=/usr/local/share/man
make &&make install
cp keepalived/etc/init.d/keepalived.rh.init /etc/init.d/keepalived
chmod +x /etc/init.d/keepalived
cp keepalived/etc/init.d/keepalived.sysconfig /etc/sysconfig/keepalived
chkconfig --add keepalived
chkconfig --level 345 keepalived on

编辑

vi /etc/sysconfig/keepalived
global_defs {
notification_email {
finalsd@gmail.com
}
notification_email_from finaxx@gmail.com
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id haproxy-ha
}
vrrp_sync_group VG1 {
group {
VI1
}
}
vrrp_instance VI1 {
state BACKUP
smtp_alert
notify_fault "/root/script/notify_mail.sh fault"
notify_master "/root/script/notify_mail.sh master"
nopreempt
insterface eth1

track_interface {
eth 0
eth 1
}
virtual_router_id 51
priority 150
advert_int 1
authentication {
auth_type PASS
auth_pass abc123..
}
virtual_ipaddress {
192.168.1.1/24 dev eth1 scope global
}
}

service keepalived start

--------------------------------------backup-----------------------------------------------------

wget http://www.keepalived.org/software/keepalived-2.0.9.tar.gz
tar zxvf keepalived-2.0.9.tar.gz
cd keepalived-2.0.9
./configure --perfix=/ --mandir=/usr/local/share/man
make &&make install
cp keepalived/etc/init.d/keepalived.rh.init /etc/init.d/keepalived
chmod +x /etc/init.d/keepalived
cp keepalived/etc/init.d/keepalived.sysconfig /etc/sysconfig/keepalived
chkconfig --add keepalived
chkconfig --level 345 keepalived on

编辑

vi /etc/sysconfig/keepalived
global_defs {
notification_email {
finalsd@gmail.com
}
notification_email_from finaxx@gmail.com
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id haproxy-ha
}
vrrp_sync_group VG1 {
group {
VI1
}
}
vrrp_instance VI1 {
state BACKUP
smtp_alert
notify_fault "/root/script/notify_mail.sh fault"
notify_master "/root/script/notify_mail.sh master"
insterface eth1

track_interface {
eth 0
eth 1
}
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass abc123..
}
virtual_ipaddress {
192.168.1.1/24 dev eth1 scope global
}
}

service keepalived start

/root/script/notify_mail.sh ##发送邮件给xxxx

目录
相关文章
|
监控 网络协议 数据安全/隐私保护
高可用 - 05 Keepalived配置(全局配置、VRRPD、LVS)
高可用 - 05 Keepalived配置(全局配置、VRRPD、LVS)
612 0
|
网络安全 数据安全/隐私保护 网络架构
HA高可用服务及keepalived安装记录
HA高可用服务及keepalived安装记录
2335 0
|
网络协议
KEEPALIVED 做LVS+HA实例安装与配置
--------------------------------------master------------------------------------------------------- wget http://www.
1037 0
|
移动开发 网络协议 Shell
LVS+KEEPALIVED 安装与配置实例
--------------------------------------master--------------------------------------- echo "1" > /proc/sys/net/ipv4/ip_forward wget http://www.
1316 0
|
网络架构
Keepalived 介绍、安装、配置(高可用)
1、keepalived的工作原理是VRRP(Virtual Router Redundancy Protocol)虚拟路由冗余协议。 2、VRRP路由器是指运行VRRP的路由器,是物理实体,虚拟路由器是指VRRP协议创建的,是逻辑概念。
1219 0