Using Docker compose for automated provisioning

You can deploy multiple Docker containers using a script.

Use Docker Compose to automate bootstrapping a multi-node cluster with DataStax Enterprise (DSE), DSE OpsCenter, and DataStax Studio. Use the following links to get sample compose.yml files for different tools and services:

Example

Three node configuration

When creating multiple nodes, use the node parameter to bootstrap one node at a time. For example, the first node is node0, the second node is node1, and the third node is node2.

Wait for each node to finish bootstrapping before running docker-compose for the next node.

# Make sure node1, the seed node, is up before bringing up other nodes
docker compose -f docker-compose.yml up -d --scale node0
# Wait until the seed node is up before bringing up more nodes
(docker compose logs -f node1 &) | grep -q "Created default superuser role"
docker compose -f docker-compose.yml up -d --scale node1
(docker compose logs -f node1 &) | grep -q "Created default superuser role"
docker compose -f docker-compose.yml up -d --scale node2

Three node configuration with OpsCenter

docker compose -f docker-compose.yml -f docker-compose.opscenter.yml \
up -d --scale node0
# Make sure node1, the seed node, is up before bringing up other nodes
(docker compose logs -f node0 &) | grep -q "Created default superuser role"
docker compose -f docker-compose.yml up -d --scale node1
(docker compose logs -f node1 &) | grep -q "Created default superuser role"
docker compose -f docker-compose.yml up -d --scale node2

Three node configuration with OpsCenter and Studio

docker compose -f docker-compose.yml -f docker-compose.opscenter.yml \
-f docker-compose.studio.yml up -d --scale node0
# Make sure node1, the seed node, is up before bringing up other nodes
(docker compose logs -f node0 &) | grep -q "Created default superuser role"
docker compose -f docker-compose.yml up -d --scale node1
(docker compose logs -f node1 &) | grep -q "Created default superuser role"
docker compose -f docker-compose.yml up -d --scale node2

Single node configuration with Studio

docker compose -f docker-compose.yml -f docker-compose.studio.yml \
up -d --scale node0

Single node configuration

To bootstrap a single-node cluster, use the docker run command and specify the version of DSE to install, plus any additional options.

docker run -e DS_LICENSE=accept -d cr.dtsx.io/datastax/dse-server:version \
options

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com