Last active
October 3, 2024 16:06
-
-
Save mabitt/90b4978434024af14698174921ab81c3 to your computer and use it in GitHub Desktop.
RethinkDB on Docker Swarm
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
docker service rm rdb-primary rdb-secondary rdb-proxy | |
docker network rm rdb-net | |
sleep 5 | |
docker network create --driver overlay rdb-net | |
sleep 2 | |
docker service create \ | |
--name rdb-primary \ | |
--network rdb-net \ | |
--constraint=node.role==manager \ | |
--replicas 1 \ | |
rethinkdb:latest \ | |
rethinkdb --bind all --no-http-admin | |
sleep 5 | |
docker service create \ | |
--name rdb-secondary \ | |
--network rdb-net \ | |
--replicas 1 \ | |
rethinkdb:latest \ | |
rethinkdb --bind all --no-http-admin --join rdb-primary | |
sleep 5 | |
docker service scale rdb-secondary=2 | |
sleep 5 | |
docker service rm rdb-primary | |
sleep 2 | |
docker service create \ | |
--name rdb-primary \ | |
--network rdb-net \ | |
--replicas 1 \ | |
rethinkdb:latest \ | |
rethinkdb --bind all --no-http-admin --join rdb-secondary | |
docker service create \ | |
--name rdb-proxy \ | |
--constraint=node.role==manager \ | |
--network rdb-net \ | |
--publish 8080:8080 \ | |
--publish 28015:28015 \ | |
rethinkdb:latest \ | |
rethinkdb proxy --bind all --join rdb-primary |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment