使用prometheus监测工具监测cassandra

时间:2017-12-08 04:41:37

标签: cassandra prometheus

我的prometheus工具在centos 7机器上,cassandra在centos 6上。我正在尝试使用prometheus监控cassandra JMX端口7199。我的yml文件一直出错。不知道为什么我无法连接到centos 6(cassandra机器)我的YAML文件是错误还是与JMX端口7199有关? 这是我的YAML文件:

我的全局配置

global:
  scrape_interval: 15s

scrape_configs:
   - job_name: cassandra
     static_configs:
       - targets: ['10.1.0.22:7199'] 

这是我的prometheus日志:

level=info ts=2017-12-08T04:30:53.92549611Z caller=main.go:215 msg="Starting Prometheus" version="(version=2.0.0, branch=HEAD, revision=0a74f98628a0463dddc90528220c94de5032d1a0)" 
level=info ts=2017-12-08T04:30:53.925623847Z caller=main.go:216 build_context="(go=go1.9.2, user=root@615b82cb36b6, date=20171108-07:11:59)" 
level=info ts=2017-12-08T04:30:53.92566228Z caller=main.go:217 host_details="(Linux 3.10.0-693.5.2.el7.x86_64 #1 SMP Fri Oct 20 20:32:50 UTC 2017 x86_64 localhost.localdomain (none))" 
level=info ts=2017-12-08T04:30:53.932807536Z caller=web.go:380 component=web msg="Start listening for connections" address=0.0.0.0:9090 
level=info ts=2017-12-08T04:30:53.93303681Z caller=targetmanager.go:71 component="target manager" msg="Starting target manager..." 
level=info ts=2017-12-08T04:30:53.932905473Z caller=main.go:314 msg="Starting TSDB" 
level=info ts=2017-12-08T04:30:53.987468942Z caller=main.go:326 msg="TSDB started" 
level=info ts=2017-12-08T04:30:53.987582063Z caller=main.go:394 msg="Loading configuration file" filename=prometheus.yml 
level=info ts=2017-12-08T04:30:53.988366778Z caller=main.go:371 msg="Server is ready to receive requests."  
level=warn ts=2017-12-08T04:31:00.561007282Z caller=main.go:377 msg="Received SIGTERM, exiting gracefully..."
level=info ts=2017-12-08T04:31:00.563191668Z caller=main.go:384 msg="See you next time!" 
level=info ts=2017-12-08T04:31:00.566231211Z caller=targetmanager.go:87 component="target manager" msg="Stopping target manager..." 
level=info ts=2017-12-08T04:31:00.567070099Z caller=targetmanager.go:99 component="target manager" msg="Target manager stopped" 
level=info ts=2017-12-08T04:31:00.567136027Z caller=manager.go:455 component="rule manager" msg="Stopping rule manager..." 
level=info ts=2017-12-08T04:31:00.567162215Z caller=manager.go:461 component="rule manager" msg="Rule manager stopped" 
level=info ts=2017-12-08T04:31:00.567186356Z caller=notifier.go:483 component=notifier msg="Stopping notification handler..."

如果有人有关于如何将prometheus连接到cassandra的指令,两者都在两台不同的机器上,这也会有所帮助。

1 个答案:

答案 0 :(得分:2)

这不是配置问题,prometheus收到TERM信号并正常终止。

如果您没有获取指标,请检查10.1.0.22:7199/metrics是否加载并返回指标。您还可以检查prometheus服务器的/targets端点以获取抓取状态。

如果您在cassandra服务器的/metrics端点上没有收到任何内容,可能是因为您没有正确配置cassandra prometheus exporter