我已经在centos7机器上安装了Jolokia,并尝试使用Jolokia agent拉取Kafka指标,并使用Nagios plugin check_jmx4perl与Icinga监控工具集成。下面是我遵循的配置步骤
步骤1:下载jolokia-jvm-1.3.4-agent.jar
步骤2:复制到/home/usr/
步骤3:通过发出命令chmod a+x /home/usr/jolokia-jvm-1.3.4.jar
提供权限
步骤4:通过发出命令export KAFKA_OPTS="$KAFKA_OPTS -javaagent:/home/usr/jolokia-jvm-1.3.4-agent.jar=host=*"
添加到类路径
步骤5:在独立模式下启动Zookeeper和Kafka,并尝试通过显示消息来获取工作正常的主题列表
INFO: No access restrictor found, access to all MBean is allowed
Jolokia: Agent started with URL http://0:0:0:0:0:0:0:0:8778/jolokia/
步骤6:通过发出命令j4psh http://localhost:8778
测试jolokia代理
Connection refused
我也尝试过提供IP地址,但问题仍然是一样的。是否需要在etc/hosts文件中输入主机?
发布于 2017-08-31 22:49:16
不确定您是否与this question是同一个OP,但是:
也许您需要完全限定jar的路径。我的看起来是这样的,并且工作正常:
export JOLOKIA_HOME=/libs/java/jolokia/1.3.7
export JOLOKIA_JAR=$JOLOKIA_HOME/jolokia-jvm-1.3.7-agent.jar
export KAFKA_OPTS="-javaagent:$JOLOKIA_JAR=port=7778,host=* $KAFKA_OPTS"
当我在非守护程序模式下启动Kafka时,它会打印以下内容:
I> No access restrictor found, access to any MBean is allowed
Jolokia: Agent started with URL http://10.8.36.121:7778/jolokia/
然后我把我的浏览器指向http://localhost:7778/jolokia/search/,我得到:
{
"request": {
"mbean": "*:*",
"type": "search"
},
"value": [
"kafka.network:name=ResponseQueueTimeMs,request=ListGroups,type=RequestMetrics",
"kafka.server:delayedOperation=topic,name=PurgatorySize,type=DelayedOperationPurgatory",
"kafka.server:delayedOperation=Fetch,name=NumDelayedOperations,type=DelayedOperationPurgatory",
"kafka.network:name=RemoteTimeMs,request=Heartbeat,type=RequestMetrics",
<-- SNIP -->
"kafka.network:name=LocalTimeMs,request=Offsets,type=RequestMetrics"
],
"timestamp": 1504188793,
"status": 200
}
j4psh还与以下各项连接:
j4psh http://localhost:7778/jolokia
发布于 2019-03-12 21:11:53
添加到KAFKA_OPTS:
javaagent:/usr/share/java/kafka/jolokia-jvm-1.6.0-agent.jar -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost -Dcom.sun.management.jmxremote.rmi.port=9999 -Djava.security.auth.login.config=/var/private/sasl_acl/kafka.server.jaas.config
https://stackoverflow.com/questions/45978969
复制相似问题