Full ERROR Message Example
WARN [main] 2020-06-10 02:55:15,970 DatabaseDescriptor.java:1120 - JMX is not enabled to receive remote connections. Please see cassandra-env.sh for more info.
ERROR [main] 2020-06-10 02:55:15,970 DatabaseDescriptor.java:1126 - cassandra.jmx.local.port missing from cassandra-env.sh, unable to start local JMX service.
What does this ERROR message mean?
We use JMX_PORT for the RMI port to simplify nodetool connectivity (See https://issues.apache.org/jira/browse/CASSANDRA-7087 for more info)
If not set in your cassandra-env.sh, you will get a :
nodetool: Failed to connect to '127.0.0.1:7199' - ConnectException: 'Connection refused (Connection refused)'.
When running nodetool status for example
Why does this ERROR occur?
This would happen if you don't specify JMX_PORT="7199" in the entry below of your cassandra-env.sh, or if the line is missing:
# Specifies the default port over which Cassandra will be available for # JMX connections. # For security reasons, you should not expose this port to the internet. Firewall it if needed. JMX_PORT="7199" if [ "$LOCAL_JMX" = "yes" ]; then JVM_OPTS="$JVM_OPTS -Dcassandra.jmx.local.port=$JMX_PORT" JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.authenticate=false" else JVM_OPTS="$JVM_OPTS -Dcassandra.jmx.remote.port=$JMX_PORT"
How do you fix this ERROR?
Make sure to set the JMX_PORT with the standard port 7199 in your cassandra-env.sh and restart the node.
It may be set in the jvm.options file in DSE, in which case, make sure to add -Dcassandra.jmx.local.port=7199 inside the jvm.options file.