Run a DSE Docker container
Docker is defined as a platform to help developers build, share, and run modern applications. Docker allows a developer to run images that are composed of software they wish to experiment with and try out. A Docker image is a read-only immutable template that defines how a container is instantiated. Then, a container, which is a runtime instance of a Docker image, is created to run on the local machine.
DataStax maintains images for many licensed products and open-source software on Docker Hub, IBM® Fix Central, or IBM® Cloud Container Registry (ICR). This guide focuses on the images for DSE and related software:
-
DSE server Docker image: A single DSE node, with or without advanced workloads. Can be scaled to deploy multiple nodes using
docker compose.Cassandra File System (CFS) isn’t supported in containers.
-
DataStax Studio Docker image: An interactive developer tool for sending Cassandra Query Language (CQL), DSE Graph, and Gremlin Query Language queries in notebook format.
-
DSE OpsCenter Docker image: A web-based visual management and monitoring solution for DSE.
Lifecycle Manager (LCM) isn’t supported in containers.
These images can be used in development (non-production) or production environments.
This guide assumes you are familiar with Docker images, containers, and compose scripts.
Prepare infrastructure
-
Install Docker Engine:
-
Adjust hardware resources and system settings to support the containers that you want to run, as explained in Recommended settings for DataStax Enterprise (DSE) Docker containers.
Start a DSE server container
-
Download a DSE server container image from Docker Hub or use the
docker pullcommand:docker pull datastax/dse-server:DSE_VERSION -
Start the container with the default configuration:
docker run -e DS_LICENSE=accept --name my-dse \ -d datastax/dse-server:DSE_VERSIONBy default, a
dse-servercontainer is one transactional (database) node without advanced workloads.
For a list of required arguments and common options for DataStax containers, see Options for docker run and docker compose.
Enable advanced workloads
To start a dse-server container with DSE Search, Graph, or Analytics enabled, pass the -s, -g, or -k options when you start the container:
-
-s: Start the container with DSE Search enabled:docker run -e DS_LICENSE=accept --name my-dse \ -d datastax/dse-server:DSE_VERSION -s -
-g: Start the container with DSE Graph enabled:docker run -e DS_LICENSE=accept --name my-dse -d datastax/dse-server:DSE_VERSION -g -
-k: Start the container with DSE Analytics enabled:docker run -e DS_LICENSE=accept --name my-dse \ -d datastax/dse-server:DSE_VERSION -k -
Multiple options: Enable multiple types of advanced workloads:
docker run -e DS_LICENSE=accept --name my-dse -d datastax/dse-server:DSE_VERSION -g -k -s
Attach to a container
Use the docker exec -it container_name command to attach to a container and run DSE tools and other operations.
- Open an interactive BASH shell
-
If the container is running in the background (started with the
-doption), use the following command to open an interactive BASH shell:docker exec -it container_name bashTo exit the shell without stopping the container, type
exit, and then press Return. - Open an interactive CQL shell
-
Use the following command to open the CQL shell (
cqlsh) prompt.docker exec -it container_name cqlshTo exit the shell without stopping the container, press Ctrl + P + Q.
- View logs
-
View DSE logs using the
docker logscommand:docker logs my-dse - Use DSE tools
-
Use the
docker execcommand to run other DSE tools. For example:docker exec -it my-dse nodetool status