Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: compute_engine_scripts/monitoring/graphite_setup.sh

Issue 310253003: Add setup scripts for a Graphite server. (Closed) Base URL: https://skia.googlesource.com/buildbot.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #!/bin/bash
2
3 # Install all the system level dependencies.
4 sudo apt-get install --assume-yes apache2 apache2-mpm-worker apache2-utils apach e2.2-bin \
5 apache2.2-common libapr1 libaprutil1 libaprutil1-dbd-sqlite3 build-essential p ython-dev \
6 libapache2-mod-wsgi libaprutil1-ldap memcached python-cairo-dev python-django python-ldap \
7 python-memcache python-pysqlite2 sqlite3 libapache2-mod-python python-pip font config
8
9 # Now install system dependencies that we need, but aren't satisfiable via
10 # apt-get.
11 sudo pip install --upgrade django==1.5
12 sudo pip install --upgrade django-tagging 'twisted<12.0'
13 sudo pip install pytz
14 sudo pip install pyparsing
15
16 # Apache runs as the user www-data and we also need the Graphite server, which
17 # is a WSGI Django application, to run as www-data. Sadly under Debian the
18 # $HOME directory for www-data is /var/www, which is where files are by
19 # default served from for Apache, so we can't store any data there securely,
20 # so we create a /home/www-data directory and install Graphite web and it's
21 # dependencies there.
22 sudo mkdir /home/www-data
23 sudo chown www-data:default /home/www-data
24
25 # Vars to use with 'install'.
26 PARAMS="-D --verbose --backup=none --group=default --owner=www-data --preserve-t imestamps"
27 EXE_PARAMS="$PARAMS --mode=766"
28 CONFIG_PARAMS="$PARAMS --mode=666"
29
30 # Copy over scripts we will run as www-data.
31 sudo install $EXE_PARAMS continue_install.sh continue_install2.sh /home/www-data
32
33 # The continue_install.sh script installs local per-user copies of ceres,
34 # whisper, carbon and graphite-web.
35 sudo su www-data -c /home/www-data/continue_install.sh
36
37 # Now that the default installs are in place, overwrite the installs with our
38 # custom config files.
39 sudo install $CONFIG_PARAMS graphite.wsgi carbon.conf storage-schemas.conf \
40 /home/www-data/graphite/conf
41 sudo install $CONFIG_PARAMS local_settings.py /home/www-data/graphite/lib/graphi te/
42
43 # Now run the continue_install2.sh script as www-data, which creates the
44 # sqlite database if needed and starts the carbon service.
45 sudo su www-data -c /home/www-data/continue_install2.sh
46
47 # Add to the configuration of Apache so that we load the Graphite WSGI
48 # application, and restart the server.
49 sudo cp httpd.conf /etc/apache2/conf.d/graphite.conf
50 sudo /etc/init.d/apache2 restart
rmistry 2014/06/10 11:57:58 Should we create a crontab that runs on reboot in
jcgregorio 2014/06/16 12:36:23 Added monit config to keep Apache running. On 201
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698