使用MetricsServlet在Cassandra中获取指标 [英] Using MetricsServlet to fetch metrics in Cassandra

查看:59
本文介绍了使用MetricsServlet在Cassandra中获取指标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获取我的每个Cassandra节点(不使用JMX)作为JSON对象的各种指标,例如读/写延迟,磁盘利用率等。在我看来, MetricsServlet 可以做到这一点。但是,我仍然无法弄清楚,要使用它,我需要做些什么(Cassandra不附带metrics-servlets)。如果能得到一些建议/示例代码(用于获取任何指标),我将不胜感激。

I want to fetch various metrics like read/write latency, disk utilisation etc. of each of my Cassandra nodes(without using JMX) as a JSON object. It seems to me that MetricsServlet, can do exactly that. However, I'm still not able to figure out, what all do I need to do in order to use it(metrics-servlets does not come with Cassandra). I'll appreciate if I can get some advice/sample code(for fetching any metric).

推荐答案

Cassandra不是Java Web服务器,它不支持Servlet。您需要在与Cassandra相同的JVM中启动Java Web服务器并加载这些servlet。虽然可能通过JMX查询指标并使用外部应用程序将其转换为JSON或使用 MX4J (我会推荐)

Cassandra is not a java web server, it doesnt support servlets. You would need to start a java web server in same JVM as Cassandra and load those servlets. While possible its probably a lot less work to just query the metrics via JMX and convert to JSON with an external application or to expose JMX via http with something like MX4J (what I would recommend)

这篇关于使用MetricsServlet在Cassandra中获取指标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆