在Cassandra中更改群集名称 [英] Changing Cluster Name in Cassandra

查看:118
本文介绍了在Cassandra中更改群集名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含2台机器(centos7和cassandra 3.4),192.168.0.175和192.168.0.174的集群。种子是192.168.0.175。

I have a cluster with 2 machines (centos7 and cassandra 3.4), 192.168.0.175 and 192.168.0.174. The seed is the 192.168.0.175.

我只是想更改群集名称。

I simply want to change the cluster name. Peace of cake should be.

我在每个群集上都做过:

I did on each cluster :


  • update system.local set cluster_name ='America2'其中key ='local';

我做了nodetool刷新

i did the nodetool flush

我用新名称更新了cassandra.yaml

i updated the cassandra.yaml with the new name

重新启动cassandra。

restarted cassandra.

当我使用cqlsh时,如果将我描述为已连接到新的cluster_name America2

When i cqlsh any if describes me as connected to new cluster_name America2

当我运行nodetool describecluster时,它会显示旧群集名称America

When i run nodetool describecluster it shows the old cluster name America

如果我在两台计算机上都停止了cassandra并尝试重新启动它们,在日志中找到良好的旧错误:

If i stop cassandra on both machines and i try to restart them i find in logs the good old error :

org.apache.cassandra.exceptions.ConfigurationException:保存的群集名称America!=配置名称America2

所以....我在做什么错了??

So....what am i doing wrong!?

推荐答案

更改群集名称之前


  1. 从群集环中删除节点

  1. delete node from cluster ring

停用nodetool

nodetool decommission

停止节点并更改cassandra.yaml中的群集名称

stop node and change cluster name in cassandra.yaml

clean节点

sudo rm -rf / var / lib / cassandra / * / var / log / cassandra / *

sudo rm -rf /var/lib/cassandra/* /var/log/cassandra/*

启动cassandra节点

start cassandra node

更多信息,请访问 academy.datastax.com

这篇关于在Cassandra中更改群集名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆