1

I am trying to setup a Cassandra multinode cluster on CentOS 7 with OpenJDK.

I have 2 Nodes:

  • node1 10.99.189.49
  • node2 10.99.189.50

I have done following things till now:

  1. Downloaded the tarball of Cassandra from PlanetCassandra site
  2. Extracted it in Documents folder.
  3. Created all the necessary directories (data/saved_cache, data/commitlog, data/data) as mentioned in the YAML file.

And I have made 3 changes in my conf/cassandra.yaml file as follows:

On node 10.99.189.49:

seeds: "10.99.189.49" 
listen_address: 10.99.189.49
rpc_address: 10.99.189.49

On node 10.99.189.50:

seeds: "10.99.189.49" 
listen_address: 10.99.189.50
rpc_address: 10.99.189.50

Now I run cassandra on node 10.99.189.49 and then I run cassandra on the other node.

Cassandra starts normally on both the nodes BUT when I do:

bin/nodetool status

I can see only one node in it.

Can anyone point what I am doing wrong or missing something?

5
  • 1
    Are seeing any evidence in the logs that the nodes are talking to each other? or, Are then obvious errors in the logs? Commented Mar 7, 2016 at 15:29
  • Also make sure that cluster_name is the same. Commented Mar 7, 2016 at 16:06
  • @Aaron Yes the cluster_name is same. Commented Mar 7, 2016 at 17:35
  • @mikea No there are no obivous errors in the logs :( Commented Mar 7, 2016 at 17:36
  • 2
    Are you sure the nodes can see each other, and that all necessary ports (7000, 7199, 9042) are open between them? From .49, try telnet 10.99.189.50 7000. Commented Mar 7, 2016 at 17:39

2 Answers 2

1

So I started adding tips in the comments, and for my 3rd time around I thought I'd start putting them all together in an actual answer.

DataStax does a pretty good job documenting how this should work. Make sure that you've gone through these docs (specifically the first one) and that you're following all the steps:

In addition to everything you have mentioned above, make sure that the cluster_name is the same on each node.

I find it easier to make this work using the GossipingPropertyFileSnitch. Set that in your cassandra.yaml on each node:

endpoint_snitch: GossipingPropertyFileSnitch

Then make sure that each of your nodes is specifying the same default data center in the cassandra-rackdc.properties file:

dc=DC1

Get your first node (.49) up-and-running. Verify it with nodetool status.

Also verify that you have opened the necessary ports in your firewall. From .49, try telneting your way to the other node on the ports that Cassandra requires. I recommend 7000, as that is the port for non-SSL inter-node communication.

telnet 10.99.189.50 7000

Once you're sure all that works and everything is configured properly, then bring up .50. I remember reading that you should wait at least 2 minutes before bringing up another node, so do that just to be on the safe side. Tail the logs to make sure it handshakes with the other node, or to see any errors:

tail -f /var/log/cassandra/system.log

Notes: Your log location may vary. I'm assuming you're running 2.2. If you are using a different version of Cassandra, please indicate it.

Hope this helps!

Sign up to request clarification or add additional context in comments.

Comments

0

On both node use

seeds: "10.99.189.49,10.99.189.50" 

and also restart both node cassandra

1 Comment

but I dont want the other node to be a seed so why should I use this?? Can you please let me know the reason?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.