add script
This commit is contained in:
47
manifest/yaml/keepalived.conf
Normal file
47
manifest/yaml/keepalived.conf
Normal file
@@ -0,0 +1,47 @@
|
||||
global_defs {
|
||||
script_user root root
|
||||
enable_script_security off
|
||||
}
|
||||
|
||||
vrrp_script chk_haproxy {
|
||||
script "/usr/sbin/pidof haproxy"
|
||||
interval 2
|
||||
weight 2
|
||||
}
|
||||
|
||||
vrrp_instance VI_1 {
|
||||
state MASTER # MASTER는 메인 LB, 백업 LB는 BACKUP 으로 설정
|
||||
interface enp0s8 # 사용할 interface
|
||||
virtual_router_id 51
|
||||
priority 100 # MASTER의 우선순위가 적어도 1이상 높아야 함
|
||||
advert_int 1
|
||||
nopreempt
|
||||
authentication { # 인증에 사용될 password(동일하게 맞춰주기만 하면 됨)
|
||||
auth_type PASS
|
||||
auth_pass 1111
|
||||
}
|
||||
|
||||
unicast_src_ip LB1 # LB 서버 local ip
|
||||
|
||||
unicast_peer {
|
||||
LB2 # 다른 LB 서버 local ip
|
||||
}
|
||||
|
||||
virtual_ipaddress {
|
||||
VIP # 클러스터 구성에 사용될 VIP!
|
||||
}
|
||||
|
||||
notify_master "/bin/sh /etc/keepalived/notify_action.sh MASTER"
|
||||
notify_backup "/bin/sh /etc/keepalived/notify_action.sh BACKUP"
|
||||
notify_fault "/bin/sh /etc/keepalived/notify_action.sh FAULT"
|
||||
notify_stop "/bin/sh /etc/keepalived/notify_action.sh STOP"
|
||||
|
||||
track_script {
|
||||
chk_haproxy
|
||||
}
|
||||
|
||||
track_interface {
|
||||
enp0s8 # 사용할 interface
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user