Created
March 27, 2013 15:31
-
-
Save jdeniau/5255117 to your computer and use it in GitHub Desktop.
Graphite - install graphite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create the directory | |
mkdir /opt/graphite | |
# make directory writable by whoever your want. You can chmod 777 if you want to: sudo chmod 777 /opt/graphite | |
# in our exemple, the "users" group, and www-data user (who execute apache) will have write and execute rights | |
sudo setfacl -dR -m m:rwx -m u:www-data:rwx -m g:users:rwx /opt/graphite | |
sudo setfacl -R -m m:rwx -m u:www-data:rwx -m g:users:rwx /opt/graphite | |
# install all required packages | |
pip install django==1.3 # Graphite does not seems to work with django >= 1.4 | |
pip install django-tagging twisted whisper carbon graphite-web # all other graphite dependancies | |
# configure graphite | |
cd /opt/graphite/conf/ | |
cp graphite.wsgi.example graphite.wsgi | |
cp carbon.conf.example carbon.conf | |
cp storage-schemas.conf.example storage-schemas.conf | |
# Edit graphite.wsgi in order to specify python virtualenv path | |
# Change the "import" line with those two lines : | |
- import os, sys | |
+ import os, sys, site | |
+ site.addsitedir('/home/envs/graphite/lib/python2.7/site-packages') | |
# Edit storage-schemas.conf in order to include a custom tweak provided by stats.d | |
[stats] | |
pattern = ^stats.* | |
retentions = 10:2160,60:10080,600:262974 | |
[carbon] | |
pattern = ^carbon\. | |
retentions = 60:90d | |
[default_1min_for_1day] | |
pattern = .* | |
retentions = 60s:1d | |
# Create a storage-aggregation.conf file | |
vim storage-aggregation.conf | |
# Then copy paste in it the following parameters | |
[min] | |
pattern = \.min$ | |
xFilesFactor = 0.1 | |
aggregationMethod = min | |
[max] | |
pattern = \.max$ | |
xFilesFactor = 0.1 | |
aggregationMethod = max | |
[sum] | |
pattern = \.count$ | |
xFilesFactor = 0 | |
aggregationMethod = sum | |
[default_average] | |
pattern = .* | |
xFilesFactor = 0.3 | |
aggregationMethod = average | |
# go back to the installation process | |
cd /opt/graphite/webapp/graphite | |
python manage.py syncdb # I spend some hour on this command, but if you have followed the previous steps, it should be working | |
# If you have some gcc error message, you may have to install python header | |
# enable graphite host | |
/opt/graphite/bin/carbon-cache.py start # errors can be found in /opt/graphite/storage/log/carbon-cache/ but I did not have any on that one |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment