Simple Docker Image for Dynomite. Dynomite-docker provides utilities to create clusters(3 node cluster), get seeds, test cluster health and replication via DCC.
- Download and instal Java 8 -> http://www.oracle.com/technetwork/java/javase/downloads/index.html
- Download and install Docker. -> https://docs.docker.com/engine/installation/
- Bake docker images $ ./dynomite-docker.sh bake
- Create the Dynomite clusters $ ./dynomite-docker.sh run_single 0.5.8
- Install docker -> https://docs.docker.com/docker-for-mac/install/
- (just 1 time) Bake docker images $ sudo ./dynomite-docker-mac.sh bake
- Create the Dynomite clusters $ sudo ./dynomite-docker-mac.sh run_single 0.5.8
- Download and instal Virtual Box 5 -> https://www.virtualbox.org/wiki/Downloads
- Download and install Vagrant -> https://www.vagrantup.com/downloads.html
- vagrant up
- vagrant ssh
- Create the Dynomite clusters $ cd dynomite-docker/ && sudo ./dynomite-docker.sh run_single 0.5.8
You can dump from ypou production cluster and import it with redis-cli and redis-dump.
More information here: https://gist.github.com/diegopacheco/6c1862553a8b35a2680f914a2e08accc
- 0.5.7-14
- 0.5.8-5
- 0.5.9-2
- 0.6.0
$ ./dynomite-docker.sh help
dynomite-docker: easy setup for dynomite clusters for development. Created by: Diego Pacheco.
functions:
bake : Bakes docker image
run : Run Dynomite docker 2 clusters for dual write
run_single : Run Dynomite docker Single cluster
run_shard : Run Dynomite docker Shard cluster
dcc : Run Dynomite Cluster Checker for 2 clusters
dcc_single : Run Dynomite Cluster Checker for single cluster
dcc_shard : Run Dynomite Cluster Checker for shard cluster
info : Get Seeds, IPs and topologies(all 3 possible clusters)
log : Print dynomite logs, you need pass the node number. i.e: ./dynomite-docker log 1
cli : Enters redis-cli on dynomite port. i.e: ./dynomite-docker cli 1
keys_single : Runs KEYS * command in all nodes(Single Cluster)
keys_shard : Runs KEYS * command in all nodes(Shard Cluster)
stop : Stop and clean up all docker running images
help : help documentation
- We bake a docker image with Dynomiete v0.5.X and Redis 3.x.
- We create 2 clusters - each cluster has 3 nodes.
- In the end of the script(./dynomite-docker.sh run DYNOMITE_VERSION) you will see all seeds(We also run Dynomite Cluster Checker)
- You just need run ./dynomite-docker.sh bake 1 time.
- You can run ./dynomite-docker.sh run as many times as you want. First thing on the script we delete old docker images and old docker network - so we create new docker images and network every time you run the script create-dynomite-docker-cluster.sh.
Cluster 1A
179.18.0.101:8101:rack1:dc:100|179.18.0.102:8101:rack2:dc:100|179.18.0.103:8101:rack3:dc:100
Cluster 1B
179.18.0.201:8101:rack1:dc:100|179.18.0.202:8101:rack2:dc:100|179.18.0.203:8101:rack3:dc:100
Cluster 2 - Single
179.18.0.101:8101:rack1:dc:100|179.18.0.102:8101:rack2:dc:100|179.18.0.103:8101:rack3:dc:100
Cluster 3 - Shard
179.18.0.101:8102:rack1:dc:1383429731|179.18.0.102:8102:rack2:dc:1383429731|179.18.0.103:8102:rack3:dc:1383429731|179.18.0.104:8102:rack1:dc:2815085496|179.18.0.105:8102:rack2:dc:2815085496|179.18.0.106:8102:rack3:dc:2815085496
Cluster 1(1A and 1B): This cluster is create by command run - This is ideal for Dual write tests.
Cluster 2(Single) : This cluster is create by command run_single - This is ideal dev tests.
Cluster 3(Shard) : This cluster is create by command run_shard - This is ideal dev sharding keys tests.
Cluster 1A
node: 1 - ip: 179.18.0.101 - Tokens: 100 - Rack: rack1 - DC: dc
node: 2 - ip: 179.18.0.102 - Tokens: 100 - Rack: rack2 - DC: dc
node: 3 - ip: 179.18.0.103 - Tokens: 100 - Rack: rack3 - DC: dc
Cluster 1B
node: 1 - ip: 179.18.0.201 - Tokens: 100 - Rack: rack1 - DC: dc
node: 2 - ip: 179.18.0.202 - Tokens: 100 - Rack: rack2 - DC: dc
node: 3 - ip: 179.18.0.203 - Tokens: 100 - Rack: rack3 - DC: dc
Cluster 2 - Single
node: 1 - ip: 179.18.0.101 - Tokens: 100 - Rack: rack1 - DC: dc
node: 2 - ip: 179.18.0.102 - Tokens: 100 - Rack: rack2 - DC: dc
node: 3 - ip: 179.18.0.103 - Tokens: 100 - Rack: rack3 - DC: dc
Cluster 3 - Shard
node: 1 - ip: 179.18.0.101 - Tokens: 1383429731 - Rack: rack1 - DC: dc
node: 2 - ip: 179.18.0.102 - Tokens: 1383429731 - Rack: rack2 - DC: dc
node: 3 - ip: 179.18.0.103 - Tokens: 1383429731 - Rack: rack3 - DC: dc
node: 4 - ip: 179.18.0.104 - Tokens: 2815085496 - Rack: rack1 - DC: dc
node: 5 - ip: 179.18.0.105 - Tokens: 2815085496 - Rack: rack2 - DC: dc
node: 6 - ip: 179.18.0.106 - Tokens: 2815085496 - Rack: rack3 - DC: dc
This scritps will run DCC(https://github.com/diegopacheco/dynomite-cluster-checker). You should see something like this.
**** BEGIN DYNOMITE CLUSTER CHECKER ****
1. Checking cluster connection...
OK - All nodes are accessible!
2. Checking cluster data replication...
SEEDS: [179.18.0.101:8101:rack1:dc:100, 179.18.0.102:8101:rack2:dc:100, 179.18.0.103:8101:rack3:dc:100]
Checking Node: 179.18.0.101
TIME to Insert DCC_dynomite_123_kt - Value: DCC_replication_works: 6.0 ms - 0 s
TIME to Get: DCC_dynomite_123_kt : 4.0 ms - 0 s
200 OK - set/get working fine!
Checking Node: 179.18.0.102
TIME to Get: DCC_dynomite_123_kt : 3.0 ms - 0 s
200 OK - set/get working fine!
Checking Node: 179.18.0.103
TIME to Get: DCC_dynomite_123_kt : 3.0 ms - 0 s
200 OK - set/get working fine!
3. Checking cluster failover...
All Seeds Cluster Failover test: OK
4. Results as JSON...
{
"timeToRun": "3 seconds",
"failoverStatus": "OK",
"badNodes": [],
"nodesReport":
[
{
"server":"179.18.0.101",
"seeds":"[179.18.0.101:8101:rack1:dc:100, 179.18.0.102:8101:rack2:dc:100, 179.18.0.103:8101:rack3:dc:100]",
"insertTime":"6.0 ms",
"getTime":"4.0 ms",
"consistency":"true"
},
{
"server":"179.18.0.102",
"getTime":"3.0 ms",
"consistency":"true"
},
{
"server":"179.18.0.103",
"getTime":"3.0 ms",
"consistency":"true"
}
]
}
**** END DYNOMITE CLUSTER CHECKER ****
**** BEGIN DYNOMITE CLUSTER CHECKER ****
1. Checking cluster connection...
OK - All nodes are accessible!
2. Checking cluster data replication...
SEEDS: [179.18.0.201:8101:rack1:dc:100, 179.18.0.202:8101:rack2:dc:100, 179.18.0.203:8101:rack3:dc:100]
Checking Node: 179.18.0.201
TIME to Insert DCC_dynomite_123_kt - Value: DCC_replication_works: 5.0 ms - 0 s
TIME to Get: DCC_dynomite_123_kt : 2.0 ms - 0 s
200 OK - set/get working fine!
Checking Node: 179.18.0.202
TIME to Get: DCC_dynomite_123_kt : 2.0 ms - 0 s
200 OK - set/get working fine!
Checking Node: 179.18.0.203
TIME to Get: DCC_dynomite_123_kt : 2.0 ms - 0 s
200 OK - set/get working fine!
3. Checking cluster failover...
All Seeds Cluster Failover test: OK
4. Results as JSON...
{
"timeToRun": "2 seconds",
"failoverStatus": "OK",
"badNodes": [],
"nodesReport":
[
{
"server":"179.18.0.201",
"seeds":"[179.18.0.201:8101:rack1:dc:100, 179.18.0.202:8101:rack2:dc:100, 179.18.0.203:8101:rack3:dc:100]",
"insertTime":"5.0 ms",
"getTime":"2.0 ms",
"consistency":"true" },
{
"server":"179.18.0.202",
"getTime":"2.0 ms",
"consistency":"true"
},
{
"server":"179.18.0.203",
"getTime":"2.0 ms",
"consistency":"true"
}
]
}
**** END DYNOMITE CLUSTER CHECKER ****
- cassandra-docker -> https://github.com/diegopacheco/cassandra-docker
- dynomite-dooker-rocksdb -> https://github.com/diegopacheco/dynomite-docker-rocksdb