码迷,mamicode.com
首页 > 其他好文 > 详细

Keepalived 安装

时间:2016-09-12 00:18:29      阅读:239      评论:0      收藏:0      [点我收藏+]

标签:

一、首先确保一些核心参数配置正确

修改 /etc/sysctl.conf的如下参数:

net.ipv4.ip_forward=1

net.ipv4.ip_nonlocal_bind = 1
net.ipv4.conf.lo.arp_ignore = 1
net.ipv4.conf.lo.arp_announce = 2
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2

 sysctl -p /etc/sysctl.conf

cat /proc/sys/net/ipv4/ip_forward

cat /proc/sys/net/ipv4/ip_nonlocal_bind

cat /proc/sys/net/ipv4/conf/lo/arp_ignore
cat /proc/sys/net/ipv4/conf/lo/arp_announce
cat /proc/sys/net/ipv4/conf/all/arp_ignore
cat /proc/sys/net/ipv4/conf/all/arp_announce

二、在主节点 修改keepalived.conf

global_defs {
notification_email{
andy_hugb@hotmail.com
}
notification_email_from andy_hugb@163.com
smtp_server mail.163.com
smtp_connect_timeout 30
router_id LVS_DEVEL
}

vrrp_instance VI_1 {
state MASTER
interface ens33
virtual_router_id 51
priority 100
advert_int 1
mcast_src_ip 192.168.222.132
authentication {
auth_type PASS
auth_pass 8888
}
virtual_ipaddress {
192.168.222.134/24 brd 192.168.222.255 dev ens33 label ens33:vip
}
}

三、在备节点修改keepalived.conf

global_defs {
notification_email{
andy_hugb@hotmail.com
}
notification_email_from andy_hugb@163.com
smtp_server mail.163.com
smtp_connect_timeout 30
router_id LVS_DEVEL
}

vrrp_instance VI_1 {
state BACKUP
interface ens33
virtual_router_id 51
priority 100
advert_int 1
mcast_src_ip 192.168.222.133
authentication {
auth_type PASS
auth_pass 8888
}
virtual_ipaddress {
192.168.222.134/24 brd 192.168.222.255 dev ens33 label ens33:vip
}
}

 

Keepalived 安装

标签:

原文地址:http://www.cnblogs.com/hugb/p/5863073.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!