0

I have been tried ran a Ansible Playboo, but after change the cassandra.yml when the service tries start I received this error bellow:

● cassandra.service - LSB: distributed storage system for structured data
   Loaded: loaded (/etc/rc.d/init.d/cassandra; bad; vendor preset: disabled)
   Active: failed (Result: exit-code) since sex 2021-04-02 01:06:05 UTC; 15min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 5052 ExecStop=/etc/rc.d/init.d/cassandra stop (code=exited, status=1/FAILURE)
  Process: 4883 ExecStart=/etc/rc.d/init.d/cassandra start (code=exited, status=0/SUCCESS)
 Main PID: 4972 (code=exited, status=3)

abr 02 01:05:37 ip-10-5-10-195.ec2.internal cassandra[4883]: Starting Cassandra: OK
abr 02 01:05:37 ip-10-5-10-195.ec2.internal systemd[1]: Started LSB: distributed storage system for structured data.
abr 02 01:05:40 ip-10-5-10-195.ec2.internal systemd[1]: cassandra.service: main process exited, code=exited, status=3/NOTIMPLEMENTED
abr 02 01:05:40 ip-10-5-10-195.ec2.internal runuser[5063]: pam_unix(runuser:session): session opened for user cassandra by (uid=0)
abr 02 01:05:40 ip-10-5-10-195.ec2.internal cassandra[5052]: Shutdown Cassandra: kill: sending signal to 4972 failed: No such process
abr 02 01:05:40 ip-10-5-10-195.ec2.internal runuser[5063]: pam_unix(runuser:session): session closed for user cassandra
abr 02 01:06:05 ip-10-5-10-195.ec2.internal cassandra[5052]: ERROR: could not stop cassandra
abr 02 01:06:05 ip-10-5-10-195.ec2.internal systemd[1]: cassandra.service: control process exited, code=exited status=1
abr 02 01:06:05 ip-10-5-10-195.ec2.internal systemd[1]: Unit cassandra.service entered failed state.
abr 02 01:06:05 ip-10-5-10-195.ec2.internal systemd[1]: cassandra.service failed.

In my cassandra.yml I just change the mount point/path where Cassandra stores the data and sure that this works.

Looking at Cassandra system.log I found:

ERROR [main] 2021-04-05 16:57:34,074 CassandraDaemon.java:822 - Exception encountered during startup
java.lang.ExceptionInInitializerError: null
    at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:240)
    at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:676)
    at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:800)
Caused by: java.lang.IllegalStateException: Failed to mkdirs /hints; unable to start server
    at org.apache.cassandra.config.DatabaseDescriptor.createAllDirectories(DatabaseDescriptor.java:1395)
    at org.apache.cassandra.db.commitlog.CommitLog.<init>(CommitLog.java:95)
    at org.apache.cassandra.db.commitlog.CommitLog.construct(CommitLog.java:78)
    at org.apache.cassandra.db.commitlog.CommitLog.<clinit>(CommitLog.java:65)
    ... 3 common frames omitted

It's weird because I create the directory at new mount point with cassandra:cassandra permitions:

drwxr-xr-x  2 cassandra cassandra   6 abr  5 14:46 commitlog
drwxr-xr-x  2 cassandra cassandra   6 abr  5 14:46 data
drwxr-xr-x  2 cassandra cassandra   6 abr  5 16:53 hints
drwxr-xr-x  2 cassandra cassandra   6 abr  5 16:53 saved_caches

I have been spend long hours trying solve but without success, someone my can help me?

0

I found my fault. It's necessary define a cassandra.service to Systemd manages Cassandra:

path: /etc/systemd/system/cassandra.service

And adjust like you installation

[Unit]
Description=Cassandra Cluster Node Daemon

[Service]
Type=forking
User=cassandra
ExecStartPre=/usr/bin/echo "Starting Cassandra Daemon"
ExecStart=/usr/sbin/cassandra
ExecStartPost=/usr/bin/echo "Cassandra Daemon Running"

ExecStopPost=/usr/bin/rm -rf /cassandra/saved_caches;/usr/bin/echo "Cassandra Daemon Stopped"

SuccessExitStatus=143

[Install]
WantedBy=default.target

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.