2
votes

I'm trying to set up multi node Cassandra cluster in a local network. I applied the instructions [here]: http://wiki.apache.org/cassandra/MultinodeCluster. I have two nodes. Here are my changes in /etc/cassandra/cassandra.yaml:

First node (ip is "192.168.0.59"):

listen_address: 192.168.0.59

rpc_address: 0.0.0.0

seeds: - 192.168.0.59

Second node (ip is "192.168.0.5"):

auto_bootstrap: true

listen_address: 192.168.0.5

rpc_address: 0.0.0.0

seeds: - 192.168.0.59

It seems it's not working. I'm trying to connect Cassandra using Cassandra-Cluster-Admin but it fails even if I don't connect second node. I'm also using noip service. Is my configuration correct or is noip causing the problem? Do I need to do any configuration for ports or something in the modem? My server is Ubuntu 11.10 and Cassandra version is 1.0.5.

//Edit

I've figured out the problem and now I can connect to both nodes. The problem was in cassandra.yaml file I was commenting old configurations (listen_address etc.) and inserting new ones. But when I do that, I can't connect Cassandra. It's very strange. Why is that happening?

//Edit

Problem is not comments. I see that I shouldn't use tab inside cassandra.yaml

2
It looks like you're using the same listen_address for both nodes. Is that just a typo? - Tyler Hobbs
It turns out the problem is I cannot connect Cassandra. When I type cassandra-cli -h "192.168.0.59" I get this: Exception connecting to 192.168.0.59/9160. Reason: Connection refused. - m3rg
I changed the second node's listen_address to 192.168.0.5 still can't connect. - m3rg
Can you verify that both of the nodes are starting without any problems by looking at the logs? Do they both log that they see each other? - Tyler Hobbs
Yes, I checked the logs and both of the nodes see each other. I also found the problem in the logs. I thought the problem is my comments in cassandra.yaml but actually If I use tab in cassandra.yaml,it can't start cassandra and logs this error message: "while scanning for the next token; found character '\t' that cannot start any token Invalid yaml; unable to start server. See log for stacktrace." I didn't know that. Interesting. - m3rg

2 Answers

2
votes

Try to change ip address in Cassandra-Cluster-Admin

path: cassandra/include/conf.inc.php

chage:

$CASSANDRA_CLUSTERS = array(array('nodes' => array('your ip address:9160'),
                                     'username' => '',
                                     'password' => ''));

I think it may be a solution to your problem.

0
votes

No tab should be used in cassandra.yaml