I am setting up jmx remote access for our separate Cassandra node (4.0 running on Debian 11) and noticed that following this guide, the backup tool throws "not found" errors at me when I launch the command "StandaloneCassandraBackup.exe listsnapshot -h x.x.x.x" on our DMA, because of these added lines in the file cassandra-env.sh:
-Dcassandra.jmx.remote.port=7199 -Dcom.sun.management.jmxremote.rmi.port=7199 -Djava.rmi.server.hostname=x.x.x.x
So I removed them again and instead, followed this guide to set up jmx security and now the tool works. Due to this change and every time the backup or nodetool is used, credentials need to be provided (which still works and is OK for me).
When trying to take a snapshot however, the tool processes the series of commands without taking into account the credentials I add as arguments:
(Also when specifying the "
–path C:\Program Files\nodetool.bat" everything following the space in "Program Files" gets omitted, so that does not work. I found out that the path is not even required as the tool automatically finds nodetool.bat, so I simply do not add the path argument)
Finally, to get the creation of snapshots via standalone tool to work I had to set the following in cassandra-env.sh (default is true):
Since in the guide "Making Cassandra nodetool accessible remotely" it nowhere says to disable jmx security, this simply cannot work the way it is described as jmx needs authentication by default.
In the end, I only had to disable jmx authentication and remove the lines which caused errors at the beginning, which does not correlate with the guide.
EDIT: To summarize, I either have to enable jmx authentication and always use credentials when issuing the standalone tool and nodetool commands, but backup will NOT work as it leaves out the credentials, or I have to disable jmx authentication and everything works, but this is not described in the Skyline guide.
Maybe some files changed over time and this has not been considered? Is the tool designed to work only without jmx authentication? Or have I done an error somewhere?
Your observations are majorly correct. I was able to reproduce this issue. (DMA 10.2.8 & Cassandra 4.0 node on Ubuntu)
- The tool is not working correctly when JMX authentication is enabled specifically for backup, clearsnapshot & refresh commands.
This can be seen below where the initial Status check ignores the credentials then the actual command does not. This causes a failure at the first point (status check) when JMX authentication is enabled. Please create a task in collaboration for this to be investigated further and addressed.
- By default the tool uses this path (C:\Program Files\Cassandra\bin\nodetool.bat) for Cassandra nodetool so you dont need to specify it if thats where its installed on your system. If however it is located elsewhere you need to specify as shown and it should work ok.
StandaloneCassandraBackup.exe listsnapshot -h 10.10.10.10 --path "D:\Program\Cassandra\bin\nodetool.bat"
- The documentation can indeed be improved to indicate clearly:
a) The actual full lines to be entered when updating the cassandra-env.sh file.
b) When making nodetool accessbile remotely, JMX authentication needs to be factored in. Addtional options (as you've shown) can be set in the cassandra-env.sh file to either enable or disable this.
JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.authenticate=false" <Disables Authentiation which is enabled by default>
How to setup JMX authentication might be beyond the scope of the documentaion but maybe some external links can be provided.
(You can also help improve the documentaion if you wish).
- I believe the tool is designed to work with or without Authentication. (If Point 1 is addressed).
- As you indicated everthing works if you disable authentication.