[root@centos ~]# dnf install ipvsadm keepalived
[root@centos ~]# vim /etc/keepalived/keepalived.conf
virtual_server 192.168.51.21 80 {
delay_loop 3
lb_algo rr
protocol TCP
real_server 192.168.52.31 80 {
weight 1
inhibit_on_failure
TCP_CHECK {
connect_port 80
connect_timeout 30
nb_get_retry 3
delay_before_retry 3
}
}
real_server 192.168.52.32 80 {
weight 1
inhibit_on_failure
TCP_CHECK {
connect_port 80
connect_timeout 30
nb_get_retry 3
delay_before_retry 3
}
}
}
CentOS 8 keepalived ロードバランサー構築