Last active
August 29, 2015 14:06
-
-
Save sheldonh/6bcfb70e98899be7bd69 to your computer and use it in GitHub Desktop.
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
[Unit] | |
Description=Redis cluster 1 instance 2 | |
After=docker.service | |
Requires=docker.service | |
After=redis-1-2-amb-1.service | |
Requires=redis-1-2-amb-1.service | |
After=redis-1-2-amb-2.service | |
Requires=redis-1-2-amb-2.service | |
After=redis-1-2-amb-3.service | |
Requires=redis-1-2-amb-3.service | |
[Service] | |
Environment=UNIT=redis-1-2 | |
TimeoutStartSec=0 | |
ExecStartPre=-/usr/bin/mkdir -p /srv/volumes/${UNIT} | |
ExecStartPre=-/usr/bin/chown 999 /srv/volumes/${UNIT} | |
ExecStartPre=-/usr/bin/docker kill ${UNIT} | |
ExecStartPre=-/usr/bin/docker rm ${UNIT} | |
ExecStart=/usr/bin/docker run --name ${UNIT} -e SERVICE_NAME=${UNIT} --link=${UNIT}-amb-1:redis_1_1 --link=${UNIT}-amb-2:redis_1_2 --link=${UNIT}-amb-3:redis_1_3 -P -v /srv/volumes/${UNIT}:/data redis /bin/bash -c '[ -e /data/redis.conf ] || echo slaveof $${REDIS_1_1_PORT_10000_TCP_ADDR} $${REDIS_1_1_PORT_10000_TCP_PORT} > /data/redis.conf; exec redis-server /data/redis.conf' | |
ExecStop=/usr/bin/docker stop ${UNIT} | |
[X-Fleet] | |
# Machine: core-02 | |
X-ConditionMachineID=ddb48170 | |
X-Conflicts=redis-1-?.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment