Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

pramod.dba31_92912 avatar image
pramod.dba31_92912 asked ·

Bind mount for docker dse 5.1.17 failing

I am getting error

An exception was caught and reported. Message: commitlog directory '/var/lib/cassandra/commitlog' or, if it does not already exist, an existing parent directory of it, is not readable and writable for the DSE. Check file system and configuration.  at com.datastax.bdp.DseModule.configure(Unknown Source)"

when I tried to give the command with "-v /var/lib/container/dse-node-01:/var/lib/cassandra" From the documentation https://docs.datastax.com/en/docker/doc/docker/docker60/dockerDataVolumes.html it says if I mount /var/lib/cassandra to a location it should create all commitlog, data, savedcaches directories.

Similar question raised in SOF https://stackoverflow.com/questions/56648309/unable-to-volume-mount-in-datastax-enterprise-server-container

Please help if I am doing any thing wrong here.

dsedocker
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

@brasco --Donnie Roberson-- avatar image
@brasco --Donnie Roberson-- answered ·

Hmm That is interesting. If I set the permissions to anything other than 777 I get the same issue you have.

When setting the permissions to 777 , I don't have that issue in my tests with DSE 5.1.17. Here were my steps.


Make the Directories

mkdir -p /var/lib/container/dse-node-01

recursively grant rwx permissions on directories

chmod -R 777 /var/lib/container

Directories have 777 permission

find /var/lib/container  -maxdepth 2 -type d -printf '%M %u %g %p\n'
drwxrwxrwx root root /var/lib/container
drwxrwxrwx root root /var/lib/container/dse-node-01

Start the container

docker run -e DS_LICENSE=accept -v /var/lib/container/dse-node-01:/var/lib/cassandra --name my-dse -d datastax/dse-server:5.1.17

Directories are created by docker and notice the user and group

find /var/lib/container  -maxdepth 2 -type d -printf '%M %u %g %p\n'
drwxrwxrwx root root /var/lib/container
drwxrwxrwx root root /var/lib/container/dse-node-01
drwxrwxrwx 999 docker /var/lib/container/dse-node-01/hints
drwxrwxrwx 999 docker /var/lib/container/dse-node-01/data
drwxrwxrwx 999 docker /var/lib/container/dse-node-01/saved_caches
drwxrwxrwx 999 docker /var/lib/container/dse-node-01/commitlog


DSE is up and running version 5.1.17


docker exec -it my-dse dse -v
5.1.17
docker exec -it my-dse nodetool status
Datacenter: dc1
===============
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address     Load       Owns (effective)  Host ID                               Token                                    Rack
UN  172.17.0.2  161.26 KiB  100.0%            58eda10f-9d1b-4545-942a-f4a7eb9bd5b3  -6252243682769890604                     rack1


3 comments Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Hi @pramod.dba31_92912 for your local directory

 /var/lib/container/dse-node-01

You will need to change the permissions to 777.

 chmod -R 777 /var/lib/container/

Please let us know if that works for you

0 Likes 0 · ·
pramod.dba31_92912 avatar image pramod.dba31_92912 @brasco --Donnie Roberson-- ·

I tried giving permissions to folder 777 and also tried making it owned by dse and also added dse user to docker. But no luck.

I tried in similar fashion by creating cassandra user also. But still the same issue.

0 Likes 0 · ·

Thanks, I will check back. May be I did a mistake or messed up while playing around.

0 Likes 0 · ·