In this quick start we will setup a single node cluster using Docker. Setup requires 3 steps:
dynomitedb_net
networkbackend-redis
containerdynomite
containerDynomiteDB automatically configures the dynomite
and backend-redis
containers to run as a single server cluster.
You must install Docker before running the commands below.
Mac and Windows users should follow the Docker installation instructions on Docker.com.
Ubuntu 14.04 users may install Docker using the Install Docker on Ubuntu 14.04 instructions.
Create a bridge network named dynomitedb_net
. The dynomite
server and the Redis backend (backend-redis
) will communicate over this network.
docker network create -d bridge --subnet=192.168.6.0/24 --gateway=192.168.6.1 dynomitedb_net
dynomite-backend-redis
and dynomite
containers.Run the backend-redis
container.
docker run --name backend-redis -h redis.dynomitedb.net --ip=192.168.6.20 --net=dynomitedb_net --add-host dynomite.dynomitedb.net:192.168.6.10 -d dynomitedb/backend-redis
Run the dynomite
container.
docker run --name dynomite -h dynomite.dynomitedb.net --ip=192.168.6.10 --net=dynomitedb_net --add-host redis.dynomitedb.net:192.168.6.20 -d dynomitedb/dynomite
docker run -it --rm --ip=192.168.6.30 --net=dynomitedb_net --add-host dynomite.dynomitedb.net:192.168.6.10 --add-host redis.dynomitedb.net:192.168.6.20 redis:2.8.23 bash
Test network connectivity from the tools container to the Dynomite container.
ping -c 3 dynomite.dynomitedb.net
Test network connectivity from the tools container to the Redis container.
ping -c 3 redis.dynomitedb.net
Connect directly to the Redis container to ensure that Redis is working properly.
redis-cli -h redis.dynomitedb.net -p 6379
Enter the following commands at the redis-cli
prompt. Expected output is shown below each command.
redis.dynomitedb.net:6379> set fname "Bob"
OK
redis.dynomitedb.net:6379> set lname "Smith"
OK
redis.dynomitedb.net:6379> get fname
"Bob"
redis.dynomitedb.net:6379> get lname
"Smith"
redis.dynomitedb.net:6379> quit
Next, connect to the Dynomite container.
redis-cli -h dynomite.dynomitedb.net -p 8102
Enter the following commands at the redis-cli
prompt. Expected output is shown below each command.
Each of the commands below are sent from the redis-cli
client to the dynomite
server which then forwards the request to the redis-server
backend.
dynomite.dynomitedb.net:8102> get fname
"Bob"
dynomite.dynomitedb.net:8102> get lname
"Smith"
dynomite.dynomitedb.net:8102> set fname "Bill"
OK
dynomite.dynomitedb.net:8102> get fname
"Bill"
dynomite.dynomitedb.net:8102> quit
Exit the tools container.
exit
Stop the dynomite
and backend-redis
containers.
docker stop $(docker ps -aq)