convert a .sh command into .bat equivalent

天涯浪子 提交于 2021-02-05 09:12:05

问题


I am following this tutorial to run jmx_exporterwithcassandra`

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!