Created
July 26, 2012 13:56
-
-
Save solso/3182170 to your computer and use it in GitHub Desktop.
Support material for blog post of redis replication
This file contains 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 | |
## --- tunnel_to_master_redis | |
REDIS_MASTER=XYZ | |
REDIS_SLAVE_PORT=6280 | |
AUTOSSH_POLL=300 | |
AUTOSSH_PORT=20000 | |
AUTOSSH_GATETIME=10 | |
AUTOSSH_LOGFILE=/var/log/autossh/autossh.log | |
AUTOSSH_PATH=/usr/bin/ssh | |
AUTOSSH_PIDFILE=/var/run/autossh/autossh.pid | |
export AUTOSSH_POLL AUTOSSH_LOGFILE AUTOSSH_PATH AUTOSSH_GATETIME AUTOSSH_PORT | |
autossh -2 -fN -M ${AUTOSSH_PORT} -C -L ${REDIS_SLAVE_PORT}:localhost:6379 ${REDIS_MASTER} |
This file contains 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
check process autossh with pidfile /var/run/autossh/autossh.pid | |
start_program = "/home/bender/bin/tunnel_to_master_redis" as uid bender |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment