Nodetool or JMX connections failing on remote nodes

Nodetool commands can be run locally but not on other nodes in the cluster.

Nodetool commands can be run locally but not on other nodes in the cluster.

If you can run nodetool commands locally but not on other nodes in the ring, you may have a common JMX connection problem that is resolved by adding an entry like the following in cassandra-env.ps1 on each node:

JVM_OPTS = "$env:VM_OPTS -Djava.rmi.server.hostname=public name"

If you still cannot run nodetool commands remotely after making this configuration change, do a full evaluation of your firewall and network security. The nodetool utility communicates through JMX on port 7199.

The location of the cassandra-env.sh file depends on the type of installation:
Package installations /etc/cassandra/cassandra-env.sh
Tarball installations install_location/conf/cassandra-env.sh
The location of the cassandra-env.ps1 is:
Windows installations C:\Program Files\DataStax Community\apache-cassandra\conf\cassandra-env.ps1