问题
I'm getting a connection error "unable to connect to any server" when I run .cqlsh command from the bin directory of my node.
I'm using an edited yaml file containing only the following(rest all values present in the default yaml have been omitted) :
cluster name, num tokens, partitioner, data file directories, commitlog directory, commitlog sync, commitlog sync period, saved cache directory, seed provider info, listen address and endpoint snitch.
Is this error because I've not included some important parameter in the yaml like rpc address? Please help.
OS: RHEL 6.9 Cassandra: 3.0.14
回答1:
- The cassandra yaml file can have modified values, but you should not delete the rows and make your own yaml file. And yes, rpc address is needed in yaml file.
In writing the directories like data_file_directories, you should follow the same indentation as:
data_file_directories - /path/to/access
Cassandra is very strict at it's indentation in yaml file. I once faced an issue due to this wrong indentation in data_file_directories.
- Finally, run ./cqlsh , provide ip_address if it is a remote server.
- Check the nodetool status and confirm whether the node is up and normal.
回答2:
Check the following:
- Cassandra is running:
nodetool status
/ps -elf | grep cassa
- Port 9042 (default for CQL) is not used by something else:
netstat -an | grep 9042
- Try running
cqlsh `hostname -i`
Good luck.
来源:https://stackoverflow.com/questions/48060940/unable-to-run-cqlshconnection-refused