单个docker swarm节点上的cassandra副本

4c8rllxm  于 2021-06-14  发布在  Cassandra
关注(0)|答案(1)|浏览(393)

我有一个docker swarm manager节点(18.09.6)正在运行,我正在玩旋转cassandra集群的游戏。我使用了以下定义,它的工作原理是种子/主服务器和从服务器启动并通信/复制它们的数据/模式更改:

services:
  cassandra-masters:
    image: cassandra:2.2
    environment:
      - MAX_HEAP_SIZE=128m
      - HEAP_NEWSIZE=32m
      - CASSANDRA_BROADCAST_ADDRESS=cassandra-masters
    deploy:
      mode: replicated
      replicas: 1
  cassandra-slaves:
    image: cassandra:2.2
    environment:
      - MAX_HEAP_SIZE=128m
      - HEAP_NEWSIZE=32m
      - CASSANDRA_SEEDS=cassandra-masters
      - CASSANDRA_BROADCAST_ADDRESS=cassandra-slaves
    deploy:
      mode: replicated
      replicas: 1
    depends_on:
      - cassandra-masters

当我将副本计数从1更改为2时,无论是在部署堆栈还是部署后规模,都会为cassandra从属服务器创建第二个任务,但会不断失败,并出现一个错误,表明它无法与种子节点通信:

INFO  10:51:03 Loading persisted ring state
INFO  10:51:03 Starting Messaging Service on /10.10.0.200:7000 (eth0
INFO  10:51:03 Handshaking version with cassandra-masters/10.10.0.142
Exception (java.lang.RuntimeException) encountered during startup: Unable to gossip with any seeds
java.lang.RuntimeException: Unable to gossip with any seeds
    at org.apache.cassandra.gms.Gossiper.doShadowRound(Gossiper.java:1360)
    at org.apache.cassandra.service.StorageService.checkForEndpointCollision(StorageService.java:521)
    at org.apache.cassandra.service.StorageService.prepareToJoin(StorageService.java:756)
    at org.apache.cassandra.service.StorageService.initServer(StorageService.java:676)
    at org.apache.cassandra.service.StorageService.initServer(StorageService.java:562)
    at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:310)
    at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:548)
    at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:657)
ERROR 10:51:34 Exception encountered during startup
java.lang.RuntimeException: Unable to gossip with any seeds
    at org.apache.cassandra.gms.Gossiper.doShadowRound(Gossiper.java:1360) ~[apache-cassandra-2.2.14.jar:2.2.14]
    at org.apache.cassandra.service.StorageService.checkForEndpointCollision(StorageService.java:521) ~[apache-cassandra-2.2.14.jar:2.2.14]
    at org.apache.cassandra.service.StorageService.prepareToJoin(StorageService.java:756) ~[apache-cassandra-2.2.14.jar:2.2.14]
    at org.apache.cassandra.service.StorageService.initServer(StorageService.java:676) ~[apache-cassandra-2.2.14.jar:2.2.14]
    at org.apache.cassandra.service.StorageService.initServer(StorageService.java:562) ~[apache-cassandra-2.2.14.jar:2.2.14]
    at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:310) [apache-cassandra-2.2.14.jar:2.2.14]
    at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:548) [apache-cassandra-2.2.14.jar:2.2.14]
    at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:657) [apache-cassandra-2.2.14.jar:2.2.14]

我想了解是什么导致了这个问题,以及是否有办法解决这个问题?我只是在调查什么是进入生产的障碍,我们显然会在不同的节点而不是一个节点上旋转cassandra任务/副本。
编辑:我在一个两节点的群上旋转了相同的堆栈,我看到了相同的行为,即当我缩放到第二个“从属”任务时,它会以相同的错误失败,因此尝试在同一节点上运行两个任务并不是一个特别的问题。

mzaanser

mzaanser1#

我还没有弄清楚流言失败的原因,但最终我们同意了一个生产部署策略,即我们不需要自动扩展,而是应该根据系统行为和预期流量进行容量规划。这个答案还指出了自动缩放可能给已经拉伸的系统增加的额外压力:aws和自动缩放cassandra

相关问题