Forked from jgeurts/install-graphite-ubuntu-12.04.sh
Last active
August 29, 2015 13:57
-
-
Save ildus/9786765 to your computer and use it in GitHub Desktop.
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
sudo apt-get update | |
sudo apt-get install memcached python-dev python-pip sqlite3 libcairo2 \ | |
libcairo2-dev python-cairo pkg-config | |
sudo pip install -U pip | |
sudo pip install uwsgi | |
sudo adduser graphite | |
sudo su graphite | |
cd ~ | |
wget https://launchpad.net/graphite/0.9/0.9.10/+download/graphite-web-0.9.10.tar.gz | |
wget https://launchpad.net/graphite/0.9/0.9.10/+download/carbon-0.9.10.tar.gz | |
wget https://launchpad.net/graphite/0.9/0.9.10/+download/whisper-0.9.10.tar.gz | |
tar -zxvf graphite-web-0.9.10.tar.gz | |
tar -zxvf carbon-0.9.10.tar.gz | |
tar -zxvf whisper-0.9.10.tar.gz | |
mv graphite-web-0.9.10 graphite | |
mv carbon-0.9.10 carbon | |
mv whisper-0.9.10 whisper | |
rm graphite-web-0.9.10.tar.gz | |
rm carbon-0.9.10.tar.gz | |
rm whisper-0.9.10.tar.gz | |
virtualenv env | |
. env/bin/activate | |
pip install django==1.4.9 django-tagging=0.3.2 'twisted<12' zope.interface txamqp | |
pushd ~/whisper | |
python setup.py install | |
popd | |
pushd ~/carbon | |
vim setup.cfg # change prefix to: prefix = $VIRTUAL_ENV/.. | |
python setup.py install | |
popd | |
pushd ~/graphite | |
vim setup.cfg # change prefix to: prefix = $VIRTUAL_ENV/.. | |
python setup.py install | |
popd | |
pushd ~/conf | |
cp carbon.conf.example carbon.conf | |
cp storage-schemas.conf.example storage-schemas.conf | |
vim storage-schemas.conf | |
### Replace contents of storage-schemas.conf to be the following | |
[stats] | |
priority = 110 | |
pattern = .* | |
retentions = 10:2160,60:10080,600:262974 | |
### | |
popd | |
pushd ~/webapp/graphite/ | |
sudo cp local_settings.py.example local_settings.py | |
vim local_settings.py | |
### | |
add | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.sqlite3', | |
'NAME': '/home/graphite/graphite.db', | |
}, | |
} | |
### | |
python manage.py syncdb | |
popd | |
# START CARBON | |
#################################### | |
cd ~ | |
./bin/carbon-cache.py start | |
mkdir deploy_conf | |
vim deploy_conf/graphite.ini | |
### | |
[uwsgi] | |
chdir = /home/graphite | |
home = /home/graphite/env | |
socket = /tmp/graphite_prod.sock | |
env = DJANGO_SETTINGS_MODULE=graphite.settings | |
module = django.core.handlers.wsgi:WSGIHandler() | |
chmod-socket = 666 | |
pythonpath= /home/graphite/webapp/ | |
pythonpath= /home/graphite/webapp/graphite | |
master = true | |
processes = 2 | |
pidfile=/tmp/graphite_prod.pid | |
uid=graphite | |
touch-reload=/home/graphite/graphite_prod.touch | |
buffer-size=65535 | |
limit-post=1048576000 | |
post-buffering=10485760 | |
### | |
touch /home/graphite/graphite_prod.touch | |
### nginx configuration | |
vim deploy_conf/graphite_prod.conf | |
### | |
upstream graphite_cluster_prod { | |
server unix:/tmp/graphite_prod.sock; | |
} | |
server { | |
listen 8888; | |
server_name graphite; | |
root /home/graphite/webapp; | |
location / { | |
uwsgi_pass graphite_cluster_prod; | |
include uwsgi_params; | |
} | |
location /content/ { | |
access_log off; | |
expires 30d; | |
} | |
} | |
### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment