Graphite/Old
From charlesreid1
Installing
Prerequisites
PyCairo prerequisite: PyCairo
Installing Graphite
Git checkout
cd git dir
python setup.py build && python setup.py install
Installing Carbon
python setup.py build && python setup.py install
Installing Whisper
python setup.py build && python setup.py install
Setting Things Up
Once you've installed everything, assuming you went with the default installation configuration, graphite will be in /opt/graphite
. That includes Graphite web app frontends, Carbon, and Whisper.
Now I'll cover how to get each component running and get simple I/O working.
Setting Up Graphite
I followed these instructions for getting Graphite set up and installed and running and all that:
I installed graphite from source to the default location:
The way to test Graphite is not really to test it on its own, but rather to test it via/with Carbon.
Setting Up Carbon
To get Carbon running, you have to start with some configuration files, described on this page:
Basically, you give some thought to your schema - see this page http://graphite.wikidot.com/getting-your-data-into-graphite for information on what I mean. Decide your time series data naming convention, then decide how much data to gather, at what frequency.
Enter information about your storage schema in your storage-schemas.conf
file, located in /opt/graphite/conf/storage-schemas.conf
; example:
[dummy] priority = 100 pattern = dummy retentions = 1:7200
which will gather data at a frequency of 1 Hz for 2 hours (7200 seconds total).
There are a couple of other files to modify, specifically relay-rules.conf
and carbon.conf
. For these, I used the examples provided by the installation.
Once you've finished, it's time for the hello world tests.
Hello World
Hello Carbon World
Start
First step is to start Carbon:
/opt/graphite/bin/carbon-cache.py start
If you see some regular expression problems, try fixing your regular expression in your storage-schemas configuration file, in the "pattern" field.
Log Files
Once you've started Carbon, take a look at the log files in
/opt/graphite/storage/log/carbon-cache/
Sending Data to Carbon
When it comes to describing how to send data to Carbon, the Graphite documentation is pretty pathetic. Here's their page:
http://graphite.readthedocs.org/en/latest/feeding-carbon.html
What's missing is any description of how to check if Carbon has received the data correctly, what the messages in the log file mean, or even whether a piece of data has been processed by Carbon at all, or whether it has been put into a database. For that matter, maybe some description of whether Carbon has connected to the MongoDB database? Or how about some indication if the database isn't even running?
If you send data to the port, using the nc command given in the Graphite documentation,
echo "channel.name 12345 `date +%s`" | nc $SERVER $PORT
you can check the listener log file and see something like this for each piece of data you send to the port Graphite/Carbon is listening to (specified with DESTINATION in carbon.conf file):
25/06/2014 13:59:49 :: MetricLineReceiver connection with 127.0.0.1:50930 established 25/06/2014 13:59:49 :: MetricLineReceiver connection with 127.0.0.1:50930 closed cleanly
Hello Graphite Webapp World (Crap Version)
Following this page:
You can configure your Graphite webapp using the configuration file settings described in the link above.
Following this page:
You can go through a simple example step-by-step.
I copied local_settings.py.example
to local_settings.py
and set DEBUG = True
in the config file.
Next, you'll start the Carbon data collector:
python /opt/graphite/bin/carbon-cache.py --debug start
Now run one of the example scripts,
$ python /opt/graphite/examples/example-client.py sending message -------------------------------------------------------------------------------- system.loadavg_1min 1.46 1403734071 system.loadavg_5min 1.26 1403734071 system.loadavg_15min 1.20 1403734071
Now you can check the whisper storage directory, located in /opt/graphite/storage/whisper/
, and verify that data is being dumped into the proper buckets:
$ ls /opt/graphite/storage/whisper/ system $ ls -l system/ total 120 -rw-r--r-- 1 charlesreid admin 17308 Jun 25 15:08 loadavg_15min.wsp -rw-r--r-- 1 charlesreid admin 17308 Jun 25 15:08 loadavg_1min.wsp -rw-r--r-- 1 charlesreid admin 17308 Jun 25 15:08 loadavg_5min.wsp
Hello Graphite Webapp World (Good Version)
http://kaivanov.blogspot.com/2012/02/how-to-install-and-use-graphite.html
Yet another example/guide:
http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
ModWSGI
After dealing with a bunch of ModWSGI issues, I finally saw this dashboard when I started Apache and go to 0.0.0.0:
There are things on the page, but everything is broken. (Probably because of a bunch of 403s, shown when I pop open a browser console:)