Centos 7.5
Keepalived 1.4.5
Firewall, SELinux have been closed, we can see on the master node VIP generated, but for the node and other server is unable to ping the VIP, keepalived VIP can
main/backup
The master node configuration:
! The Configuration File for keepalived
Global_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
The priority of 100
Advert_int 1
The authentication {
The 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
}
}
For node configuration:
! The Configuration File for keepalived
Global_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 {
The state BACKUP
Interface eth0
Virtual_router_id 91
The priority of 90
Advert_int 1
The authentication {
The 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 - the LVS and VRRP High the Availability Monitor
The Loaded: the Loaded (/usr/lib/systemd/system/keepalived. Service; Enabled. Vendor preset: disabled)
Active: the Active (running) since Thu 21:32:01 2018-07-26 EDT. 32 min line
Process: 32453 ExecStart=/usr/local/keepalived/sbin/keepalived $KEEPALIVED_OPTIONS (code=exited, status=0/SUCCESS)
The 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 - D
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: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 - the LVS and VRRP High the Availability Monitor
The Loaded: the Loaded (/usr/lib/systemd/system/keepalived. Service; Enabled. Vendor preset: disabled)
Active: the Active (running) since Thu 21:32:12 2018-07-26 EDT. 32 min line
Process: 4527 ExecStart=/usr/local/keepalived/sbin/keepalived $KEEPALIVED_OPTIONS (code=exited, status=0/SUCCESS)
The 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 - D
Jul 26 21:32:12 host2 Keepalived_vrrp [4530] : Opening the file '/etc/keepalived/keepalived conf'.
Jul 26 21:32:12 host2 Keepalived_healthcheckers [4529] : the Initializing ipvs
Jul 26 21:32:12 host2 Keepalived_healthcheckers [4529] : Gained quorum 1 + 0=1 & lt;=2 for VS 80
[192.168.126...Jul 26 21:32:12 host2 Keepalived_healthcheckers [4529] : Activating healthchecker for service [80
192.16...Jul 26 21:32:12 host2 Keepalived_healthcheckers [4529] : Activating healthchecker for service [80
192.16...Jul 26 21:32:12 host2 Keepalived_vrrp [4530] : VRRP_Instance (VI_1) o 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) if BACKUP STATE
Jul 26 21:32:12 host2 Keepalived_vrrp [4530] : VRRP sockpool: [ifindex (2), proto (112), unicast (1), 1)] f...
CodePudding user response:
In the master can ping VIP? 11 of 12 can be exchanged?CodePudding user response:
Hello, first of all, the main can prepare ping, VIP whether can ping, if there is a ban ping the virtual machineCodePudding user response:
Eldest brother you write this is what the key information of the nonullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull