5

I am very new to cassandra. Just started exploring.

I am running a single node cassandra server & facing a problem in seeing status of the cassandra using nodetool command.

I have hostname configured on my VM as myMachineIP cass1 in /etc/hosts

and

I configured my cassandra_instal_path/conf/cassandra.yaml file with listen_address, rpc_address as localhost and clustername as casscluster

(also tried with my hostname which is cass1 as listen_address/rpc_address)

Not sure what is the reason why i am not able to get statususing nodetool command.

$ nodetool

Cannot resolve '127.0.0.1': unknown host

$ nodetool -host 127.0.0.1

Cannot resolve '127.0.0.1': unknown host

$ nodetool -host cass1

Cannot resolve 'cass1': unknown host

But i am able to connect to cassandra-cli

console output:

Connected to: "casscluster" on 127.0.0.1/9160
Welcome to Cassandra CLI version 1.2.8

Type 'help;' or '?' for help.
Type 'quit;' or 'exit;' to quit.

my /etc/hosts looks like:

127.0.0.1       localhost.localdomain   localhost.localdomain   localhost4      localhost4.localdomain4 localhost       cass1

::1     localhost.localdomain   localhost.localdomain   localhost6      localhost6.localdomain6 localhost       cass1


[myMachineIP]  cass1

what could be the reason why i am not able to run nodetool?

Please help.

Aaron
  • 46,155
  • 11
  • 102
  • 118
devThoughts
  • 770
  • 1
  • 10
  • 16

2 Answers2

3

try setting actual IP address in listen_address, rpc_address than localhost

Mata
  • 419
  • 2
  • 9
  • Sorry for very late reply. I have used actual IP. But still no luck. – devThoughts Oct 14 '13 at 15:46
  • 2
    I realized my mistake. I had wrong hostname for java.rmi.server.hostname variable in cassandra-env.sh. Now the node tool is able to connect to cassandra instance. But when i say nodetool on a termonal i got Error: Could not find or load main class org.apache.cassandra.tools.NodeCmd. Any help? – devThoughts Oct 14 '13 at 20:34
  • @devThoughts In this [link](http://grokbase.com/t/cassandra/user/139hj61vg9/cassandra-nodetool-could-not-resolve-127-0-0-1-unknown-host), cassandra.yaml should be modified and restarted to enable the modified IP address. But how? – hengxin May 17 '14 at 12:23
1

Let me share my experience with the same problem and a different solution. The root of my problem was that I had changed in cassandra-env.sh the following property:

JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=mynode-00"

To enable the connection through rmi. But my problem was that I'd mispelled the name of the host. After fixing that I was able to connect.

I hope this helps someone!

gfournier
  • 760
  • 1
  • 7
  • 20