Created
April 13, 2018 21:55
-
-
Save selcukusta/754ce8e1cdbf5221ea3281bf505ae68d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| tee /etc/redis/sentinel.conf <<EOF | |
| port 26379 | |
| daemonize yes | |
| logfile "/var/log/sentinel.log" | |
| pidfile "var/run/sentinel.pid" | |
| dir "/var/lib/redis/sentinel" | |
| sentinel monitor docker-cluster $MASTER_HOST 6379 $SENTINEL_QUORUM | |
| sentinel down-after-milliseconds docker-cluster $SENTINEL_DOWN_AFTER | |
| sentinel parallel-syncs docker-cluster 1 | |
| sentinel failover-timeout docker-cluster $SENTINEL_FAILOVER | |
| EOF | |
| redis-sentinel /etc/redis/sentinel.conf | |
| if [ "$IS_SLAVE" == true ]; then | |
| redis-server --slaveof $MASTER_HOST 6379 | |
| else | |
| redis-server | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment