add notify script
This commit is contained in:
parent
00a8279068
commit
d3c3df6c66
2
Makefile
2
Makefile
|
@ -1,5 +1,5 @@
|
|||
NAME = osixia/keepalived
|
||||
VERSION = 0.1.0
|
||||
VERSION = 0.1.1
|
||||
|
||||
.PHONY: all build test tag_latest release
|
||||
|
||||
|
|
|
@ -5,6 +5,6 @@ A docker image to run Keepalived.
|
|||
|
||||
## Quick start
|
||||
|
||||
This image need to be run with : --privileged --net=host
|
||||
This image require the kernel module ip_vs loaded on the host and need to be run with : --privileged --net=host
|
||||
|
||||
docker run --privileged --net=host -d osixia/keepalived
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
KEEPALIVED_INTERFACE: p4p1
|
||||
KEEPALIVED_INTERFACE: eth0
|
||||
KEEPALIVED_PASSWORD: d0cker
|
||||
|
||||
# for electing MASTER, highest priority wins.
|
||||
|
@ -7,8 +7,10 @@ KEEPALIVED_PRIORITY: 150
|
|||
|
||||
KEEPALIVED_UNICAST_PEERS:
|
||||
- 192.168.1.10
|
||||
- 192.168.1.11
|
||||
|
||||
KEEPALIVED_VIRTUAL_IPS:
|
||||
- 192.168.1.231
|
||||
- 192.168.1.232
|
||||
|
||||
KEEPALIVED_NOTIFY: /osixia/keepalived/notify-example.sh
|
||||
KEEPALIVED_NOTIFY: /osixia/keepalived/notify.sh
|
||||
|
|
|
@ -16,16 +16,16 @@ NAME=$2
|
|||
STATE=$3
|
||||
|
||||
case $STATE in
|
||||
"MASTER") echo "I'm the MASTER! Whup whup." >> keepalived.info
|
||||
"MASTER") logger "I'm the MASTER! Whup whup."
|
||||
exit 0
|
||||
;;
|
||||
"BACKUP") "Ok, i'm just a backup, great." >> keepalived.info
|
||||
"BACKUP") logger "Ok, i'm just a backup, great."
|
||||
exit 0
|
||||
;;
|
||||
"FAULT") echo "Fault, what ?" >> keepalived.info
|
||||
"FAULT") logger "Fault, what ?"
|
||||
exit 0
|
||||
;;
|
||||
*) echo "Unknown state" >> keepalived.info
|
||||
*) logger "Unknown state"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
Loading…
Reference in New Issue