Skip to content

Instantly share code, notes, and snippets.

@uaysk
Created April 3, 2024 03:38
Show Gist options
  • Save uaysk/f3161f58b622276a9ecdd2ce8613df44 to your computer and use it in GitHub Desktop.
Save uaysk/f3161f58b622276a9ecdd2ce8613df44 to your computer and use it in GitHub Desktop.
2024 04 03 방과후 온꿈 HA Failover 예제
Keepalived
! Configuration File for keepalived
global_defs {
router_id 51
}
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 51
priority 200
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
172.30.1.25
172.30.1.26
}
}
Keepalived Slave
! Configuration File for keepalived
global_defs {
router_id 51
}
vrrp_instance VI_1 {
state BACKUP
interface eth0
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
172.30.1.25
172.30.1.26
}
}
HAProxy
global
log /dev/log local0
log /dev/log local1 notice
daemon
#---------------------------------------------------------------------
# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
#---------------------------------------------------------------------
defaults
mode http
log global
option httplog
option dontlognull
option http-server-close
option forwardfor except 127.0.0.0/8
option redispatch
retries 1
timeout http-request 10s
timeout queue 20s
timeout connect 5s
timeout client 20s
timeout server 20s
timeout http-keep-alive 10s
timeout check 10s
#---------------------------------------------------------------------
# apiserver frontend which proxys to the control plane nodes
#---------------------------------------------------------------------
frontend apiserver
bind 0.0.0.0:36443
mode tcp
option tcplog
default_backend apiserverbackend
#---------------------------------------------------------------------
# round robin balancing for apiserver
#---------------------------------------------------------------------
backend apiserverbackend
option httpchk GET /healthz
http-check expect status 200
mode tcp
option ssl-hello-chk
balance roundrobin
server master-1 172.30.1.11:6443 check
server master-2 172.30.1.12:6443 check
server master-3 172.30.1.4:6443 check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment