Last active
November 13, 2016 12:58
-
-
Save tnarik/33b524adc4e436b45201befce3582df6 to your computer and use it in GitHub Desktop.
Test setup with 3 cassandra nodes in a cluster and a client container
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
version: '2' | |
services: | |
cassandra-1: | |
image: cassandra:2 | |
environment: | |
- CASSANDRA_CLUSTER_NAME="demo_3nodes" | |
- CASSANDRA_BROADCAST_ADDRESS=cassandra-1 | |
ports: | |
- "9042:9042" | |
- "7000:7000" | |
cassandra-2: | |
image: cassandra:2 | |
depends_on: | |
- cassandra-1 | |
environment: | |
- CASSANDRA_CLUSTER_NAME="demo_3nodes" | |
- CASSANDRA_SEEDS=cassandra-1 | |
- CASSANDRA_BROADCAST_ADDRESS=cassandra-2 | |
ports: | |
- "9043:9042" | |
restart: always | |
cassandra-3: | |
image: cassandra:2 | |
depends_on: | |
- cassandra-1 | |
environment: | |
- CASSANDRA_CLUSTER_NAME="demo_3nodes" | |
- CASSANDRA_SEEDS=cassandra-1 | |
- CASSANDRA_BROADCAST_ADDRESS=cassandra-3 | |
ports: | |
- "9044:9042" | |
restart: always | |
cassandra_cqlsh: | |
image: cassandra:2 | |
environment: | |
- CASSANDRA_CLUSTER_NAME="demo_3nodes" | |
command: sh -c "cqlsh cassandra-1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First start the cassandra-1 node and once it the DB is running, start up cassandra-2 and cassandra-3 (relying only on the dependency with the official image makes the status somehow uncertain, and I needed this for testing a different component).
Then just create you keyspaces and tables, or let your component do so.