Apache Cassandra
Custom Plugin Details
Plugin: Apache Cassandra
Version: 1.0
Work With:
Download: http://suniluiit.files.wordpress.com/2011/02/cassandra-plugin.doc
Author: Sunil Kumar
I have written a JMX plugin for monitoring Apache cassandra through hyperic HQ.
Find below my blog link for the same:-
http://suniluiit.wordpress.com/2011/02/21/apache-cassandra-monitoring-through-hyperic-hq/
For monitoring Cassandra through Hyperic HQ server you need to write hyperic JMX plugin as well as you need to change java opts in the Cassandra server.
Follow following steps to monitor Cassandra through hyperic HQ:
#. Modify Cassandra server JVM opts
-
- For linux
- For Cassandra 0.6.x - Add parameter -Dproc.java.home=$JAVA_HOME in the file $CASSANDRA_HOME/bin/ cassandra.in.sh
- For Cassandra 0.7.x - Add parameter -Dproc.java.home=$JAVA_HOME in the file $CASSANDRA_HOME/conf/cassandra-env.sh
- For windows:
- Add parameter -Dproc.java.home=$JAVA_HOME in the file $CASSANDRA_HOME/bin/cassandra.bat
- Default Cassandra server JMX port is 8080. JMX port is required in the plugin config for monitoring.
#I assume that you have Cassandra server setup done and for example following is the details of Cassandra storage configuration.
- For linux
Keyspace: test
Column family: employee
Column family: department
- Writing Cassandra Hyperic Plugin:
Let me give brief about Hyperic JMX Plugin: – JMX plugins target remote JMX-enabled applications. They extract metrics from the Java services via MBeans. One of the main tasks of writing a JMX plugin is determining which metrics to monitor via those MBeans. JMX plugins are templatized and so you will not need to write any Java code. All you need to do is write an XML descriptor.
For more details follow http://support.hyperic.com/display/DOC/JMX+Plugin+Tutorial
In Cassandra we usually monitor column family specific parameters. Following are the metrics of Cassandra column families those are need to monitor.
- TotalDiskSpaceUsed
- LiveDiskSpaceUsed
- LiveSSTableCount
- PendingTasks
- WriteCount
- ReadCount
- MemtableColumnsCount
- MemtableDataSize
- MemtableSwitchCount
- TotalWriteLatencyMicros
- TotalReadLatencyMicros
-
- To monitor all the column families of Cassandra key space you need to make services in the Cassandra hyperic plugin for each column family. To get metrics of particular column family you need to give keyspace name and column family name to MBean ColumnFamilyStores.
Find below sample services for column families:-
Similar services you need to create for each column families of a keyspace of Cassandra .
Note: Replace org.apache.cassandra.db:type=ColumnFamilyStores with org.apache.cassandra.db:type=ColumnFamilies for cassandra 0.7.x for above services of column families.
- Download http://suniluiit.files.wordpress.com/2011/02/cassandra-plugin.doc and save as cassandra-plugin.xml. Add service according to yours storage configuration of cassanda server database. And Change JMX port in the cassandra-plugin.xml in the config section.
And save the file.
- Now deploy cassandra-plugin.xml file into the server and all agents which need to monitor the Cassandra server.
Step 1: Stop the HQ Server and Agents
Step 2: Copy the plugin file to the respective plugin directory
HQ-Server:
cp cassandra-plugin.xml <hq installation dir>/server-4.4.x/hq-engine/server/default/deploy/hq.ear/hq-plugins
HQ-Agent:
cp cassandra-plugin.xml <hq installation dir>/agent-4.4.x/pdk/plugins
Step 3: Start the HQ Server and the HQ Agents