Sunday, December 9, 2018

Securing JMX Authentication in Cassandra

Securing connection of nodetool, JConsole and JVisualVM in Cassandra.

1) In cassandra-env.sh file update the following line for JMX authentication to true.

You will have two options for local and remote connection.

JVM_OPTS='$JVM_OPTS -Dcom.sun.management.jmxremote.authenticate=true"
JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.password.file=/etc/cassandra/jmxremote.password"

2) Edit the jmxremote.password file

Copy the template from /<jre_install_dir>/lib/management/jmxremote.password.template and rename it to jmxremote.password and place it under /etc/cassandra

3) Now you need to change the permission of the jmxremote.password file
chown cassandra:cassandra /etc/cassandra/jmxremote.password
chmod 400 /etc/cassandra/jmxremote.password

4) Now edit the jmxremote.password file for user and password.
cassandrauser cassandrapassword

5) Also add cassandra with readwrite permission to /<jre_install_directory>/lib/management/jmxremote.access file
cassandra readwrite

6) Restart DSE/Cassandra
service dse restart
or
service cassandra restart

7) Test it by connecting through nodetool command or JConsole or JVisualVM

***

No comments:

Post a Comment