Skip to Content

Cassandra error Unit cassandra.service entered failed state

We get this error when we start our Cassandra recently. New main PID x does not belong to service, and PID file is not owned by root. Refusing. After checking, we found that it is a bug for cassandra startup file.

Error Log for Unit Cassandra.service entered failed state

systemctl status cassandra
cassandra.service – LSB: distributed storage system for
Aug 09 17:20:26 desktop43.example.com cassandra[2463]: Starting Cassandra: OK
Aug 09 17:20:26 desktop43.example.com systemd[1]: New main PID 2545 does not belong to service, and PID file is not owned by root. Refusing.
Aug 09 17:20:26 desktop43.example.com systemd[1]: New main PID 2545 does not belong to service, and PID file is not owned by root. Refusing.
Aug 09 17:20:26 desktop43.example.com systemd[1]: Failed to start LSB: distributed storage system for structured data.
Aug 09 17:20:26 desktop43.example.com systemd[1]: Unit cassandra.service entered failed state.
Aug 09 17:20:26 desktop43.example.com systemd[1]: cassandra.service failed.

Get Your Free Linux training!

Join our free Linux training and discover the power of open-source technology. Enhance your skills and boost your career! Learn Linux for Free!

Fix Unit Cassandra.service entered failed state

The fix for systemd CVE-2018-16888 required changes to init scripts, so that PID files end up owned by the “root” user. Here is the fix for this issue.

https://issues.apache.org/jira/browse/CASSANDRA-15273

After this file /etc/rc.d/init.d/cassandra is changed, the issue is gone.