I am facing some weird situation here while trying to connect a external Play Application to a cassandra cluster (which is running on a docker container over mesos).
The problem is:
If I only have a single Cassandra node, I can connect to it properly from the Play application. BUT, If I add a second node to it, I am not able to connect to any node anymore.
I am putting up the nodes as following:
First node (SEED)
{
"id": "cassandra-seed",
"constraints": [["hostname", "CLUSTER", "docker-sl-vm"]],
"container": {
"type": "DOCKER",
"docker": {
"image": "cassandra:latest",
"network": "BRIDGE",
"portMappings": [ {"containerPort": 9042,"protocol": "tcp"} ]
}
},
"env": {
"CASSANDRA_SEED_COUNT": "1"
},
"cpus": 0.5,
"mem": 512.0,
"instances": 1,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600
}
At this point, I am able to connect playy app to cassandra-seed.
CASSANDRA NODE2
{
"id": "cassandra",
"constraints": [["hostname", "CLUSTER", "docker-sl-vm"]],
"container": {
"type": "DOCKER",
"docker": {
"image": "cassandra:latest",
"network": "BRIDGE",
"portMappings": [ {"containerPort": 9042,"protocol": "tcp"} ]
}
},
"env": {
"CASSANDRA_SEED_COUNT": "1",
"CASSANDRA_SEEDS": "cassandra-seed.marathon.mesos"
},
"cpus": 0.5,
"mem": 512.0,
"instances": 1,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600
}
After this node comes up, I can't connect to it nor to cassandra-seed.
nodetool status result:
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns Host ID Rack
UJ 172.17.0.3 92.91 KB 256 ? ccf83479-beed-44f5-9e36-6c997fd8855c rack1
UN 172.17.0.2 96.96 KB 256 ? 1e42609d-ba3f-4c35-80c2-424a095b4db7 rack1
It looks like after the second node is up, cassandra isn't bound to the address, and the host stop seeing it. What should I do?