cassandra 服务 (3.11.5) 在 AWS linux 上 starts/restart 后自动停止

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

cassandra 服务 (3.11.5) 在 AWS linux.starts/restart 之后自动停止 linux。

我在 AWS linux (t3.xlarge) 和

的新实例上全新安装了 cassandra
sudo service cassandra start
or
sudo service cassandra restart

1 或 2 秒后,服务自动停止。我查看了日志并找到了这些。 我不确定,我没有更改与 snitch 相关的配置,它总是 SimpleSnitch。我没有任何多个卡桑德拉。仅在单个 EC2 上。

日志

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.

安装步骤

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

问题在您的日志文件中:

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.

您似乎启动了集群,将其停止并将数据中心从 dc1 重命名为 datacenter1。

为了修复:

  1. 如果没有存储数据,删除数据目录
  2. 如果存储了数据,请在配置中将数据中心重命名回 dc1

我遇到了同样的问题,cassandra 服务在启动后立即停止。

在位于 /etc/cassandra/cassandra.yaml 的 cassandra 配置文件中,将 cluster_name 更改为前一个,如下所示:

...
# 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
...