【问题标题】:Why does DSE Cassandra is showing full region name in data center name?为什么 DSE Cassandra 在数据中心名称中显示完整的区域名称?
【发布时间】:2017-10-11 11:56:00
【问题描述】:

我在 us-east-2 区域的 AWS EC2 上运行具有 3 个节点集群的 DSE Cassandra 4.8.14。 我已将我的 cassandra.yaml 设置为:

...
# You can use a custom Snitch by setting this to the full class name
# of the snitch, which will be assumed to be on your classpath.
endpoint_snitch: Ec2MultiRegionSnitch
...

我的 cassandra-rackdc.properties 为:

# When upgrading from SimpleSnitch, you will need to set your initial machines
# to have rack=rack1
dc=DC1
rack=RAC1

# Add a suffix to a datacenter name. Used by the Ec2Snitch and Ec2MultiRegionSnitch
# to append a string to the EC2 region name.
dc_suffix=-2

# Uncomment the following line to make this snitch prefer the internal ip when possible, as the Ec2MultiRegionSnitch does.
# prefer_local=true

使用此设置,根据DSE documentation,我应该看到我的数据中心名称为

us-east-2

但是,在 mt 系统中,它显示为 us-east-2-2

nodetool status
Datacenter: us-east-2-2
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address         Load       Tokens  Owns    Host ID                               Rack
UN  10.0.0.1    108.55 KB  256     ?       97649498-8521-42e6-b615-408b02d07ff4  2b
UN  10.0.0.2    74.93 KB   256     ?       e7851b9c-1d92-44c7-a20f-3a5f774336c3  2c
UN  10.0.0.3  117.38 KB  256     ?       482c26e6-a438-406d-b601-f5c90d2c5a99  2a

Note: Non-system keyspaces don't have the same replication settings, effective ownership information is meaningless

有人可以提供一些我在这里缺少的想法吗?

谢谢。

【问题讨论】:

  • 如果你的所有节点都在同一个区域(us-east-2),你为什么需要 Ec2MultiRegionSnitch ?

标签: cassandra datastax-enterprise


【解决方案1】:

确定数据中心名称的代码与文档中描述的代码相比稍有细微差别。

如果 EC2 区域以1 结尾,例如us-east-1,则数据中心名称为us-east。但是,如果 EC2 区域不以 1 结尾,例如在您使用 us-east-2 的情况下,那么它将使用整个区域名称作为数据中心名称。加上-2dc_suffix,数据中心的名字就变成了us-east-2-2

为什么命名如此不一致?很久以前有一个错误导致某些区域具有相同的数据中心名称。例如,us-east-1us-east-2 都只是 us-east。为了解决这个问题,提交者决定只保留那些以 1 结尾的区域以使用旧的数据中心名称,以便飞贼与使用旧版本的现有集群保持向后兼容。

CASSANDRA-7839 已开放以解决 Ec2Snitch 命名约定的标准化问题,但它看起来尚未取得进展。

来源:

  1. https://github.com/apache/cassandra/blob/cassandra-2.1/src/java/org/apache/cassandra/locator/Ec2Snitch.java
    (Ec2MultiRegionSnitch 扩展自 Ec2Snitch)

  2. https://issues.apache.org/jira/browse/CASSANDRA-4026

【讨论】:

  • 很棒的信息。谢谢。
猜你喜欢
  • 1970-01-01
  • 2016-09-11
  • 2013-10-29
  • 1970-01-01
  • 2015-05-16
  • 1970-01-01
  • 1970-01-01
  • 2013-07-25
  • 1970-01-01
相关资源
最近更新 更多