问题
I am following this tutorial to run jmx_exporterwith
cassandra`
https://www.robustperception.io/monitoring-cassandra-with-prometheus
I have found that instead of changing JVM_OPTS
in cassandra-env.sh
file, I should change bin/cassandra.bat
to make javaagent
work (I tried adding JVM_OPTS
in both .sh
and .ps1
but none worked)
https://docs.appdynamics.com/display/PRO45/Apache+Cassandra+Startup+Settings
The challenge I am facing is converting
JVM_OPTS="$JVM_OPTS -javaagent:'$PWD/jmx_prometheus_javaagent-0.3.0.jar=7070:$PWD/cassandra.yml'"'
into equivalent in the .bat
file
I have tried the following but none works
-javaagent:"C:\Users\manuc\Documents\manu\apache-cassandra-3.11.6-for-scalardb\jmx_prometheus_javaagent-0.3.0.jar=7070:cassandra.yml"^
and
-javaagent:"%CASSANDRA_HOME%\jmx_prometheus_javaagent-0.3.0.jar=7070:%CASSANDRA_HOME%\cassandra.yml"^
I see error - The filename, directory name, or volume label syntax is incorrect.
Has anyone tried running prometheus-jmx
on windows? Any tips on how I can solve the issue?
回答1:
I got it working by using path javaagent:"%CASSANDRA_HOME%\lib\jmx_prometheus_javaagent-0.3.0.jar=7070:cassandra.yml"^
But I can't do
javaagent:"%CASSANDRA_HOME%\lib\jmx_prometheus_javaagent-0.3.0.jar=7070:%CASSANDRA_HOME%\cassandra.yml"^
It seems I can't use CASSANDRA_HOME
within a path
来源:https://stackoverflow.com/questions/65357086/convert-a-sh-command-into-bat-equivalent