Chapter 9. Monitoring
This chapter is about using a variety of tools to monitor and understand important events in the life cycle of your Cassandra cluster. We’ll look at some simple ways to see what’s going on, such as changing the logging levels and understanding the output.
But Cassandra also features built-in support for Java Management Extensions (JMX), which offers a rich way to monitor your Cassandra nodes and their underlying Java environment. With just a little integration work, we can see the health of the database and ongoing events, and even interact with it remotely to tune certain values. JMX is an important part of Cassandra, and we’ll spend some time to make sure we know how it works and what exactly Cassandra makes available for monitoring and management with JMX, and we’ll even write our own custom MBean to expose a new Cassandra feature. Let’s get started!
The simplest way to get a picture of what’s happening in your database is to just change the logging level to make the output more verbose. This is great for development and for learning what Cassandra is doing under the hood.
Cassandra uses Log4J for its logging utility. By default, the
Cassandra server log level is set at
INFO, which doesn’t give
you much detail about what work Cassandra is doing at any given time. It
just outputs basic status updates, such as the following:
INFO 08:49:17,614 Saved Token found: 94408749511599155261361719888434486550 INFO 08:49:17,614 Saved ClusterName found: Test Cluster ...