环境:
centos 7.5
keepalived 1.4.5防火墙,SELinux均已关闭,主节点上可以看到vip生成,但是备节点以及其它服务器都无法ping通vip,keepalived 的vip可进行主备切换主节点配置:! Configuration File for keepalivedglobal_defs {
notification_email {
[email protected]
[email protected]
[email protected]
}
notification_email_from [email protected]
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id LVS_DEVEL
}vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 91
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
unicast_src_ip 192.168.126.11
unicast_peer {
192.168.126.12
}
virtual_ipaddress {
192.168.126.100/24
}
}备节点配置:! Configuration File for keepalivedglobal_defs {
notification_email {
[email protected]
[email protected]
[email protected]
}
notification_email_from [email protected]
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id LVS_DEVEL
}vrrp_instance VI_1 {
state BACKUP
interface eth0
virtual_router_id 91
priority 90
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
unicast_src_ip 192.168.126.12
unicast_peer {
192.168.126.11
}
virtual_ipaddress {
192.168.126.100/24
}
}[root@host1 keepalived]# systemctl status keepalived.service
keepalived.service - LVS and VRRP High Availability Monitor
Loaded: loaded (/usr/lib/systemd/system/keepalived.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2018-07-26 21:32:01 EDT; 32min ago
Process: 32453 ExecStart=/usr/local/keepalived/sbin/keepalived $KEEPALIVED_OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 32454 (keepalived)
Tasks: 3
CGroup: /system.slice/keepalived.service
32454 /usr/local/keepalived/sbin/keepalived -D
32455 /usr/local/keepalived/sbin/keepalived -D
32456 /usr/local/keepalived/sbin/keepalived -DJul 26 21:32:03 host1 Keepalived_vrrp[32456]: Sending gratuitous ARP on eth0 for 192.168.126.100
Jul 26 21:32:03 host1 Keepalived_vrrp[32456]: Sending gratuitous ARP on eth0 for 192.168.126.100
Jul 26 21:32:03 host1 Keepalived_vrrp[32456]: Sending gratuitous ARP on eth0 for 192.168.126.100
Jul 26 21:32:03 host1 Keepalived_vrrp[32456]: Sending gratuitous ARP on eth0 for 192.168.126.100
Jul 26 21:32:08 host1 Keepalived_vrrp[32456]: Sending gratuitous ARP on eth0 for 192.168.126.100
Jul 26 21:32:08 host1 Keepalived_vrrp[32456]: VRRP_Instance(VI_1) Sending/queueing gratuitous ARPs...100
Jul 26 21:32:08 host1 Keepalived_vrrp[32456]: Sending gratuitous ARP on eth0 for 192.168.126.100
Jul 26 21:32:08 host1 Keepalived_vrrp[32456]: Sending gratuitous ARP on eth0 for 192.168.126.100
Jul 26 21:32:08 host1 Keepalived_vrrp[32456]: Sending gratuitous ARP on eth0 for 192.168.126.100
[root@host2 keepalived]# systemctl status keepalived.service
keepalived.service - LVS and VRRP High Availability Monitor
Loaded: loaded (/usr/lib/systemd/system/keepalived.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2018-07-26 21:32:12 EDT; 32min ago
Process: 4527 ExecStart=/usr/local/keepalived/sbin/keepalived $KEEPALIVED_OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 4528 (keepalived)
Tasks: 3
CGroup: /system.slice/keepalived.service
4528 /usr/local/keepalived/sbin/keepalived -D
4529 /usr/local/keepalived/sbin/keepalived -D
4530 /usr/local/keepalived/sbin/keepalived -DJul 26 21:32:12 host2 Keepalived_vrrp[4530]: Opening file '/etc/keepalived/keepalived.conf'.
Jul 26 21:32:12 host2 Keepalived_healthcheckers[4529]: Initializing ipvs
Jul 26 21:32:12 host2 Keepalived_healthcheckers[4529]: Gained quorum 1+0=1 <= 2 for VS [192.168.126...80
Jul 26 21:32:12 host2 Keepalived_healthcheckers[4529]: Activating healthchecker for service [192.16...80
Jul 26 21:32:12 host2 Keepalived_healthcheckers[4529]: Activating healthchecker for service [192.16...80
Jul 26 21:32:12 host2 Keepalived_vrrp[4530]: VRRP_Instance(VI_1) removing protocol VIPs.
Jul 26 21:32:12 host2 Keepalived_vrrp[4530]: Using LinkWatch kernel netlink reflector...
Jul 26 21:32:12 host2 Keepalived_vrrp[4530]: VRRP_Instance(VI_1) Entering BACKUP STATE
Jul 26 21:32:12 host2 Keepalived_vrrp[4530]: VRRP sockpool: [ifindex(2), proto(112), unicast(1), f...1)]
centos 7.5
keepalived 1.4.5防火墙,SELinux均已关闭,主节点上可以看到vip生成,但是备节点以及其它服务器都无法ping通vip,keepalived 的vip可进行主备切换主节点配置:! Configuration File for keepalivedglobal_defs {
notification_email {
[email protected]
[email protected]
[email protected]
}
notification_email_from [email protected]
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id LVS_DEVEL
}vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 91
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
unicast_src_ip 192.168.126.11
unicast_peer {
192.168.126.12
}
virtual_ipaddress {
192.168.126.100/24
}
}备节点配置:! Configuration File for keepalivedglobal_defs {
notification_email {
[email protected]
[email protected]
[email protected]
}
notification_email_from [email protected]
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id LVS_DEVEL
}vrrp_instance VI_1 {
state BACKUP
interface eth0
virtual_router_id 91
priority 90
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
unicast_src_ip 192.168.126.12
unicast_peer {
192.168.126.11
}
virtual_ipaddress {
192.168.126.100/24
}
}[root@host1 keepalived]# systemctl status keepalived.service
keepalived.service - LVS and VRRP High Availability Monitor
Loaded: loaded (/usr/lib/systemd/system/keepalived.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2018-07-26 21:32:01 EDT; 32min ago
Process: 32453 ExecStart=/usr/local/keepalived/sbin/keepalived $KEEPALIVED_OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 32454 (keepalived)
Tasks: 3
CGroup: /system.slice/keepalived.service
32454 /usr/local/keepalived/sbin/keepalived -D
32455 /usr/local/keepalived/sbin/keepalived -D
32456 /usr/local/keepalived/sbin/keepalived -DJul 26 21:32:03 host1 Keepalived_vrrp[32456]: Sending gratuitous ARP on eth0 for 192.168.126.100
Jul 26 21:32:03 host1 Keepalived_vrrp[32456]: Sending gratuitous ARP on eth0 for 192.168.126.100
Jul 26 21:32:03 host1 Keepalived_vrrp[32456]: Sending gratuitous ARP on eth0 for 192.168.126.100
Jul 26 21:32:03 host1 Keepalived_vrrp[32456]: Sending gratuitous ARP on eth0 for 192.168.126.100
Jul 26 21:32:08 host1 Keepalived_vrrp[32456]: Sending gratuitous ARP on eth0 for 192.168.126.100
Jul 26 21:32:08 host1 Keepalived_vrrp[32456]: VRRP_Instance(VI_1) Sending/queueing gratuitous ARPs...100
Jul 26 21:32:08 host1 Keepalived_vrrp[32456]: Sending gratuitous ARP on eth0 for 192.168.126.100
Jul 26 21:32:08 host1 Keepalived_vrrp[32456]: Sending gratuitous ARP on eth0 for 192.168.126.100
Jul 26 21:32:08 host1 Keepalived_vrrp[32456]: Sending gratuitous ARP on eth0 for 192.168.126.100
[root@host2 keepalived]# systemctl status keepalived.service
keepalived.service - LVS and VRRP High Availability Monitor
Loaded: loaded (/usr/lib/systemd/system/keepalived.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2018-07-26 21:32:12 EDT; 32min ago
Process: 4527 ExecStart=/usr/local/keepalived/sbin/keepalived $KEEPALIVED_OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 4528 (keepalived)
Tasks: 3
CGroup: /system.slice/keepalived.service
4528 /usr/local/keepalived/sbin/keepalived -D
4529 /usr/local/keepalived/sbin/keepalived -D
4530 /usr/local/keepalived/sbin/keepalived -DJul 26 21:32:12 host2 Keepalived_vrrp[4530]: Opening file '/etc/keepalived/keepalived.conf'.
Jul 26 21:32:12 host2 Keepalived_healthcheckers[4529]: Initializing ipvs
Jul 26 21:32:12 host2 Keepalived_healthcheckers[4529]: Gained quorum 1+0=1 <= 2 for VS [192.168.126...80
Jul 26 21:32:12 host2 Keepalived_healthcheckers[4529]: Activating healthchecker for service [192.16...80
Jul 26 21:32:12 host2 Keepalived_healthcheckers[4529]: Activating healthchecker for service [192.16...80
Jul 26 21:32:12 host2 Keepalived_vrrp[4530]: VRRP_Instance(VI_1) removing protocol VIPs.
Jul 26 21:32:12 host2 Keepalived_vrrp[4530]: Using LinkWatch kernel netlink reflector...
Jul 26 21:32:12 host2 Keepalived_vrrp[4530]: VRRP_Instance(VI_1) Entering BACKUP STATE
Jul 26 21:32:12 host2 Keepalived_vrrp[4530]: VRRP sockpool: [ifindex(2), proto(112), unicast(1), f...1)]
解决方案 »
- dockerfile中执行yum操作报错
- DNS服务无法启动。 大家帮忙看看。谢谢谢谢谢。
- linux系统centos7.2 安装nginx出这个问题 说是yum源的问题 求解
- Red Hat Linux下tomcat启动用户权限问题
- centos6聚合链路问题,谢谢大家
- 大学网络工程与管理怎么办
- Qt的Qevent的问题
- 虚拟机centos7 telnet不通宿主机
- 如何使应用程序能够像menuconfig可定制开发
- linux下安装软件gnuplot到指定路径,无法运行
- linux嵌入式后台进程无法产生core文件
- 问下device和driver的问题,我的linux笔记本插上一个新设备会自动insmod一个device文件吗?
其他机器无法ping vip