Illustration Image

Trouble Installing Cassandra DB on Ubuntu 22.04 – Service Fails to Start

I’m trying to install Apache Cassandra on Ubuntu 22.04, but the service fails to start after installation. Here’s what I did:

1. Installed Java (Cassandra requires Java, so I installed OpenJDK 11):

sudo apt update
sudo apt install openjdk-11-jdk -y
java -version

It returns:

openjdk version "11.0.22" 2024-01-16

2. Added the Apache Cassandra Repository and Installed Cassandra:

echo "deb http://downloads.apache.org/cassandra/debian 40x main" | sudo tee /etc/apt/sources.list.d/cassandra.list
wget -q -O - https://downloads.apache.org/cassandra/KEYS | sudo apt-key add -
sudo apt update
sudo apt install cassandra -y

3. Checked Service Status:

sudo systemctl status cassandra

But I get this error:

cassandra.service: Failed with result 'exit-code'.

4. Checked Logs Using Journalctl:

journalctl -xeu cassandra

I found this error in the logs:

ERROR [main] 2024-02-25 10:32:14,567 CassandraDaemon.java:777 - Cannot locate cassandra.yaml

Things I Tried:

  • Verified that /etc/cassandra/cassandra.yaml exists.
  • Tried running nodetool status, but it says Connection refused.
  • Checked if another service is using Cassandra’s default port 7000/7001/9042.

Has anyone encountered this issue before? How can I fix it and get Cassandra running?

Become part of our
growing community!
Welcome to Planet Cassandra, a community for Apache Cassandra®! We're a passionate and dedicated group of users, developers, and enthusiasts who are working together to make Cassandra the best it can be. Whether you're just getting started with Cassandra or you're an experienced user, there's a place for you in our community.
A dinosaur
Planet Cassandra is a service for the Apache Cassandra® user community to share with each other. From tutorials and guides, to discussions and updates, we're here to help you get the most out of Cassandra. Connect with us and become part of our growing community today.
© 2009-2023 The Apache Software Foundation under the terms of the Apache License 2.0. Apache, the Apache feather logo, Apache Cassandra, Cassandra, and the Cassandra logo, are either registered trademarks or trademarks of The Apache Software Foundation. Sponsored by Anant Corporation and Datastax, and Developed by Anant Corporation.

Get Involved with Planet Cassandra!

We believe that the power of the Planet Cassandra community lies in the contributions of its members. Do you have content, articles, videos, or use cases you want to share with the world?