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?