cassandra 中的两个节点不会互相闲聊
Posted
技术标签:
【中文标题】cassandra 中的两个节点不会互相闲聊【英文标题】:two nodes in cassandra are not gossiping to each other 【发布时间】:2016-01-13 07:01:13 【问题描述】:节点0: configuration.yaml 文件: cluster_name: 'ServerCluster' 令牌数:256 种子:“” 监听地址:10.104.0.15 rpc_address:10.104.0.15 自动引导:假 endpoint_snitch: GossipingPropertyFileSnitch cassandra-env.sh 文件:JVM_OPTS="$JVM_OPTS -java.rmi.server.hostname=10.104.0.15" cassandra-rackdc 文件:dc=DC1rack=RAC1 节点1: configuration.yaml 文件: cluster_name: 'ServerCluster' 令牌数:256 种子:“10.104.0.15” 监听地址:10.104.0.20 rpc_address:10.104.0.20 自动引导:真 endpoint_snitch: GossipingPropertyFileSnitch cassandra-env.sh 文件:JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=10.104.0.20" cassandra-rackdc 文件:dc=DC1rack=RAC1 Node0 正常运行 节点 1 错误:
INFO 00:03:44 OutboundTcpConnection using coalescing strategy DISABLED
INFO 00:03:45 Handshaking version with /10.104.0.15
ERROR 00:04:16 Exception encountered during startup
java.lang.RuntimeException: Unable to gossip with any seeds
at org.apache.cassandra.gms.Gossiper.doShadowRound(Gossiper.java:1333) ~
[apache-cassandra-2.1.10.jar:2.1.10]
at org.apache.cassandra.service.StorageService.checkForEndpointCollision
(StorageService.java:540) ~[apache-cassandra-2.1.10.jar:2.1.10]
at org.apache.cassandra.service.StorageService.prepareToJoin(StorageServ
ice.java:788) ~[apache-cassandra-2.1.10.jar:2.1.10]
at org.apache.cassandra.service.StorageService.initServer(StorageService
.java:720) ~[apache-cassandra-2.1.10.jar:2.1.10]
at org.apache.cassandra.service.StorageService.initServer(StorageService
.java:611) ~[apache-cassandra-2.1.10.jar:2.1.10]
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.ja
va:387) [apache-cassandra-2.1.10.jar:2.1.10]
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon
.java:562) [apache-cassandra-2.1.10.jar:2.1.10]
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.jav
a:651) [apache-cassandra-2.1.10.jar:2.1.10]
java.lang.RuntimeException: Unable to gossip with any seeds
at org.apache.cassandra.gms.Gossiper.doShadowRound(Gossiper.java:1333)
at org.apache.cassandra.service.StorageService.checkForEndpointCollision
(StorageService.java:540)
at org.apache.cassandra.service.StorageService.prepareToJoin(StorageServ
ice.java:788)
at org.apache.cassandra.service.StorageService.initServer(StorageService
.java:720)
at org.apache.cassandra.service.StorageService.initServer(StorageService
.java:611)
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.ja
va:387)
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon
.java:562)
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.jav
a:651)
Exception encountered during startup: Unable to gossip with any seeds
WARN 00:04:16 No local state or state is in silent shutdown, not announcing shu
tdown INFO 00:04:16 等待消息服务静默 INFO 00:04:16 MessagingService 已终止 accept() 线程
然后我更改了种子(因为在 *** 中看到了解决方案) 节点0: 种子:“10.104.0.15,10.104.0.20” 节点1: 种子:“10.104.0.20” Node0 很好 节点 1 错误:
INFO 00:25:36 Thrift API version: 19.39.0
INFO 00:25:36 CQL supported versions: 2.0.0,3.2.1 (default: 3.2.1)
INFO 00:25:36 Initializing index summary manager with a memory pool size of 101
MB and a resize interval of 60 minutes
INFO 00:25:36 Loading persisted ring state
ERROR 00:25:36 Exception encountered during startup
java.lang.IllegalStateException: Shutdown in progress
at java.lang.ApplicationShutdownHooks.add(ApplicationShutdownHooks.java:
66) ~[na:1.8.0_60]
at java.lang.Runtime.addShutdownHook(Runtime.java:211) ~[na:1.8.0_60]
at org.apache.cassandra.service.StorageService.initServer(StorageService
.java:718) ~[apache-cassandra-2.1.10.jar:2.1.10]
at org.apache.cassandra.service.StorageService.initServer(StorageService
.java:611) ~[apache-cassandra-2.1.10.jar:2.1.10]
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.ja
va:387) [apache-cassandra-2.1.10.jar:2.1.10]
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon
.java:562) [apache-cassandra-2.1.10.jar:2.1.10]
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.jav
a:651) [apache-cassandra-2.1.10.jar:2.1.10]
java.lang.IllegalStateException: Shutdown in progress
at java.lang.ApplicationShutdownHooks.add(ApplicationShutdownHooks.java:
66)
at java.lang.Runtime.addShutdownHook(Runtime.java:211)
at org.apache.cassandra.service.StorageService.initServer(StorageService
.java:718)
at org.apache.cassandra.service.StorageService.initServer(StorageService
.java:611)
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.ja
va:387)
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon
.java:562)
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.jav
a:651)
Exception encountered during startup: Shutdown in progress
那么你能帮我解决这个先有鸡还是先有蛋的问题吗? 比你提前
即使我关注了datastax链接https://academy.datastax.com/courses/ds210-datastax-enterprise-operations-and-performance-tuning/multiple-data-centers-multiple-0 他只是更改了集群名称、listen_address、rpc_address 和种子,当他键入 nodetool status 时,他能够看到它们,但是当我遵循相同的操作时,我只看到它在各自服务器中的状态
【问题讨论】:
你打开了哪些端口? 嗨,乔恩,在打开任何端口之前,我想停止 Windows 防火墙服务,现在它们正在通信,所以是否有任何特定的端口要打开?非常感谢你问我到处都读到的那个问题,但没有人提到端口,再次感谢你 【参考方案1】:停止两个节点。删除数据文件夹。更改配置以将两个节点都作为种子。再次启动每个节点。我怀疑第一次失败的尝试可能有些奇怪。
这里列出了所有需要打开的端口,请确保您可以访问它们(使用 telnet 进行检查)。
http://docs.datastax.com/en/cassandra/2.0/cassandra/security/secureFireWall_r.html
【讨论】:
【参考方案2】:我不确定这是否能解决您的问题。但这是一个很好的建议。
所有节点都应该有相同的种子,并且数据中心应该至少有一个种子。即使一个节点的唯一种子是它自己。
如果我是你,我会在所有节点上尝试此设置:
seeds: "10.104.0.15, 10.104.0.20"
我不明白你为什么没有为节点 1 指定任何 dc, rack。是故意的吗?
【讨论】:
我忘了提及 node1 的 rack-dc 属性,即使我尝试在种子中提供两个 ip,两个节点都已启动并运行良好但没有闲聊,以下是我得到的错误 java.lang.IllegalStateException: 在 java.lang.ApplicationShutdownHooks.add(ApplicationShutdownHooks.java: 66) ~[na:1.8.0_60] 在 java.lang.Runtime.addShutdownHook(Runtime.java:211) 处关闭~[na:1.8.0_60] at org.apache.cassandra.service.StorageService.initServer(StorageService .java:718) ~[apache-cassandra-2.1.10.jar:2.1.10]以上是关于cassandra 中的两个节点不会互相闲聊的主要内容,如果未能解决你的问题,请参考以下文章