Software L4 Config¶
1. HA software install¶
- 1.1 Keepalived install (@all node)
2. HAProxy config¶
- 2.1 Create keepalived config file
Add below content (every node)
vrrp_instance VI_1 {
state MASTER # 主节点为MASTER,备节点为BACKUP
interface eth0 # 网卡名称
virtual_router_id 111 # VRRP 路由id, 所有节点保持一致
priority 100 # 主节点优先级高于备节点(如101/100/99)
advert_int 1 # 通信心跳周期,单位是秒
authentication {
auth_type PASS
auth_pass 111 # 认证密码,所有节点必须一致
}
virtual_ipaddress {
10.41.8.110/24 # 虚拟 IP 地址 (VIP)
}
}
- 2.2 Start keepalived
- 2.3 Enable IP forward
Add below content
Apply config