You can monitor your katta cluster with your favorit server monitoring tool, like Nagios, Cacti, Ganglia or others. However Katta now provides a Monitoring API as well.

How it works

When a node starts it also starts a Monitor that can report metrics to any kind of system. A Monitor is a class that implements the IMonitor interface. Katta comes with at least one implementation of this interface (JmxMonitor), you can write your own monitor or use a third party provided monitor (they are not shipped with katta).  In you can configure the monitor that will be used.


Unfortunately the metrics the JVM provides are limited and other solutions are platform depending or not Apache License. The only source of metrics provided in the JVM are are some JMX Beans. The JmxMonitor uses those Jmx Beans and pushes this kind of metrics to zookeeper.

In the moment following metrics are generated by the JmxMonitor:

ProcessCpuTime, TotalSwapSpaceSize, FreeSwapSpaceSize, FreePhysicalMemorySize, TotalPhysicalMemorySize, CommittedVirtualMemorySize,heapMemoryUsageMax, heapMemoryUsageUsed, heapMemoryUsageInit, heapMemoryUsageCommited, nonHeapMemoryUsageMax, nonHeapMemoryUsageUsed, nonHeapMemoryUsageInit, nonHeapMemoryUsageCommited, collectionCount_ParNew,collectionCount_ConcurrentMarkSweep,collectionTime_ParNew,collectionTime_ConcurrentMarkSweep.

The JmxMonitor pushes every 1 second a MetricRecord with collected values  to zookeeper /katta/server-metrics/nodeId. A client can subscribe to updates of this zookeeper node and store them in a log file or database.


The MetricsLogger is a simple implementation of a client that subscribes to the metrics updates of all nodes. It can write the updates straight to the console or to a log4j file. For production using log4j and a RollingFileAppender is recommended.
The MetricsLogger can be started from the command line with
$ bin/katta logMetrics sysout OR $ bin/katta logMetrics log4j