Installing Graphite on CentOS

Install Graphite
on centOS

Graphite is a very powerful set of tools for monitoring and graphing server performance created in 2006. Graphite is still wildly used, but it’s now falling behind more modern monitoring solutions such as the trendy solution InfluxDB / Graphana.

Graphite Architecture

Graphite is a set of monitoring tools composed of:

  • carbon – A (few) daemons in charge of listening for data (TCP/UDP)
  • whisper – A database library for storing time series data
  • graphite webapp – A Django webapp that renders graphs

graphite achitecture

CollectD can be used to record and push monitoring metrics into carbon-cache.

Install Graphite

Requirement

Open a terminal and install the required tools:

Download and install Graphite

The following code snippet will download the last version of Graphite (carbon and web) and install writy my essay it all into /opt/graphite:

Configure Graphite

This code snippet creates the local database (SQLite). It also imports some static content for Graphite-webapp, and write my essay creates some folders with the correct permissions.

By default, the Apache package provided in CentOS is restrictive with regard to directory aliases. Edit graphite Apache conf to allow the static directory:

Start Graphite

Carbon’s daemons can be started with systemd. Graphite-WebApp is an apache website. To start both simply run:

Access Graphite-WebApp

Open your browser at http://localhost/

Warning! To access a remote IP such as http://remote_ip/ you need to set rules in the CentOS default firewall, or simply disable it:

No data should be available yet as we haven’t sent any metrics to Graphite.

graphite webapp

Send Metrics to Graphite

Install CollectD

To collect and push metrics to Graphite, we like to use CollectD. To install CollectD, follow these easy instructions:

Configure CollectD

If you followed the instructions to install CollectD on CentOS, edit the configuration file located in /opt/collectd/etc/collectd.conf. Using the write_graphite plugin, forward CollectD metrics to Graphite on port 2003:

Start CollectD

If you installed the systemd script, simply run:

 You can also start CollectD manually with:

Wait a few seconds, then open Graphite-WebApp. You should see some new metrics in the left panel. Open one of them to render it.
Warming! by default Graphite-WebApp renders a 24 hour graph. To see some data points, zoom in or wait a bit longer.

graphite graph

Troubleshooting

If you follow the steps above exactly, everything should work just fine. If you don’t see any data in Graphite, try a few of these ideas.

Restart CollectD with Logging

Edit CollectD configuration and enable logging:

You shouldn’t see any messages like “write_graphite plugin: Connecting to localhost:2013 via tcp failed. The last error was: failed to connect to remote host: Connection refused”

Check Carbon-cache

Check the carbon-cache log:

Check Graphite-WebApp log

Check that All Processes are Running

Make sure every necessary process is running:

Conclusion

Graphite is an incredible tool: easy to install, fast and flexible. Since its creation in 2006 it has seen the development of many plugins and tools. But it is getting a bit outdated by the next generation of monitoring tools, such as the trendy Grafana / Influx, which promise more flexibility and scalability.

The problem with graphite: it’s easy to monitor, but you need to spend your time watching all metrics to spot malfunctions. To solve this problem you could install Skyline to detect anomalies, but this will only detect (very) obvious problems. To monitor and detect complex anomalies in real time, sign up with Anomaly.io.

Monitor & detect anomalies with Anomaly.io

SIGN UP
help with term papers