jmxtrans没有为ganglia创建kafka度量的rrd

bgtovc5b  于 2021-06-08  发布在  Kafka
关注(0)|答案(1)|浏览(387)

我正试图用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度量,rrd是生成的。如果我有任何配置错误或其他问题,请提出建议。

tvokkenx

tvokkenx1#

从您的日志文件中可以看到,没有指标发送给gmond。json文件中有错误。对于正确的工作,请更换: "obj": "kafka.server:type=BrokerTopicMetrics,name=*","obj": "kafka.network:type=RequestMetrics,name=Produce-RequestsPerSec", 重新启动jmxtrans守护程序,您应该在jmxtrans日志文件中看到如下内容: [12 Sep 2015 01:25:11] [pool-22-thread-1] 630550 DEBUG (com.googlecode.jmxtrans.util.JmxUtils:195) - Executing queryName: kafka.server:name=BytesInPerSec,type=BrokerTopicMetrics from query: Query [obj=kafka.server:type=BrokerTopicMetrics,name=*, resultAlias=Kafka, attr=[Count, OneMinuteRate]]

相关问题