我正在尝试使用 jmxtrans 和 ganglia 监控 kafka 经纪人。但是使用下面的 json,不会创建 rrd。
{
"servers": [
{
"port": "9999",
"host": "localhost",
"queries": [
{
"outputWriters": [
{
"@class": "com.googlecode.jmxtrans.model.output.GangliaWriter",
"settings": {
"groupName": "kafka topic stats",
"port": 8649,
"host": "localhost",
"typeNames":[
"name"
]
}
}
],
"obj": "\"kafka.server\":type=\"BrokerTopicMetrics\",name=\"*\"",
"resultAlias": "Kafka",
"attr": [
"Count",
"OneMinuteRate"
]
},
{
"outputWriters": [
{
"@class": "com.googlecode.jmxtrans.model.output.GangliaWriter",
"settings": {
"groupName": "kafka server request",
"port": 8649,
"host": "localhost"
}
}
],
"obj": "\"kafka.network\":type=\"RequestMetrics\",name=\"Produce-RequestsPerSec\"",
"resultAlias": "produce",
"attr": [
"Count",
"OneMinuteRate"
]
}
],
"numQueryThreads": 2
}
]
}
jmxtrans.log 中打印的日志是
[01 Sep 2015 11:53:28] [SIGTERM handler] 4030449 DEBUG (com.googlecode.jmxtrans.JmxTransformer:463) - Stopped writer: GangliaWriter for query: Query [obj="kafka.network":type="RequestMetrics",name="Produce-RequestsPerSec", resultAlias=produce, attr=[Count, OneMinuteRate]]
[01 Sep 2015 11:54:33] [main] 0 DEBUG (com.googlecode.jmxtrans.JmxTransformer:223) - Loaded file: /usr/share/jmxtrans/kafka-test.json
[01 Sep 2015 11:54:33] [main] 5 DEBUG (com.googlecode.jmxtrans.JmxTransformer:297) - Scheduled job: localhost:9999-1441088673052 for server: Server [host=localhost, port=9999, url=null, cronExpression=null, numQueryThreads=2]
[01 Sep 2015 11:54:33] [ServerScheduler_Worker-1] 9 DEBUG (com.googlecode.jmxtrans.jobs.ServerJob:31) - +++++ Started server job: Server [host=localhost, port=9999, url=null, cronExpression=null, numQueryThreads=2]
[01 Sep 2015 11:54:33] [ServerScheduler_Worker-1] 38 DEBUG (com.googlecode.jmxtrans.util.JmxUtils:95) - ----- Creating 2 query threads
[01 Sep 2015 11:54:33] [ServerScheduler_Worker-1] 43 DEBUG (com.googlecode.jmxtrans.jobs.ServerJob:50) - +++++ Finished server job: Server [host=localhost, port=9999, url=service:jmx:rmi:///jndi/rmi://localhost:9999/jmxrmi, cronExpression=null, numQueryThreads=2]
[01 Sep 2015 11:55:33] [ServerScheduler_Worker-2] 60006 DEBUG (com.googlecode.jmxtrans.jobs.ServerJob:31) - +++++ Started server job: Server [host=localhost, port=9999, url=service:jmx:rmi:///jndi/rmi://localhost:9999/jmxrmi, cronExpression=null, numQueryThreads=2]
[01 Sep 2015 11:55:33] [ServerScheduler_Worker-2] 60008 DEBUG (com.googlecode.jmxtrans.util.JmxUtils:95) - ----- Creating 2 query threads
[01 Sep 2015 11:55:33] [ServerScheduler_Worker-2] 60014 DEBUG (com.googlecode.jmxtrans.jobs.ServerJob:50) - +++++ Finished server job: Server [host=localhost, port=9999, url=service:jmx:rmi:///jndi/rmi://localhost:9999/jmxrmi, cronExpression=null, numQueryThreads=2]
[01 Sep 2015 11:56:33] [ServerScheduler_Worker-3] 120006 DEBUG (com.googlecode.jmxtrans.jobs.ServerJob:31) - +++++ Started server job: Server [host=localhost, port=9999, url=service:jmx:rmi:///jndi/rmi://localhost:9999/jmxrmi, cronExpression=null, numQueryThreads=2]
[01 Sep 2015 11:56:33] [ServerScheduler_Worker-3] 120008 DEBUG (com.googlecode.jmxtrans.util.JmxUtils:95) - ----- Creating 2 query threads
[01 Sep 2015 11:56:33] [ServerScheduler_Worker-3] 120014 DEBUG (com.googlecode.jmxtrans.jobs.ServerJob:50) - +++++ Finished server job: Server [host=localhost, port=9999, url=service:jmx:rmi:///jndi/rmi://localhost:9999/jmxrmi, cronExpression=null, numQueryThreads=2]
[01 Sep 2015 11:57:33] [ServerScheduler_Worker-4] 180006 DEBUG (com.googlecode.jmxtrans.jobs.ServerJob:31) - +++++ Started server job: Server [host=localhost, port=9999, url=service:jmx:rmi:///jndi/rmi://localhost:9999/jmxrmi, cronExpression=null, numQueryThreads=2]
[01 Sep 2015 11:57:33] [ServerScheduler_Worker-4] 180009 DEBUG (com.googlecode.jmxtrans.util.JmxUtils:95) - ----- Creating 2 query threads
[01 Sep 2015 11:57:33] [ServerScheduler_Worker-4] 180014 DEBUG (com.googlecode.jmxtrans.jobs.ServerJob:50) - +++++ Finished server job: Server [host=localhost, port=9999, url=service:jmx:rmi:///jndi/rmi://localhost:9999/jmxrmi, cronExpression=null, numQueryThreads=2]
但是我试图获取正常的java内存信息而不是kafka metrices,生成了rrd。请建议我是否犯了任何配置错误或其他问题。