3

Trying to get Cassandra running in a docker using the official docker image. When I execute the below lines of code it starts then stops the docker without connecting to the cluster. I have checked the cassandra.yaml file and it looks just like the other nodes on my cluster. Same for the cassandra-rackdc.properties file. The docker can ping all the other computers.

I run the following and a few derivations:

docker run --name cassandra -i \
-v /media/mcamp/HDD/Docker/CampgroundContainer1:/var/lib/cassandra \
-e CASSANDRA_SEEDS="192.168.0.114, 192.168.0.101, 192.168.0.106" \
-e CASSANDRA_CLUSTER_NAME=CampCluster \
-e CASSANDRA_DC=campground-wireless \
-e CASSANDRA_RACK=Docker1 \
-e CASSANDRA_ENDPOINT_SNITCH=GossipingPropertyFileSnitch \
-e CASSANDRA_START_RPC=true \
-e CASSANDRA_LISTEN_ADDRESS=172.17.0.2 \
-p 7000:7000 \
 cassandra:latest

I get the following error:

INFO  [ScheduledTasks:1] 2017-11-10 03:45:39,428 TokenMetadata.java:498 - Updating topology for all endpoints that have changed
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:1415)
    at org.apache.cassandra.service.StorageService.checkForEndpointCollision(StorageService.java:550)
    at org.apache.cassandra.service.StorageService.prepareToJoin(StorageService.java:801)
    at org.apache.cassandra.service.StorageService.initServer(StorageService.java:666)
    at org.apache.cassandra.service.StorageService.initServer(StorageService.java:612)
    at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:393)
    at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:600)
    at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:689)
ERROR [main] 2017-11-10 03:46:08,466 CassandraDaemon.java:706 - Exception encountered during startup
java.lang.RuntimeException: Unable to gossip with any seeds
    at org.apache.cassandra.gms.Gossiper.doShadowRound(Gossiper.java:1415) ~[apache-cassandra-3.11.1.jar:3.11.1]
    at org.apache.cassandra.service.StorageService.checkForEndpointCollision(StorageService.java:550) ~[apache-cassandra-3.11.1.jar:3.11.1]
    at org.apache.cassandra.service.StorageService.prepareToJoin(StorageService.java:801) ~[apache-cassandra-3.11.1.jar:3.11.1]
    at org.apache.cassandra.service.StorageService.initServer(StorageService.java:666) ~[apache-cassandra-3.11.1.jar:3.11.1]
    at org.apache.cassandra.service.StorageService.initServer(StorageService.java:612) ~[apache-cassandra-3.11.1.jar:3.11.1]
    at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:393) [apache-cassandra-3.11.1.jar:3.11.1]
    at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:600) [apache-cassandra-3.11.1.jar:3.11.1]
    at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:689) [apache-cassandra-3.11.1.jar:3.11.1]
INFO  [StorageServiceShutdownHook] 2017-11-10 03:46:08,469 HintsService.java:220 - Paused hints dispatch
WARN  [StorageServiceShutdownHook] 2017-11-10 03:46:08,469 Gossiper.java:1540 - No local state, state is in silent shutdown, or node hasn't joined, not announcing shutdown
INFO  [StorageServiceShutdownHook] 2017-11-10 03:46:08,469 MessagingService.java:984 - Waiting for messaging service to quiesce
INFO  [ACCEPT-/172.17.0.2] 2017-11-10 03:46:08,470 MessagingService.java:1338 - MessagingService has terminated the accept() thread
INFO  [StorageServiceShutdownHook] 2017-11-10 03:46:09,653 HintsService.java:220 - Paused hints dispatch
  • I correctly understand that other Cassandra nodes are in Docker on other computers? – Alex Ott Nov 27 '17 at 20:55
  • the other nodes are currently on other computers but not currently in dockers.. – Matt Camp Nov 28 '17 at 15:58
  • Do you expect to reach the 192 network of the host from the 172 in the container? I doubt that's going to work. – mustaccio Nov 28 '17 at 18:59
  • 192 network should be reachable from inside container (just re-checked from my own containers), but not vice versa... – Alex Ott Nov 28 '17 at 19:24
  • I would think they are reachable.. I can ping everything from the containers.. haven't gone the other way though.. – Matt Camp Nov 28 '17 at 19:27
2

I think that the problem could be that you don't set the CASSANDRA_BROADCAST_ADDRESS parameter that is used by Cassandra when it talks with other nodes. By default it sets it to value of CASSANDRA_LISTEN_ADDRESS, but in your case this address is address of Docker network, so other nodes won't able to reach your Docker instance.

You need to set CASSANDRA_BROADCAST_ADDRESS to IP address of your machine that hosts the Docker.

  • ok I'll try that when I get home.. what would I set that to? set it to the host machine IP or set it to the container IP? – Matt Camp Nov 28 '17 at 19:24
  • You need to set it to IP of host machine, so other nodes could reach it – Alex Ott Nov 28 '17 at 19:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.