问题
So I have the VMWare image of Cassandra which is running fine. I am trying to connect from the host OS which is Windows 7 and I am getting connection refused. I tried telnet ipaddress 9160 and the port does not seem to be open. Either the service is not running or a firewall is blocking it. Can someone help with troubleshooting?
回答1:
How is your VM's network configured? And what OS are you running? These are details that we need to know.
I've been able to get Cassandra to run on an Ubuntu VM (on a Windows host) both with the "bridged" and "NAT: Used to share the host's IP address" network options.
Check the IP address on your VM, which on Ubuntu I can do with ifconfig
. That's the IP address you should be using to connect with from your Windows host (which should be different from your Windows host IP).
From your Windows application code, you should then be able to connect to Cassandra on your VM's IP address.
Also, check the listen_address
and rpc_address
values in your cassandra.yaml. These should not be set to localhost, and RPC address should be set to your VM's external IP address. Hope this helps.
回答2:
Try to ssh to the (or a if running a cluster) box and run:
ps auwx | grep java | grep cassandra
If you see something non empty, cassandra is running. You could then go to the cassandra isntallation directory and run i
$install_dir/bin/nodetool status
to get the cluster status.
It does seem likely that it's the firewall.
来源:https://stackoverflow.com/questions/27555691/connecting-to-cassandra-sandbox-from-windows