无法在windows 10 for cassandra上运行prometheus

vsdwdz23  于 2021-06-09  发布在  Cassandra
关注(0)|答案(1)|浏览(466)

这个问题在这里已经有了答案

将.sh命令转换为.bat等效命令(1个答案)
11天前关门了。
我按照这个教程运行 PrometheusWindows10 . 本教程适用于 linux . 我想我唯一需要改变的命令是 powershell . 但是,当我尝试访问度量时,应用程序无法连接。
https://www.robustperception.io/monitoring-cassandra-with-prometheus
而不是 echo 'JVM_OPTS="$JVM_OPTS -javaagent:'$PWD/jmx_prometheus_javaagent-0.3.0.jar=7070:$PWD/cassandra.yml'"' >> conf/cassandra-env.sh ,我在 cassandra-env.ps1 ```

Default JMX setup, bound to local loopback address only

$env:JVM_OPTS="$env:JVM_OPTS -Dcassandra.jmx.local.port=$JMX_PORT"
$env:JVM_OPTS="$env:JVM_OPTS -javaagent:'$PWD/jmx_prometheus_javaagent-0.3.0.jar=7070:$PWD/cassandra.yml'"' <-- HERE

$env:JVM_OPTS="$env:JVM_OPTS $env:JVM_EXTRA_OPTS"

}

但是 `http://localhost:7070/metrics` 不起作用
现在更新,我已经删除了 `.sh` . 以及 `ps1` 并添加 `javaagent` 只在 `bin/cassanbra.bat` 文件似乎是windows所需要的
https://docs.appdynamics.com/display/pro45/apache+cassandra+startup+settings
但现在我犯了个错误

Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
Caused by: java.lang.NumberFormatException: For input string: "C"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.lang.Integer.parseInt(Integer.java:615)
at io.prometheus.jmx.shaded.io.prometheus.jmx.JavaAgent.premain(JavaAgent.java:38)
... 6 more
FATAL ERROR in native method: processing of -javaagent failed

h4cxqtbf

h4cxqtbf1#

而不是这样:

$env:JVM_OPTS="$env:JVM_OPTS -javaagent:'$PWD/jmx_prometheus_javaagent-0.3.0.jar=7070:$PWD/cassandra.yml'"'

试试这个:

$env:JVM_OPTS="$env:JVM_OPTS -javaagent:'$PWD/jmx_prometheus_javaagent-0.3.0.jar=7070:$PWD/cassandra.yml'"

我删掉了行尾的一句话。

相关问题