昨晚,这正常工作,但是从今天早上开始,似乎两个节点的角色已经切换。默认情况下,将使用备用Web服务器,当它关闭时,将使用主服务器,但是当server2重新启动时,它将切换回该备用服务器。
两台服务器都在CENTOS7上运行并使用NGINX。这是这两个的配置文件:
SRV1:
global_defs {
notification_email {
root@webserver-01.example.com
}
notification_email_from root@webserver-01.example.com
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id LVS_DEVEL
}
vrrp_instance VI_1 {
state MASTER
interface ens192
virtual_router_id 51
priority 101 #used in election, 101 for master & 100 for backup
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
172.20.25.205/24
}
}
SRV2:
global_defs {
notification_email {
root@webserver-02.example.com
}
notification_email_from root@webserver-02.example.com
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id LVS_DEVEL
}
vrrp_instance VI_1 {
state MASTER
interface ens192
virtual_router_id 51
priority 100 #used in election, 101 for master & 100 for backup
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
172.20.25.205/24
}
}
那里明显有不正确的地方吗?谢谢。