简体   繁体   English

如何更新Cassandra集群的配置

[英]How to update configuration of a Cassandra cluster

I have a 3 node Cassandra cluster and I want to make some adjustments to the cassandra.yaml 我有一个3节点的Cassandra集群,我想对cassandra.yaml进行一些调整

My question is, how should I perform this? 我的问题是,我应该如何执行此操作? One node at a time or is there a way to make it happen without shutting down nodes? 一次只有一个节点,或者是否有办法在不关闭节点的情况下实现它?

Btw, I am using Cassandra 2.2 and this is a production cluster. 顺便说一句,我正在使用Cassandra 2.2,这是一个生产集群。

There are multiple approaches here: 这里有多种方法:

  1. If you edit the cassandra.yaml file, you need to restart cassandra to re-read the contents of that file. 如果您编辑cassandra.yaml文件,则需要重新启动cassandra以重新读取该文件的内容。 If you restart all nodes at once, your cluster will be unavailable. 如果立即重新启动所有节点,则群集将不可用。 Restarting one node at a time is almost always safe (provided you have sane replication-factors and consistency-levels). 一次重启一个节点几乎总是安全的(前提是您拥有健全的复制因子和一致性级别)。 If your cluster is configured to survive a rack or datacenter outage, then you can safely restart more nodes concurrently. 如果将群集配置为可以承受机架或数据中心中断的影响,则可以安全地同时重启更多节点。

  2. Many settings can be changed without a restart via JMX, though I don't have a documentation link handy. 尽管我没有方便的文档链接,但无需通过JMX重新启动即可更改许多设置。 Changing via JMX WON'T change cassandra.yml though, so you'll need to update that also or your config will revert back to what's in the file when the node restarts. 通过JMX进行更改不会更改cassandra.yml,因此,您也需要对其进行更新,否则当节点重新启动时,您的配置将恢复为文件中的内容。

  3. If you're using DSE, OpsCenter's Lifecycle Manager feature makes updating configs a simple point-and-click affair (disclaimer, I'm biased as I'm an LCM dev). 如果您使用的是DSE,则OpsCenter的Lifecycle Manager功能使更新配置变得简单,只需单击即可(免责声明,因为我是LCM开发人员,所以有偏见)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM