haproxy 服务启动不起来,原因是服务器重启后导致目录丢失。k8s产生了异常。
lb 的原理需要指定一个VIP
for i in {1..65536}; do if echo &>/dev/null > /dev/tcp/127.0.0.1/${i} ;then echo -e "\t\033[31;40m${i}\033[0m is open"; fi; done
/usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy
cd /run
mkdir haproxy
K8S vip 的两个服务
systemctl restart haproxy.service
systemctl restart keepalived.service
systemctl status haproxy.service
systemctl status keepalived.service