gpt4 book ai didi

virtualbox - KeepAlived + HAProxy 一段时间后连接被拒绝

转载 作者:行者123 更新时间:2023-12-04 18:01:56 25 4
gpt4 key购买 nike

我有下一个场景,4 个运行 Red Hat Enterprise Linux 7 的虚拟机:

  • 20.1.67.230 服务器(虚拟 IP)(不是主机)

  • 20.1.67.219 haproxy1(负载均衡器)

  • 20.1.67.229 haproxy2(负载均衡器)
  • 20.1.67.223 server1(负载平衡)
  • 20.1.67.213 server2(负载平衡)

我的 keepalived.conf 文件是:

vrrp_script chk_haproxy {

script "killall -0 haproxy" # check the haproxy process

interval 2 # every 2 seconds

weight 2 # add 2 points if OK

}

vrrp_instance VI_1 {

interface enp0s3 # interface to monitor

state MASTER# MASTER on haproxy1, BACKUP on haproxy2

virtual_router_id 51

priority 101 # 101 on haproxy1, 100 on haproxy2

unicast_src_ip 20.1.67.229 # This is the IP of the interface keepalived listens on

unicast_peer { # This is the IP of the peer instance

20.1.67.219

}

virtual_ipaddress {

20.1.67.230 # virtual ip address

}

track_script {

chk_haproxy

}

}

当对虚拟 IP 执行请求时,例如:

curl  server:8888/info

一切正常,但只是有一段时间,在一些请求之后命令返回我:连接被拒绝

所以我必须手动重启 keepalived 服务,这样:

systemctl restart keepalived.service

整个系统似乎运行良好,haproxy1haproxy2 之间的 VRRP 消息正常,就像虚拟 IP 无法正常工作一样。

任何人都可以指出正确的方向来诊断和解决这个问题吗?

最佳答案

这是一个网络问题。网络上有一台设备的 IP 与我选择的虚拟 IP 相同。

关于virtualbox - KeepAlived + HAProxy 一段时间后连接被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33868176/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com