Created
December 11, 2014 15:20
-
-
Save ebuildy/44a9fb541b3c5d49ca70 to your computer and use it in GitHub Desktop.
install_graphite
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: carbon | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Carbon | |
# Description: Carbon interface for Whisper storage. | |
### END INIT INFO | |
# Author: Mathieu Lecarme <[email protected]> | |
/opt/graphite/bin/carbon-cache.py $1 |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: graphite | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Graphite | |
# Description: Graphite web frontend. | |
### END INIT INFO | |
# Author: Mathieu Lecarme <[email protected]> | |
PIDFILE=/opt/graphite/storage/graphite.pid | |
DAEMON=/opt/graphite/bin/gunicorn_django | |
HOST=0.0.0.0 | |
PORT=8000 | |
USER=graphite | |
HOME=/opt/graphite/webapp/graphite | |
WORKERS=4 | |
case "$1" in | |
start) | |
cd $HOME && $DAEMON --pid $PIDFILE -b $HOST:$PORT --daemon --user $USER --workers $WORKERS | |
;; | |
stop) | |
kill -9 `cat $PID` | |
;; | |
*) | |
echo "Usage: graphite {start|stop}" >&2 | |
exit 3 | |
;; | |
esac |
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
uwsgi \ | |
--virtualenv /opt/graphite \ | |
--pythonpath /opt/graphite/webapp/graphite \ | |
--wsgi-file=/opt/graphite/conf/graphite.wsgi \ | |
--socket /tmp/graphite_a.sock \ | |
--pidfile /tmp/graphite_a.pid \ | |
--daemonize /var/log/uwsgi/graphite_a.log \ | |
--socket-timeout 20 \ | |
--processes 2 |
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
#!/bin/bash | |
sudo apt-get install nginx | |
sudo apt-get install python-virtualenv gcc python-dev | |
sudo apt-get install python-pip | |
sudo mkdir -p /opt/graphite | |
sudo virtualenv --no-site-packages /opt/graphite | |
sudo source /opt/graphite/bin/activate | |
sudo pip install whisper | |
sudo pip install carbon | |
sudo pip install graphite-web | |
cd /opt/graphite/conf/ | |
sudo cp carbon.conf.example carbon.conf | |
sudo cp storage-schemas.conf.example storage-schemas.conf | |
sudo adduser --disabled-password --quiet --system --home /opt/graphite graphite | |
sudo chown -R graphite /opt/graphite | |
pip install django | |
pip install django-tagging | |
cd /opt/graphite/webapp/graphite | |
sudo cp local_settings.py.example local_settings.py | |
sudo python manage.py syncdb | |
sudo apt-get install python-cairo | |
sudo ln -s /usr/lib/python2.7/cairo /opt/graphite/lib/python2.7/site-packages | |
sudo pip install gunicorn | |
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
server { | |
listen 80; | |
server_name | |
graphite.example.com | |
; | |
error_log /var/log/uwsgi/graphite_a-nginx.log | |
location / { | |
auth_basic "Graphite"; | |
auth_basic_user_file /etc/nginx/_htpasswd/graphite ; | |
include /etc/nginx/uwsgi_params; | |
uwsgi_pass unix:///tmp/graphite_a.sock; | |
uwsgi_param SCRIPT_NAME /; | |
uwsgi_intercept_errors on; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment