0

I am trying to use JMX nodetool distantly. I cannot configure JMX to listen on the public network interface whereas Cassandra does listen on public interface.

Note it is not Cassandra connection, but JMX connection. Cassandra is available on public interface port 9042.

    netstat -planet | grep 7199 
    gives 
    127.0.0.1:7199

and nodetool -h consistently fails.

With ./cassendra-env.sh, I set LOCAL_JMX=no

    -Dcom.sun.management.jmxremote.host=<public_ip>
    -Djava.rmi.server.hostname=<public_ip>
    -Dcom.sun.management.jmxremote.authenticate=false
    -Dcom.sun.management.jmxremote.local.only=false

I tried, without success, to put the parameters also in jvm11-server.options.

JMX keeps binding to 127.0.0.1.

Do I miss something?

(Tryng to use JMX distantly)

Running Cassandra 4.1.4 with Java 11.

2
  • Welcome to Stack Overflow! A friendly reminder that this site is for getting help with coding, algorithm, or programming language problems so I voted to have your post moved to DBA Stack Exchange. For future reference, you should post DB admin/ops questions on dba.stackexchange.com/questions/ask?tags=cassandra. Cheers! Commented Nov 20, 2024 at 6:34
  • @ErickRamirez IMO interacting with Java arguments to configure JVM management settings is a programming topic. Commented Nov 20, 2024 at 12:46

1 Answer 1

1

The minimum requirement to enable remote JMX access is to set LOCAL_JMX to any value other than yes.

In my test environment, I added the following line to conf/cassandra-env.sh:

LOCAL_JMX=no

I didn't enable authentication or SSL to keep it simple and left the configuration with just:

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"
  JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.rmi.port=$JMX_PORT"
  JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
fi

With this minimal configuration, the Cassandra process is listening for JMX connections on all interfaces. For example:

$ sudo lsof -nPi | grep 7199
java      4544           erick   78u  IPv4  73723      0t0  TCP *:7199 (LISTEN)
$ sudo netstat -tnlp | grep 7199
tcp        0      0 0.0.0.0:7199            0.0.0.0:*               LISTEN      4544/java

There's a good chance that you've misconfigured something in your environment. For the record, I did not modify any other configuration file other than cassandra-env.sh. Cheers!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.