[2014-09-16] Update: The command now brings up a 5-node Cassandra cluster in addition to DataStax OpsCenter 5.0.0 and wires it all up together. See the GitHub repo for details. Each node runs in its own container with the Cassandra process + DataStax Agent while OpsCenter runs in its own container separate from the cluster.
[Original Post]
Run this command to bring up a 5-node Cassandra (2.1.0) cluster locally using Docker.
1
|
|
This will:
1. Pull the abh1nav/cassandra:latest
image.
2. Start the first node with the name cass1
3. Start cass2..5
with the environment variable SEED=<ip of cass1>
Manual mode
If you don’t like or trust the one liner, here’s how to do it manually.
Single Node Setup
To start the first node, pull the latest version of image:
1
|
|
Start the first instance:
1
|
|
Grab its IP using:
1
|
|
Connect to it using cqlsh:
1
|
|
The expected output is:
1 2 3 4 5 6 |
|
Cluster Setup
Once your single node is setup, you can add more nodes using:
1 2 3 4 5 |
|
You can watch the cluster form by tailing the logs on cass1
:
1
|
|
Once the cluster is up, you can check its status using:
1
|
|
The expected output is:
1 2 3 4 5 6 7 8 9 10 11 12 |
|
Check out the Docker registry page for the image and the GitHub repo to grab the source.