User Tools

Site Tools


graphite_on_debian

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
graphite_on_debian [2014/04/08 12:09]
morten
graphite_on_debian [2017/08/18 07:29]
morten update link
Line 3: Line 3:
 This is a short guide to installing and configuring a Graphite installation dedicated to NAV on a Debian Wheezy-based server. ​ This is a short guide to installing and configuring a Graphite installation dedicated to NAV on a Debian Wheezy-based server. ​
  
 +<note tip>
 +The installation procedure is largely the same on Debian Jessie, but the carbon-cache that comes with Jessie'​s ''​graphite-carbon''​ package (0.9.12) has horrible performance characteristics,​ for some reason. We've opted to keep using the old version from Wheezy (0.9.10) to keep the same performance.
 +</​note>​
 ===== Getting Graphite ===== ===== Getting Graphite =====
  
 A full Graphite setup consists of the Carbon backend server, which receives metrics over TCP or UDP, and a Graphite web frontend, which enables browsing and retrievial/​rendering of the stored metrics. NAV will collect metrics and send to the former, while utilizing the latter to retrieve metrics and render graphs. A full Graphite setup consists of the Carbon backend server, which receives metrics over TCP or UDP, and a Graphite web frontend, which enables browsing and retrievial/​rendering of the stored metrics. NAV will collect metrics and send to the former, while utilizing the latter to retrieve metrics and render graphs.
  
-The Debian package ''​graphite-carbon''​ is present in the official ​Debian Wheezy ​distribution,​ but because of licensing issues, the ''​graphite-web''​ package ​did not make it into Wheezy ​in time. It is only available for the testing and unstable Debian distributions. If you have followed the instructions from [[nav_on_debian]],​ you will find a version of the ''​graphite-web'' ​package that has been backported to Wheezy by us: +The Debian package ''​graphite-carbon''​ is present in the Debian Wheezy ​''​main''​ archivewhile the ''​graphite-web''​ package ​is in the ''​wheezy-backports'' ​archive.
- +
-  $ apt-cache policy graphite-web ​              +
-  graphite-web:​ +
-    Installed: (none) +
-    Candidate: 0.9.12-0uninett1~bpo70+1 +
-    Version table: +
-       ​0.9.12-0uninett1~bpo70+1 0 +
-          500 https://​nav.uninett.no/​debian/​ wheezy/​navbeta amd64 Packages+
  
 Assuming you will be running Graphite on the same Debian server as you are running NAV, all you need to do to install Graphite is: Assuming you will be running Graphite on the same Debian server as you are running NAV, all you need to do to install Graphite is:
Line 25: Line 20:
 ===== Configuring Carbon ===== ===== Configuring Carbon =====
  
-Carbon, the metric-receiving backend of Graphite, must be configured before it can be used with NAV. We will only be covering the simple case of using the //​carbon-cache//​ daemon. Most of this information is lifted from the [[https://​nav.uninett.no/​doc/​4.0/​intro/​install.html#​configuring-graphite|NAV installation documentation]].+Carbon, the metric-receiving backend of Graphite, must be configured before it can be used with NAV. We will only be covering the simple case of using the //​carbon-cache//​ daemon. Most of this information is lifted from the [[https://​nav.uninett.no/​doc/​latest/​intro/​install.html#​configuring-graphite|NAV installation documentation]].
  
 Edit ''/​etc/​carbon/​carbon.conf''​ to ensure these options are set in the ''​[cache]''​ section: Edit ''/​etc/​carbon/​carbon.conf''​ to ensure these options are set in the ''​[cache]''​ section:
Line 34: Line 29:
 </​code>​ </​code>​
  
-The first line ensures that Carbon will not delay creating Whisper backend files for the metrics NAV sends it. The default setting is a maximum of 50 creates per minute (the setting exists to limit I/O strain on huyge setups), which means that when bootstrapping a NAV installation,​ hours to days can pass before all its metrics are being actually stored in Graphite.+The first line ensures that Carbon will not delay creating Whisper backend files for the metrics NAV sends it. The default setting is a maximum of 50 creates per minute (the setting exists to limit I/O strain on huge setups), which means that when bootstrapping a NAV installation,​ hours to days can pass before all its metrics are being actually stored in Graphite.
  
 The second line ensures that Carbon accepts metrics on a UDP socket, which is required by NAV. The second line ensures that Carbon accepts metrics on a UDP socket, which is required by NAV.
Line 44: Line 39:
 </​code>​ </​code>​
   ​   ​
-Make sure the Carbon backend willbe automatically started ​at boot time, by editing ''/​etc/​default/​graphite-carbon''​ and ensure that:+Make sure the //​carbon-cache//​ daemon is enabled (this will also make it run at boot-time), by editing ''/​etc/​default/​graphite-carbon''​ and ensure that:
  
 <code bash> <code bash>
Line 70: Line 65:
  
 <code bash> <code bash>
-createuser --login graphite+createuser ​--pwprompt --no-createrole --no-superuser --no-createdb ​--login graphite
 createdb --owner=graphite graphite createdb --owner=graphite graphite
 </​code>​ </​code>​
Line 104: Line 99:
 ==== Configure Apache to serve the Graphite web app ==== ==== Configure Apache to serve the Graphite web app ====
  
-In principle, you can use any web server that supports the WSGI interface, but you already have Apache because of NAV, so lets use that.+In principle, you can use any web server that supports the WSGI interface, but you already have Apache because of NAV, so lets use that. Graphite-web will need its own virtualhost,​ so let's add a new site config for Apache in ''/​etc/​apache2/​sites-available/​graphite-web''​ (this example is inspired by the one supplied by the ''​graphite-web''​ package in ''/​usr/​share/​graphite-web/​apache2-graphite.conf''​):​ 
 + 
 +<code apache>​ 
 +Listen 8000 
 +<​VirtualHost *:​8000>​ 
 + 
 + WSGIDaemonProcess _graphite processes=1 threads=1 display-name='​%{GROUP}'​ inactivity-timeout=120 user=_graphite group=_graphite 
 + WSGIProcessGroup _graphite 
 + WSGIImportScript /​usr/​share/​graphite-web/​graphite.wsgi process-group=_graphite application-group=%{GLOBAL} 
 + WSGIScriptAlias / /​usr/​share/​graphite-web/​graphite.wsgi 
 + 
 + Alias /content/ /​usr/​share/​graphite-web/​static/​ 
 + <​Location "/​content/">​ 
 + SetHandler None 
 + </​Location>​ 
 + 
 + ErrorLog ${APACHE_LOG_DIR}/​graphite-web_error.log 
 + 
 + # Possible values include: debug, info, notice, warn, error, crit, 
 + # alert, emerg. 
 + LogLevel warn 
 + 
 + CustomLog ${APACHE_LOG_DIR}/​graphite-web_access.log combined 
 + 
 +</​VirtualHost>​ 
 +</​code>​ 
 + 
 +This defines a virtual host that will serve the Graphite web app on port **8000**. Some caveats: 
 + 
 +  * All graphite statistics will become browseable for anyone who can access your server on port 8000. You may wish to restrict access to this port, either using iptables or ACLs in your routers. Or, if you do not care about browsing the web app yourself, change the ''​Listen''​ statement into ''​Listen 127.0.0.1:​8000'',​ so that only the local NAV installation will be able to access it. 
 +  * Adding SSL encryption is left as an excercise for the reader. 
 + 
 +Now, enable the new site on port 8000: 
 + 
 +<code bash> 
 +a2ensite graphite-web 
 +service apache2 restart 
 +</​code>​ 
  
 +Congratulations,​ you should now be ready to start NAV!
  
graphite_on_debian.txt · Last modified: 2019/01/28 11:02 by morten