Wednesday, December 25, 2013

How to Retrieve Cassandra Statistics through MBeans

Cassandra exposes its statistics through MBeans. So we can simply access its MBeans and retrieve those information. There are several ways you can access MBeans  I'll explains them one by one.

1) JConsole


Type 'jconsole' in your console you will get a window like follows.


If your Cassandra server is already up, you will see org.apache.cassandra.services.CassandraDaemon in Local Process List. Double click on it and you will get following window.



Go to MBeans tab.


Here, you can see several MBeans exposed by Cassandra server. You can expand them and view information about Cassandra server and its data. For example, if you expand org.apache.cassandra.db, you can see ColumnFamilies, where you can view all statistics related to column families in your Cassandra server. And there you can see StorageServices where you can do certain of operations in Cassandra server, such as removeNode, truncate, drain etc. 

For more information about jConsole, visit http://openjdk.java.net/tools/svc/jconsole/

2) Java


We can write a simple java client to retrieve those MBean information, and even to do Cassandra cluster operations I mentioned earlier.

Here, serviceURL is the JMX URL of Cassandra server. ColumnFamilyStatsString is the one which tells which MBeans we need to access. Rest is self-explanatory and I'm not going to explain. :)  

1 comment:

  1. Step by step instructions to Solve Cassandra Java Connectivity Issue through Cassandra Technical Support
    At whatever point you are endeavoring to associate with Cassandra group utilizing Java program however in the meantime you found a blunder message with no reason at that point in what capacity may you manage that issue? Presently, what following stage you will take care of this issue? Still befuddled? No issue, we have best and proper answer for you i.e. Cassandra Customer Service or Apache Cassandra Service. Aside from network issue we additionally manages some other specialized issues like Cassandra establishment issue, Cassandra design issue et cetera. Contact to Cassandra Database Consulting and Support and get the speedy help.
    For More Info: https://cognegicsystems.com/
    Contact Number: 1-800-450-8670
    Email Address- info@cognegicsystems.com
    Company’s Address- 507 Copper Square Drive Bethel Connecticut (USA) 06801

    ReplyDelete