【问题标题】:monitoring cassandra with prometheus monitoring tool使用 prometheus 监控工具监控 cassandra
【发布时间】:2018-05-22 07:31:50
【问题描述】:

我的 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'] 

这是我的普罗米修斯日志:

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 的说明,两者都在两台不同的机器上,那也会很有帮助。

【问题讨论】:

    标签: cassandra prometheus


    【解决方案1】:

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

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

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

    【讨论】:

    • 我应该在哪里安装 jmx 导出器?它应该与cassandra在同一台机器上还是与prometheus在同一台机器上。我的 prometheus 和 cassandra 在不同的机器上。
    • 它已添加到 cassandra 本身。请阅读上面的链接页面了解安装、配置和使用说明。
    • 泰。这有帮助。现在我的 prometheus 可以远程监控 cassandra。
    猜你喜欢
    • 2022-11-04
    • 1970-01-01
    • 1970-01-01
    • 2016-05-29
    • 2020-08-09
    • 1970-01-01
    • 2020-09-08
    • 2020-05-27
    • 1970-01-01
    相关资源
    最近更新 更多