0

I'm usinig DataStax Cassandra service on Windows machine.

For browsing JMX Cassandra metrics I've chosen The JMX-to-HTTP tool called Jolokia (https://jolokia.org).

That's what I'm doing in order to attach jolokia agent to Cassandra:

  1. Put the jolokia-jvm-agent.jar in C:\Program Files\DataStax Community\apache-cassandra\lib folder
  2. Placed the following command at the end of cassandra-env.ps1 file (C:\Program Files\DataStax Community\apache-cassandra\conf\cassandra-env.ps1):

$env:JVM_OPTS = "$env:JVM_OPTS -javaagent:""$env:CASSANDRA_HOME\lib\jolokia-jvm-agent.jar"""

  1. Restarted the DataStax Cassandra Community Server

Unfortunately, nothing happened, Jolokia is not available via http: http://localhost:8778/jolokia/read/java.lang:type=Memory/HeapMemoryUsage

Could anyone to advice how to attache javaagent properly in my case ?

  • Added the following line -javaagent:"%CASSANDRA_HOME%\lib\jolokia-jvm-agent.jar"^ in cassandra.bat and launch it as a console application. Jolokia has started working. However I still don't understand how to do the same for DataStax Cassandra service – Ilya Khorev Feb 10 '16 at 15:20
  • post your cassandra.bat file so we can see what you're doing in there. DataStax Cassandra should be started using bin/dse cassandra --options – apesa Feb 10 '16 at 16:15
  • https://github.com/weirdy/sources/blob/master/cassandra.bat I've added line 58 in this file and after launchin this file as a console app - Jolokia normally wokrs. But when as soon as I've restarted Cassandra windows service, Jolokia has stopped working – Ilya Khorev Feb 10 '16 at 17:08
  • Are you executing this bat file as administrator in Windows? ALso, what does the cassandra log file say and the jolokia log. Look for errors that have to do with ports being used or missing connections on 7199 JMX port – apesa Feb 10 '16 at 17:22
  • No, I executed this with no administration privileges. OK, I've just notices that this bat file is not used by cassandra windows service, seems like it is used only during installation of windows service. Therefore in my opinion I should reinstall the service in order to apply the changes. – Ilya Khorev Feb 10 '16 at 17:35
  • well its windows so I would try to run the cassandra.bat file with admin privileges. When installed the directories that cassandra writes and reads from probably are not permissioned for your user. Also, do you have a dse executable in the dse bin dir? You should also start Cassandra first and then attach agents following the successful start of cassandra. Also please start looking in your log files for more detailed reasons why things are not working. – apesa Feb 10 '16 at 17:39
  • You've probably misunderstood me. As I said, Jolokia normally started when I launched cassandra.bat as a console app (with no admin privel.). However, any changes in cassandra.bat or cassandra.ps1 are not taken into consideration by DataStax Cassandra service and therefore after restarting of this server - Jolokia is even not attached. I've looked through the log files - there are no any errors. BTW, what is dse ? – Ilya Khorev Feb 10 '16 at 17:52
  • By calling the cassandra.bat file as a console app you are invoking the cassandra.ps1 script that in turn starts cassandra and then follows with the -javaagent directives. If you stop and restart cassandra as a service it will not re-read the cassandra.bat file. Is that your problem? DSE is a Datastax component, was wondering if it was installed.. You don't need it BTW. – apesa Feb 10 '16 at 18:14
  • You may be experiencing this issue: https://github.com/rhuss/jolokia/issues/198. The workaround is to remove the -XX:+PerfDisableSharedMem flag. – Tyler Hobbs Feb 10 '16 at 18:30

0 Answers0