2

我被我的多数据中心 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

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

但是,当我尝试将我的节俭应用程序连接到集群时,我会看到来自 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 与其自身通信。但是,我不确定这是否会导致我的架构不一致问题,如果是,我不确定是否有简单的解决方案。

任何见解表示赞赏!

4

1 回答 1

1

As described here http://nsinfra.blogspot.in/2013/06/cassandra-schema-disagreement-problem.html

can you try and sync clocks using NTP?

From AWS docs - Configuring Network Time Protocol (NTP) Network Time Protocol (NTP) is configured by default on Amazon Linux instances; however, an instance needs access to the Internet for the standard NTP configuration to work. The procedures in this section show how to verify that the default NTP configuration is working correctly. If your instance does not have access to the Internet, you need to configure NTP to query a different server in your private network to keep accurate time.

May be for EC2 VPC you need to configure NTP to use the AWS time servers (x.amazon.pool.ntp.org)

于 2014-07-16T07:33:48.947 回答