【问题标题】:Cassandra schema agreement with Ec2MultiRegionSnitchCassandra 与 Ec2MultiRegionSnitch 的模式协议
【发布时间】:2014-07-16 15:33:48
【问题描述】:

我的多数据中心 cassandra 集群遇到了一个问题。这是一个由六个节点组成的全新集群(三个在 eu-west,三个在 us-west-2)。安全组的配置使得每个节点都可以与其他节点的外部 IP 进行通信。监听地址定义为本地VPC IP,广播地址设置为每个节点的公网IP。

一切似乎都很好:

Datacenter: us-west-2
=====================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address        Load       Owns (effective)  Host ID                               Token                                    Rack
UN  (public ip)  121.3 KB   100.0%            b15c18bf-1689-4308-bbe2-d36d38f7c8ea  -9103428429654321414                     2b
UN  (public ip)  46.57 KB   100.0%            89378b79-4228-4b44-a3e3-c6d2f3bbd368  -9174198879812166340                     2b
UN  (public ip)  46.58 KB   100.0%            4cbd586f-963c-4339-abaa-af313e023abe  -9223053993127788404                     2b

Datacenter: eu-west
===================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address        Load       Owns (effective)  Host ID                               Token                                    Rack
UN  (public ip)  46.59 KB   100.0%            2aad2d39-0099-4ae3-ae46-a1558b1b657c  -9163190464402129696                     1c
UN  (public ip)  98.55 KB   100.0%            94748d93-cf56-4cde-8b44-f75d17b41924  -9211541808465956929                     1c
UN  (public ip)  84.5 KB    100.0%            3cdeba13-3026-4a1b-a8d1-63eef25049cb  -9196529642979836746                     1c

所以,我创建了我需要的键空间。

但是,当我尝试将我的 thrift 应用程序连接到集群时,我看到来自 Astyanax 的以下错误:

Caused by: com.netflix.astyanax.connectionpool.exceptions.SchemaDisagreementException: 
    SchemaDisagreementException: [host=(internal ip):9160, latency=10002(10007), 
    attempts=1] Can't change schema due to pending schema agreement

我认为这是因为新的键空间没有正确复制到其他节点,但我不知道为什么。如果我运行nodetool describecluster,它会给我这个(记住我使用的是 Ec2MultiRegionSnitch,但由于某种原因这显示为 DynamicEndpointSnitch):

Cluster Information:
Name: mycluster_multiregion
Snitch: org.apache.cassandra.locator.DynamicEndpointSnitch
Partitioner: org.apache.cassandra.dht.Murmur3Partitioner
Schema versions:
    UNREACHABLE: [(public IP of this node)]

    f9de7b22-1486-37c6-8487-801 [(list of other node public IPs)]

在每个节点上都是一样的——它认为自己无法访问。这在技术上是正确的;在 EC2 VPC 中,由于 NAT,节点无法使用其公共 IP 与其自身通信。但是,我不确定这是否会导致我的架构不一致问题,如果是,我不确定是否有简单的解决方案。

任何见解都值得赞赏!

【问题讨论】:

    标签: amazon-ec2 cassandra astyanax amazon-vpc


    【解决方案1】:

    如此处所述 http://nsinfra.blogspot.in/2013/06/cassandra-schema-disagreement-problem.html

    您可以尝试使用 NTP 同步时钟吗?

    来自 AWS 文档 - 配置网络时间协议 (NTP) Amazon Linux 实例上默认配置网络时间协议 (NTP);但是,实例需要访问 Internet 才能使标准 NTP 配置正常工作。本节中的过程显示如何验证默认 NTP 配置是否正常工作。如果您的实例无法访问 Internet,则需要配置 NTP 以查询私网中的其他服务器以保持准确的时间

    可能对于 EC2 VPC,您需要配置 NTP 以使用 AWS 时间服务器 (x.amazon.pool.ntp.org)

    【讨论】:

      猜你喜欢
      • 2016-12-17
      • 2017-11-03
      • 2011-02-26
      • 2015-11-16
      • 2011-12-10
      • 2014-10-19
      • 2015-12-23
      • 2015-07-06
      • 1970-01-01
      相关资源
      最近更新 更多