我被我的多數據中心cassandra羣集遇到的問題困住了。這是一個由6個節點組成的全新集羣(歐洲西部3個,西部2個3個)。安全組配置爲使每個節點都可以與其他節點的外部IP進行通信。監聽地址被定義爲本地VPC IP,並且廣播地址被設置爲每個節點的公共IP。Cassandra與Ec2MultiRegionSnitch的架構協議
似乎一切都OK:
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
所以,我創造我所需要的keyspaces。
但是,當我嘗試我節儉的應用程序連接到羣集,然後我看到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與自己進行通信。但是,我不確定這是否會導致我的模式分歧問題,如果是這樣,我不確定是否有簡單的解決方案。
任何洞察讚賞!