Graphite installation for Ubuntu

Does anyone know of a modern guide for getting graphite running on Ubuntu?

I feel like I have read over and tried almost all of the older articles and tutorials out there and each one has outdated information in some respect.

I’d like to get graphite installed from apt packages and working with either the local database or even mysql or something else… I don’t care if the webserver is apache or nginx… I am just struggling to find a set of instructions that gets me the entire way through it. The official documents cover source and docker etc…

I’ve gotten really close but something always burns me after I put in all the work following what I have found.

1 Like

I just tried another blog post and it also was not accurate any longer.

I’ll try using the src packages again.

No luck with the pip instructions… I got to the webserver part and apache wouldn’t work.

I tried another set of instructions and still no luck.

I see perfdata and whisper files generated but I seem to be having trouble graphite-web more than anything. I just can’t get it to work.

personally I would prefer to use influxdb as it is much nicer to configure and allaround much more userfriendly.
As an alternative you could use bodos graphite container: https://github.com/bodsch/docker-graphite

Influxdb works with grafana. Grafana seems to require that I manually add dashboards and graphs for ever service check.

Graphite just seems to automatically create everything.

If you are having issues with the installation, I also suggest going the way of docker containers.

Have a look at the official image:
https://hub.docker.com/r/graphiteapp/graphite-statsd

or 3rd party: https://hub.docker.com/r/vimagick/graphite

Thanks but I’d rather not run docker. It seems like such a simple installation yet I cannot get it to work correctly. The funny thing is I did years ago… maybe it’s a problem with Ubuntu 18.

there is a way to automagically get the desired Graphs for integration with icingaweb2 via the icingaweb2 grafana module from @anon66228339

My understanding is that I need to create graphs from dashboards for each thing I want to graph.

Like hostalive, disk, CPU, etc… I have tons of services.

not really, carsten delivers a dashboard that you can upload to grafana, which takes care of building the graphs for you, I am using it in a rather small production environment of 50+ Servers and it works like a charm.

Hi,

from my experience, any package for Graphite is old and the howtos never match it. My way of installing Graphite is with pip and I have abstracted it into a Puppet module/profile inside the Vagrant boxes.

Once you master the installation, everything else is a breeze, especially with adding the web module then.

Where exactly are you at now?

Cheers,
Michael

@KevinHonka please leave the InfluxDB bits out of this topic, we’ve already had this here and here.

I’m confused. I had it working… using the included basic-metrics dashboard … the included icinga2 default dashboard appeared to be empty.

The basic metric dashboard had the templating and variables there to filter through hosts in grafana for some predefined services like ping4 etc…

For my other services like checking windows disks and memory or powershell checks I had to add those to the dashboard to create graphs. Then I had to create a graph in the module for that and pick the correct graph panel I’d to display…

Then I ended up with duplicate graphs on multiple hosts. It was confusing.

Graphite just automatically starts handling everything… if I could just get the Web interface running correctly. :frowning:

Getting the official Graphite module working in Icinga is kind of essential to the serenity of my existence, so as much as I love Grafana, definitely go with that first.

Have you tried doing it with pipenv on python36? I think the newest Ubuntu should ship a pipenv package, otherwise it’s python3 -m ensurepip && pip3 install --upgrade pip pipenv . I use Gunicorn to serve Graphite and nginx as a reverse proxy + static content delivery (which Apache will totally do if you have a preference).

That’s probably all poorly documented also. I think I’ll just write one this weekend because people ask this a lot and I uttered a lot of obscenities figuring it out.

I get to the point where I configured local_settings.py with a key and timezone etc… then run manage.py migrate --run-syncdb

I move in to the Web server part and this is where I have the most trouble.

I’ve tried using Apache with the instructions provided by them and the page never loads and the log complains it can’t load graphite.wsgi as a python file.

I tried nginx with gunicorn also… I always seem to end up with errors when it comes to the Web server. It usually ends up with my googling for hours reading through semi related problems that are old on GitHub and trying random fixes that don’t work.

Glad to hear I’m not alone. I’d appreciate a working set of instructions if you feel you can do it and have the time.

You would probably save a lot of people a lot of time.

I’ll try python as I think I’ve been using 2.7

Well, while I happen to be at my work computer, here’s some of my config I have laying around if you want to circle back to the other thing you tried.

Systemd module for graphite/gunicorn:

[Unit]
Description = Graphite

[Service]
Environment=PYTHONPATH=/opt/graphite/webapp
User = nginx
Group = nginx
WorkingDirectory = /opt/graphite/webapp
PIDFile = /var/run/graphite/graphite.pid
ExecStart = /usr/bin/python3 /usr/local/bin/gunicorn --bind 0.0.0.0:8000 graphite_wsgi:application
ExecReload = /bin/kill -s HUP $MAINPID
ExecStop = /bin/kill -s TERM $MAINPID

[Install]
WantedBy = multi-user.target

So replace those paths with wherever you have graphite/gunicorn obviously. I installed graphite with pip.

In my example, it’s going off the following path for the wsgi part:
/opt/graphite/webapp/

I feel like in a lot of breakdowns, they don’t get that file in the right place. It should be at the root of your PYTHONPATH variable. That was modified from /opt/graphite/conf/graphite.wsgi.example So if from the command line you try

cd /opt/graphite/webapp
export PYTHONPATH=/opt/graphite/webapp
gunicorn --bind 0.0.0.0:8000 graphite_wsgi:application

You can see if it starts serving. You’ll probably get a blank page with a heading because gunicorn doesn’t serve static content.

EDIT: I don’t see myself having mentioned that example file is presently named graphite_wsgi.py. As you can see graphite_wsgi:application is excluding that file extension. I just started learning django so I can’t tell you why yet, but that’s what I had to do to get it to work lol

And if nginx:

        location /graphite/ {
           proxy_pass http://127.0.0.1:8000/graphite/;
           # or wherever you put it, check URL_PREFIX in local_settings.py
        }

        location /graphite/static {
           alias /opt/graphite/webapp/content;
           expires max;
        }
1 Like

Thanks I’ll review as these do seem to be troubled areas of the install.

I feel like the problems definitely are related to wsgi/python/Django.

If you you can repeat a working installation I’d love to see how you do it.

@dokon wrote a blog post (German) in the past, I’m not sure if that’s still accurate.

1 Like

Hi Colin,

I hope i can soon publish a new guide, but as today we are not too far away from the the upcoming distro releases for Debian Buster and the upcoming Centos 8 Version after the release of RHEL 8.

There are so many packet changes that i will publish new guides for both.
None the less if i find some time i also update the Guides for Debian 9 and Centos 7 for the actual needed Packages.

If you have any specific Questions please feel free to ask here in the Community or directly on the Blogpost topics even when they are in a different language.

Regards

David

2 Likes

I haven’t tried this one though it does look pretty similar to the others. It can’t hurt to try though.

On a test vm I did manage to successfully install graphite with nginx using a russian guide I found but it involved me googling for hours and basically changing things so rapidly I’m not even sure how I managed to get it running. To duplicate this I feel I would just have to get lucky again and find the correct URL or github post that has the obscure command or setting that is missing for each part that breaks. I’m not sure I could replicate it in production and if I did I’m not sure how good I would feel about the installation lol

A modern clean guide would really help me and I’m sure many others. The hard part is finding someone who knows exactly what to do and also has the time to write it all down to share.

One thing that is different in a lot of these articles/guides is the graphite-manage syncdb command.

I assume this is replaced by graphite-manage migrate --run-syncdb now.