Persisting data with volumes and directories
Persisting data allows the container to be deleted and recreated without losing data. DataStax exposes the following volumes so that underlying data directories can be mounted. If these volumes are not mounted, then sub-directories will be unavailable. If they are mounted, then the data written within the container can be preserved in a local directory.
It is recommended that you familiarize yourself with the concept of using volumes with Docker.
If the volumes are not mounted from the local host, all data is lost when the container is removed. |
To persist data in general, create the directories on the local host, and then map the local directory to the corresponding volume using the docker run -v
flag:
docker run -v local_directory:container_volume
For DSE specifically, mount the /var/lib/cassandra
(DSE data volume) to the /dse/data
directory on the Docker host to ensure that the /data
, /commit_logs
, and /saved_caches
directories will be available.
docker run -e DS_LICENSE=accept --name my-dse -v /dse/data:/var/lib/cassandra
Hosting the /var/lib/cassandra
directory outside the container with the -v
option allows the Docker container to be deleted and recreated without losing data.
The following sections list the exposed volumes.
DataStax Enterprise (DSE) (DSE)
Directory | Description |
---|---|
|
Database data |
|
DSE Analytics with Spark data |
|
DSEFS data |
|
Database logs |
|
Spark logs |
|
Custom configuration files |
Studio
Directory | Description |
---|---|
|
DataStax Studio data |