How to configure cassandra to listen on the jmx port on a real ip address, rather than 0.0.0.0?

I want to make cassandra for litsen for jmx on an external ip, not 0.0.0.0, since it is used by default. I added a flag to cassandra-env, but it still runs on 0.0.0.0 inteface

JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.host=172.16.40.60" 

What else should I do?

+7
source share
2 answers

add this:

JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=172.16.40.60"

this line is from cassandra-env.sh to apache/cassandra , see here: cassandra-env.sh # L204

+5
source

Currently, you cannot configure jmx in cassandra to listen on only one interface. This is due to the fact that Java applications are generally difficult to do. If you try to do this for security reasons, the solution often blocks the jmx port for all interfaces except localhost, and then uses the tunnel to access jmx from the local node.

For a discussion of adding this function to cassandra, see:

https://issues.apache.org/jira/browse/CASSANDRA-2967

And a potential workaround:

https://blogs.oracle.com/jmxetc/entry/jmx_connecting_through_firewalls_using

+2
source

All Articles