Last active
February 1, 2017 10:59
-
-
Save diyan/3048010 to your computer and use it in GitHub Desktop.
HOW-TO install Graphite into fully isolated Python virtual environment
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
## HOW-TO install Graphite into fully isolated Python virtual environment | |
# required for twisted binary extensions | |
sudo apt-get install python-dev | |
root=/usr/local/graphite_app | |
mkdir ${root} && cd ${root} && virtualenv env --prompt=\(graphite_env\) | |
source env/bin/activate | |
# NOTE that latest version of pyparsing (2.0.0) was failed to install | |
pip install django==1.4 django-tagging python-memcached pytz pyparsing==1.5.7 gunicorn | |
# Install cairocffi instead of py2cairo because it uses system cairo and much easier to install | |
sudo apt-get install python-dev libffi-dev | |
pip install cairocffi | |
ln -s cairocffi cairo | |
pip install --install-option="--prefix=$VIRTUAL_ENV" --install-option="--install-lib=$VIRTUAL_ENV/lib/python2.7/site-packages" carbon whisper | |
# Install graphte-web fork which can with non-rooted path | |
pip install --install-option="--prefix=$VIRTUAL_ENV" --install-option="--install-lib=$VIRTUAL_ENV/webapp" git+git://github.com/diyan/graphite-web.git@apache_non_root | |
# ensure that all required dependencies were installed | |
wget https://raw.github.com/graphite-project/graphite-web/master/check-dependencies.py && python check-dependencies.py | |
cp ${VIRTUAL_ENV}/conf/carbon.conf.example ${VIRTUAL_ENV}/conf/carbon.conf | |
cp ${VIRTUAL_ENV}/conf/storage-schemas.conf.example ${VIRTUAL_ENV}/conf/storage-schemas.conf | |
cp ${VIRTUAL_ENV}/webapp/graphite/local_settings.py.example ${VIRTUAL_ENV}/webapp/graphite/local_settings.py | |
local_settings=${VIRTUAL_ENV}/webapp/graphite/local_settings.py | |
echo "GRAPHITE_ROOT = '${VIRTUAL_ENV}/webapp/graphite'" >> $local_settings | |
echo "CONF_DIR = '${VIRTUAL_ENV}/conf'" >> $local_settings | |
echo "STORAGE_DIR = '${VIRTUAL_ENV}/storage'" >> $local_settings | |
echo "CONTENT_DIR = '${VIRTUAL_ENV}/webapp/content'" >> $local_settings | |
echo "DEBUG = True" >> $local_settings | |
echo "DATABASES = {'default':{'ENGINE':'django.db.backends.sqlite3', 'NAME':'/usr/local/graphite_app/env/webapp/graphite/graphite_sqlite.db'}}" >> $local_settings | |
cd ${VIRTUAL_ENV}/webapp/graphite | |
python manage.py syncdb | |
# uninstall all build-time dependencies | |
sudo apt-get remove python-dev libffi-dev && sudo apt-get autoremove | |
# run website | |
cd /usr/local/graphite_app/env/webapp && gunicorn_django --workers=1 --bind=0.0.0.0:8000 | |
# We are using following configuration in carbon.conf instead of defaults: | |
# MAX_UPDATES_PER_SECOND = 50 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After installation deps looks like following: