Cassandra db running in Docker crash

Viewed 29

Every time I try to run Cassandra database in Docker it crash with some error message. It worked yesterday, but I guess something got corrupted, and I tried everything. Removing all volumes, containers, configurations... I tried every thing I can think of short of reinstalling Docker and reinstalling OS. I am using Ubuntu.

    at com.google.inject.Guice.createInjector(Guice.java:96)
    at com.google.inject.Guice.createInjector(Guice.java:73)
    at com.google.inject.Guice.createInjector(Guice.java:62)
    at com.datastax.bdp.ioc.DseInjector.get(DseInjector.java:36)
    at com.datastax.bdp.DseModule.main(DseModule.java:96)

ERROR [main] 2022-09-14 09:07:13,143  DseModule.java:102 - {}. Exiting...
com.google.inject.CreationException: Unable to create injector, see the following errors:

1) 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)

1 error
    at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:466)
    at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:155)
    at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
    at com.google.inject.Guice.createInjector(Guice.java:96)
    at com.google.inject.Guice.createInjector(Guice.java:73)
    at com.google.inject.Guice.createInjector(Guice.java:62)
    at com.datastax.bdp.ioc.DseInjector.get(DseInjector.java:36)
    at com.datastax.bdp.DseModule.main(DseModule.java:96)
Caused by: org.apache.cassandra.exceptions.ConfigurationException: 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 org.apache.cassandra.config.DatabaseDescriptor.resolveAndCheckDirectory(DatabaseDescriptor.java:1033)
    at org.apache.cassandra.config.DatabaseDescriptor.applySimpleConfig(DatabaseDescriptor.java:429)
    at org.apache.cassandra.config.DatabaseDescriptor.applyAll(DatabaseDescriptor.java:293)
    at org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:127)
    at com.datastax.bdp.DseCoreModule.(DseCoreModule.java:82)
    at com.datastax.bdp.DseModule.getRequiredModules(DseModule.java:150)
    at com.datastax.bdp.server.AbstractDseModule.configure(AbstractDseModule.java:27)
    at com.datastax.bdp.DseModule.configure(DseModule.java:82)
    at com.google.inject.AbstractModule.configure(AbstractModule.java:62)
    at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340)
    at com.google.inject.spi.Elements.getElements(Elements.java:110)
    at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:138)
    at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104)
    ... 5 common frames omitted

If anyone have any suggestion I would really appreciate any idea.

1 Answers

From the error log outputs, I think your Docker container doesn't have permission to write to the /var/lib/cassandra/commitlog directory.

If my guess is true, your mounted volume is using a filesystem that requires root user permissions to write. If so, you can try to change your mounted volume to a directory that only requires non-root permission, such as /home/your_user/.

Related