3.09 Installing Graphite - MartinWong06/grafana GitHub Wiki
sudo apt-get update
sudo apt-cache madison graphite-web graphite-carbon
sudo apt-get install graphite-carbon graphite-web
cat /etc/carbon/carbon.conf | egrep -v '#' | sed '/^$/d'
sudo vim /etc/default/graphite-carbon
Set the following variable to true
CARBON_CACHE_ENABLED=true
sudo systemctl start carbon-cache
sudo vim /etc/graphite/local_settings.py
...
SECRET_KEY = 'MY_SECRET' # enter your own secret key
This step will hit error
sudo /usr/lib/python3/dist-packages/django/bin/django-admin.py migrate --settings=graphite.settings
Solution
sudo sed -i 's/from cgi import parse_qs/from urllib.parse import parse_qs/' /usr/lib/python3/dist-packages/graphite/render/views.py
find / -name app_settings.py 2>/dev/null /usr/lib/python3/dist-packages/graphite/app_settings.py
sudo sed -i -E "s/('django.contrib.contenttypes')/\1,\n 'django.contrib.messages'/" /usr/lib/python3/dist-packages/graphite/app_settings.py
sudo /usr/lib/python3/dist-packages/django/bin/django-admin.py migrate --settings=graphite.settings
sudo chown _graphite:_graphite /var/lib/graphite/graphite.db
sudo apt-get install apache2 libapache2-mod-wsgi-py3
sudo cp /usr/share/graphite-web/apache2-graphite.conf /etc/apache2/sites-available
sudo a2dissite 000-default
sudo a2ensite apache2-graphite
sudo systemctl reload apache2
sudo chown _graphite:_graphite /var/log/graphite/info.log
sudo chown _graphite:_graphite /var/log/graphite/exception.log
sudo /usr/lib/python3/dist-packages/django/bin/django-admin.py createsuperuser --settings=graphite.settings
sudo ln -s /usr/lib/python3/dist-packages/django/contrib/admin/static/admin/ /usr/share/graphite-web/static/admin
http://your IP/admin OR http://your IP:8080