在Cassandra中,解决了当更改集群名称时遇到的问题

环境

    • Debian 8

 

    Cassandra 2.2x

我想做的事情。

# The name of the cluster. This is mainly used to prevent machines in
# one logical cluster from joining another.
#cluster_name: 'Test Cluster'
cluster_name: 'Gandarla Cluster'

只是想而已。

由于之前是在Test Cluster上启动的,所以简单地更改了名称是不起作用的。

出现这种错误。。

ERROR [main] 2016-08-02 08:57:09,272 CassandraDaemon.java:698 - Fatal exception during initialization
org.apache.cassandra.exceptions.ConfigurationException: Saved cluster name Test Cluster != configured name Gandarla Cluster
    at org.apache.cassandra.db.SystemKeyspace.checkHealth(SystemKeyspace.java:913) ~[apache-cassandra-3.0.8.jar:3.0.8]
    at org.apache.cassandra.service.StartupChecks$8.execute(StartupChecks.java:304) ~[apache-cassandra-3.0.8.jar:3.0.8]
    at org.apache.cassandra.service.StartupChecks.verify(StartupChecks.java:107) ~[apache-cassandra-3.0.8.jar:3.0.8]
    at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:171) [apache-cassandra-3.0.8.jar:3.0.8]
    at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:557) [apache-cassandra-3.0.8.jar:3.0.8]
    at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:685) [apache-cassandra-3.0.8.jar:3.0.8]

做过的事情 de

# cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.0.8 | CQL spec 3.4.0 | Native protocol v4]
Use HELP for help.
cqlsh> UPDATE system.local SET cluster_name = 'Gandarla Cluster' where key = 'local';
cqlsh> exit
# nodetool flush
# service cassandra stop
# rm -rf /var/lib/cassandra/data/system/*
# vi /etc/cassandra/cassandra.yaml

将我想做的事情进行描述。

# service cassandra start

在确认站起来后的一段时间里,

# cqlsh
Connected to Gandarla Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.0.8 | CQL spec 3.4.0 | Native protocol v4]
Use HELP for help.
cqlsh>

如果成为那样就结束了。

备忘录

    • デバッグログの場所

/var/log/cassandra/debug.log

参考にしたページ

datastax
stackoverflow

bannerAds