Rafee
Rafee

Reputation: 4078

cassandra service (3.11.5) stops automaticall after it starts/restart on AWS linux

cassandra service (3.11.5) stops automatically after it starts/restart on AWS linux.

I have fresh installation of cassandra on new instance of AWS linux (t3.xlarge) and

sudo service cassandra start
or
sudo service cassandra restart

after 1 or 2 seconds, the service stop automatically. I looked into logs and I found these. I am not sure, I havent change configs related to snitch and its always SimpleSnitch. I dont have any multiple cassandras. Just only on single EC2.

Logs

INFO  [main] 2020-02-12 17:40:50,833 ColumnFamilyStore.java:426 - Initializing system.schema_aggregates
INFO  [main] 2020-02-12 17:40:50,836 ViewManager.java:137 - Not submitting build tasks for views in keyspace system as storage service is not initialized
INFO  [main] 2020-02-12 17:40:51,094 ApproximateTime.java:44 - Scheduling approximate time-check task with a precision of 10 milliseconds
ERROR [main] 2020-02-12 17:40:51,137 CassandraDaemon.java:759 - Cannot start node if snitch's data center (datacenter1) differs from previous data center (dc1). Please fix the snitch configuration, decommission and rebootstrap this node or use the flag -Dcassandra.ignore_dc=true.

Installation steps

sudo curl -OL https://www.apache.org/dist/cassandra/redhat/311x/cassandra-3.11.5-1.noarch.rpm

sudo rpm -i cassandra-3.11.5-1.noarch.rpm
sudo pip install cassandra-driver
export CQLSH_NO_BUNDLED=true
sudo chkconfig --levels 3 cassandra on

Upvotes: 1

Views: 814

Answers (2)

Mohammad Hosein
Mohammad Hosein

Reputation: 38

I had the same problem , where cassandra service immediately stops after it was started.

in the cassandra configuration file located at /etc/cassandra/cassandra.yaml change the cluster_name to the previous one, like this:

...
# The name of the cluster. This is mainly used to prevent machines in
# one logical cluster from joining another.

cluster_name: 'dc1'

# This defines the number of tokens randomly assigned to this node on the ring
# The more tokens, relative to other nodes, the larger the proportion of data
...

Upvotes: 1

Alex Tbk
Alex Tbk

Reputation: 2104

The issue is in your log file:

ERROR [main] 2020-02-12 17:40:51,137 CassandraDaemon.java:759 - Cannot start node if snitch's data center (datacenter1) differs from previous data center (dc1). Please fix the snitch configuration, decommission and rebootstrap this node or use the flag -Dcassandra.ignore_dc=true.

It seems that you started the cluster, stopped it and renamed the datacenter from dc1 to datacenter1.

In order to fix:

  1. If no data is stored, delete the data directories
  2. If data is stored, rename the datacenter back to dc1 in the config

Upvotes: 5

Related Questions