cassandranodetool

Remote JMX does not work in Cassandra 4.0 and 4.1


I have created a Cassandra cluster v4.0.0 and v4.1.0. Following is the config for jvm.options file:

-Dcom.sun.management.jmxremote.port=7199
-Dcom.sun.management.jmxremote.rmi.port=7188 (tried with port 7199 too)
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.host=<IP>
-Djava.rmi.server.hostname=<IP>

The problem that we are facing is this: nodetool status runs fine (without -h option)

nodetool -h <IP> status does not work. The error is this:

nodetool: Failed to connect to '<IP>:7199' - ConnectException: 'Connection refused (Connection refused)'.

netstat -ntlp output:

admin@ip-xx-xx-xx-xx:~$ netstat -ntlp
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.54:53           0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:5012          0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:5000          0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:5001          0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:5355            0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:6062          0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:6162          0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:8126          0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:7199          0.0.0.0:*               LISTEN      -                   
tcp6       0      0 :::22                   :::*                    LISTEN      -                   
tcp6       0      0 :::5355                 :::*                    LISTEN      -                   
tcp6       0      0 ::1:25                  :::*                    LISTEN      -       

port 7199 is listening on localhost for Cassandra v4.x, but it listens on the for Cassandra v3.11.13

Configurations for both versions are the same

What could be the issue here? Can someone please help?


Solution

  • It worked by adding

    -Dcom.sun.management.jmxremote.port=7199
    -Dcom.sun.management.jmxremote.rmi.port=7188 (tried with port 7199 too)
    -Dcom.sun.management.jmxremote.ssl=false
    -Dcom.sun.management.jmxremote.authenticate=false
    -Dcom.sun.management.jmxremote.host=<IP>
    -Djava.rmi.server.hostname=<IP>
    

    in the file jvm8-server.options