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