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:
1. Modify Cassandra server JVM opts
1.1 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
1.2 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.
2. I assume that you have Cassandra server setup done and for example following is the details of Cassandra storage configuration.
Keyspace: test
Column family: employee
Column family: department
3. 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.
I. TotalDiskSpaceUsed
II. LiveDiskSpaceUsed
III. LiveSSTableCount
IV. PendingTasks
V. WriteCount
VI. ReadCount
VII. MemtableColumnsCount
VIII. MemtableDataSize
IX. MemtableSwitchCount
X. TotalWriteLatencyMicros
XI. TotalReadLatencyMicros
3.1 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:-
<service name=” employee “>
<property name=”PROC_HOME_PROPERTY” value=”proc.java.home”/>
<plugin type=”measurement”/>
<plugin type=”autoinventory”/>
<property name=”OBJECT_NAME” value=”org.apache.cassandra.db:type=ColumnFamilyStores,keyspace=test,columnfamily=employee“/>
<metrics include=”cassandraCFMetrics”/>
</service>
<service name=” department“>
<property name=”PROC_HOME_PROPERTY” value=”proc.java.home”/>
<plugin type=”measurement”/>
<plugin type=”autoinventory”/>
<property name=”OBJECT_NAME” value=”org.apache.cassandra.db:type=ColumnFamilyStores,keyspace=test,columnfamily= department “/>
<metrics include=”cassandraCFMetrics”/>
</service>
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.
4. Download cassandra-plugin 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.
<option name=”jmx.url” description=”JMX URL to MBeanServer” default=”service:jmx:rmi:///jndi/rmi://localhost:8080/jmxrmi”/>
And save the file.
5. 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
Thanks for putting this together! Would you be open to publishing this on Hyperforge, http://support.hyperic.com/display/hypcomm/HyperFORGE, perhaps as a contributed document?
Hi Al Sergent ,
Thanks for response surly i will do this.
HI Al Sargent,
Find below link for the same:
http://support.hyperic.com/display/hypcomm/Cassandra+Monitoring+Through+Hyperic+HQ
Great, thank you.
well done sunil !!
Thanks for the post..- the information is excellent but most of all accurate.
Pingback: Monitoring Java Webapp with Hyperic HQ: Send Email When Too Many Errors in Logs « The Holy Java
Hyperic accepted this …
https://support.hyperic.com/display/hyperforge/Apache+Cassandra
The link to your plugin is broken:
https://suniluiit.files.wordpress.com/2011/02/cassandra-plugin.doc
Will this still work in cassandra 2.0.6 and hyperic 5.8.0?
There are few changes in the JMX beans of cassandra you might need to changes the JMX been classes. But procedure will remain same.
Hi gary
Not sure there might be some problem with wordpress i have done some changes now click on cassandra-plugin hyperlink.
Thanks. I was able to download the plugin now. But, as you said, it doesn’t work with the latest version of cassandra and hyperic. I’m not sure what needs to change yet.