For my purposes, I only want one instance of redis running and one redis sentinel. I'm running Redis 3.0.6. My sentinel.conf
is all defaults except quorum is 1 and the notification script line is uncommented: sentinel notificication-script mymaster /etc/redis/notify_me.sh
. Inside notify_me.sh
I execute a python script that for testing purposes just says print "HEY SOMETHING IS UP WITH REDIS"
.
I want to use redis sentinel for monitoring purposes only. Later, I will write something in the python script that will email/text me when redis goes down. However, as it is right now, it is firing off way too often. I only want to receive the message one time when sentinel as determined that redis has died. Right now when I start it off, the statement is printed out once at the beginning, and then several more times after failover-state-select-slave
23863:X 06 Jan 15:26:18.422 # Sentinel runid is db267af1b9257ced70eee9cbd076291db31f9335
23863:X 06 Jan 15:26:18.422 # +monitor master mymaster 127.0.0.1 6380 quorum 1
HEY SOMETHING IS UP WITH REDIS
23863:X 06 Jan 15:27:07.602 # +sdown master mymaster 127.0.0.1 6380
23863:X 06 Jan 15:27:07.602 # +odown master mymaster 127.0.0.1 6380 #quorum 1/1
23863:X 06 Jan 15:27:07.602 # +new-epoch 1
23863:X 06 Jan 15:27:07.602 # +try-failover master mymaster 127.0.0.1 6380
23863:X 06 Jan 15:27:07.604 # +vote-for-leader db267af1b9257ced70eee9cbd076291db31f9335 1
23863:X 06 Jan 15:27:07.604 # +elected-leader master mymaster 127.0.0.1 6380
23863:X 06 Jan 15:27:07.604 # +failover-state-select-slave master mymaster 127.0.0.1 6380
HEY SOMETHING IS UP WITH REDIS
HEY SOMETHING IS UP WITH REDIS
HEY SOMETHING IS UP WITH REDIS
HEY SOMETHING IS UP WITH REDIS
HEY SOMETHING IS UP WITH REDIS
HEY SOMETHING IS UP WITH REDIS
HEY SOMETHING IS UP WITH REDIS
23863:X 06 Jan 15:27:07.682 # -failover-abort-no-good-slave master mymaster 127.0.0.1 6380
I don't want it to print at the beginning and I only want it to print once when the server dies, so that I only get one email/text later. Anyone, got any tips on what I can do? Thanks!