-
-
Save mrbald/74f77cda2ba62269e022b8ea72055d39 to your computer and use it in GitHub Desktop.
Install Graphite on a Debian Server
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
# Install graphite dependencies | |
apt-get install -y python3 python3-pip python3-cairo python3-django | |
apt-get install -y apache2 libapache2-mod-wsgi-py3 | |
# Install graphite | |
pip3 install https://github.com/graphite-project/whisper/tarball/master | |
pip3 install https://github.com/graphite-project/carbon/tarball/master | |
pip3 install https://github.com/graphite-project/graphite-web/tarball/master | |
# Setup a vhost by grabbing the example the graphite team released on their repo. | |
# In this file, you'll provide the url used to access to your Graphite dashboard | |
wget https://github.com/graphite-project/graphite-web/blob/master/examples/example-graphite-vhost.conf -O /etc/apache2/sites-available/graphite.conf | |
perl -i -pe 's/\@DJANGO_ROOT\@/\/usr\/lib\/python3\/dist-packages\/django/g' /etc/apache2/sites-available/graphite.conf | |
WSGISocketPrefix /var/run/apache2/wsgi | |
# Configuring 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 | |
cp storage-aggregation.conf.example storage-aggregation.conf | |
# Let's go back to the installation process | |
django-admin.py makemigrations --settings=graphite.settings --pythonpath=/opt/graphite/webapp | |
django-admin.py migrate --run-syncdb --settings=graphite.settings --pythonpath=/opt/graphite/webapp | |
django-admin.py createsuperuser --settings=graphite.settings --pythonpath=/opt/graphite/webapp | |
django-admin.py collectstatic --noinput --settings=graphite.settings --pythonpath=/opt/graphite/webapp | |
chown -R www-data:www-data /opt/graphite/storage/ | |
chown -R www-data:www-data /opt/graphite/static/ | |
# Adjust dir permissions (in /etc/apache2/sites-enabled/graphite.conf | |
<Directory /opt/graphite/conf/> | |
Require all granted | |
</Directory> | |
<Directory /opt/graphite/static/> | |
Require all granted | |
</Directory> | |
# Enabling graphite host | |
a2ensite graphite | |
a2enmod wsgi | |
/opt/graphite/bin/carbon-cache.py start | |
systemctl restart apache2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
to get the raw config the url needs to be:
https://raw.githubusercontent.com/graphite-project/graphite-web/master/examples/example-graphite-vhost.conf