Search code examples
cassandrajmxjconsoleelassandra

How to enable remote JMX connections in Elassandra?


I'm trying to enable JMX in Elassandra 5.5.0.4 through cassandra-evn.sh file in order to connect to a Cassandra node, remotely, and get metrics and statistics. I'm trying to connect to JMX using JConsole. I have followed various tutorial from datastax and blogs without success.

I tried with and without authentication but nothing worked.


Solution

  • Make sure the below parameters are set. The configuration enables JMX metrics remotely without any authentication.

    # add this if you're having trouble connecting:
    JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=<public ip>"
    
    LOCAL_JMX=no
    JMX_PORT="7199"
    
    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"