Reputation: 5892
I want to make cassandra to litsen to jmx on external ip and not 0.0.0.0 as it used in default. I've added the flag in cassandra-env but it still starts up on the 0.0.0.0 inteface
JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.host=172.16.40.60"
What else should I do?
Upvotes: 8
Views: 15339
Reputation: 3684
Currently you can not configure jmx in cassandra to listen on just a single interface. This is due to it being quite hard to do in java applications in general. If you are attempting to do this for security reasons then the solution is often to block the jmx port for all interfaces except localhost and then use a tunnel to access jmx from the local node.
For the discussion on adding this feature 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
Upvotes: 2
Reputation: 832
add this:
JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=172.16.40.60"
this line is from cassandra-env.sh
in apache/cassandra
, see here: cassandra-env.sh#L204
Upvotes: 6