This error may occur when using the ‘nodetool’ command, such as in the following example:
For both CentOS 6 and CentOS 7 search the following configuration file:
Which for my search resulted in:
# add this if you’re having trouble connecting:
# JVM_OPTS=”$JVM_OPTS -Djava.rmi.server.hostname=<public name>”
Uncomment the second line, and add the hostname of your server, or the IP address which you’re connecting to/from. In this case, replacing <public name> with 127.0.0.1 resolved the issue, because I am connecting to/from that IP address.
Then exit and save the file with the command :wq .
Be sure to restart Cassandra:
systemctl restart cassandra