Skip to content

Instantly share code, notes, and snippets.

@rothwerx
Last active October 16, 2020 07:54
Show Gist options
  • Save rothwerx/5667718 to your computer and use it in GitHub Desktop.
Save rothwerx/5667718 to your computer and use it in GitHub Desktop.
Bash: Graphite for Raspbian
#!/bin/bash
# A lighter graphite for raspberry pi/raspbian wheezy.
# For when you don't need memcache/rabbitmq/full uWSGI server/etc
# Not fully tested on a clean install. This is just what it *should* take.
# Installing supervisor because upstart conflicts with sysvinit
aptitude update && aptitude install gcc python-dev python-pip python-cairo python-pysqlite2 supervisor libffi-dev
pip install django==1.4.3
pip install django-tagging
pip install twisted
pip install whisper carbon graphite-web
cd /opt/graphite/conf/
for conf in $(ls -1); do
cp $conf ${conf%\.example}
done
cp /opt/graphite/webapp/graphite/local_settings.py.example /opt/graphite/webapp/graphite/local_settings.py
cat << 'EOF' >> /opt/graphite/webapp/graphite/local_settings.py
DATABASES = {
'default': {
'NAME': '/opt/graphite/storage/graphite.db',
'ENGINE': 'django.db.backends.sqlite3',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': ''
}
}
EOF
cd /opt/graphite/webapp/graphite && python manage.py syncdb --no-input
cat << 'EOF' > /etc/supervisor/conf.d/carbon-cache.conf
[program:carbon-cache]
command=/opt/graphite/bin/carbon-cache.py start
autostart=true
EOF
cat << 'EOF' > /etc/supervisor/conf.d/graphite-webapp.conf
[program:graphite-webapp]
command=python /opt/graphite/webapp/graphite/manage.py runserver 0.0.0.0:8000
autostart=true
EOF
supervisorctl reread
supervisorctl add carbon-cache
supervisorctl add graphite-webapp
@iamkfred
Copy link

pleas add "apt install libffi-dev" before the pip installs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment