Skip to content

Instantly share code, notes, and snippets.

@wangshijun
Forked from mat/INSTALL
Created November 6, 2013 02:40

Revisions

  1. @mat mat revised this gist Oct 27, 2011. 2 changed files with 0 additions and 0 deletions.
    Empty file modified setup-graphite.sh
    100644 → 100755
    Empty file.
    Empty file modified setup-statsd.sh
    100644 → 100755
    Empty file.
  2. @mat mat revised this gist Oct 25, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup-statsd.sh
    Original file line number Diff line number Diff line change
    @@ -18,4 +18,4 @@ cd /opt/statsd && git checkout $version
    cp -v /opt/statsd/exampleConfig.js /opt/statsd/local.js

    # start statsd
    node stats.js local.js &
    # node stats.js local.js
  3. @mat mat revised this gist Oct 25, 2011. 1 changed file with 47 additions and 0 deletions.
    47 changes: 47 additions & 0 deletions apache_graphite.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,47 @@
    # This needs to be in your server's config somewhere, probably
    # the main httpd.conf
    NameVirtualHost *:80

    # You may need to manually edit this file to fit your needs.
    # This configuration assumes the default installation prefix
    # of /opt/graphite/, if you installed graphite somewhere else
    # you will need to change all the occurances of /opt/graphite/
    # in this file to your chosen install location.

    <VirtualHost *:80>
    ServerName graphite
    DocumentRoot "/opt/graphite/webapp"
    ErrorLog /opt/graphite/storage/log/webapp/error.log
    CustomLog /opt/graphite/storage/log/webapp/access.log common

    # I've found that an equal number of processes & threads tends
    # to show the best performance for Graphite (ymmv).
    WSGIDaemonProcess graphite processes=5 threads=5 display-name='%{GROUP}' inactivity-timeout=120
    WSGIProcessGroup graphite

    # You will need to create this file! There is a graphite.wsgi.example
    # file in this directory that you can safely use, just copy it to graphite.wgsi
    WSGIScriptAlias / /opt/graphite/conf/graphite.wsgi

    Alias /content/ /opt/graphite/webapp/content/
    <Location "/content/">
    SetHandler None
    </Location>

    # NOTE: In order for the django admin site media to work you
    # must change @DJANGO_ROOT@ to be the path to your django
    # installation, which is probably something like:
    # /usr/lib/python2.6/site-packages/django
    Alias /media/ "@DJANGO_ROOT@/contrib/admin/media/"
    <Location "/media/">
    SetHandler None
    </Location>

    # The graphite.wsgi file has to be accessible by apache. It won't
    # be visible to clients because of the DocumentRoot though.
    <Directory /opt/graphite/conf/>
    Order deny,allow
    Allow from all
    </Directory>

    </VirtualHost>
  4. @mat mat revised this gist Oct 25, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup-graphite.sh
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    version=0.9.9

    # install git and graphite dependencies
    # aptitude install git-core python-cairo python-pip python-django memcached python-memcache python-ldap python-twisted apache2 libapache2-mod-python libapache2-mod-wsgi
    aptitude install git-core curl python-cairo python-pip python-django memcached python-memcache python-ldap python-twisted apache2 libapache2-mod-python libapache2-mod-wsgi

    # download and install everything for graphite
    mkdir -pv /opt/graphite/install
  5. @mat mat revised this gist Oct 17, 2011. 2 changed files with 20 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion INSTALL
    Original file line number Diff line number Diff line change
    @@ -4,4 +4,7 @@ TODO:
    - correct the graphite host to localhost
    - if desired, put 'debug: true' in there
    - make the box accessible via the hostname 'graphite'
    - patch graphite, like described in https://answers.launchpad.net/graphite/+question/152851
    - update conf/storage-schemas.conf, see example for these retention rules:
    6 hours of 10 second data
    1 week of 1 minute data
    5 years of 10 minute data
    16 changes: 16 additions & 0 deletions storage-schemas.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    # Schema definitions for whisper files. Entries are scanned in order,
    # and first match wins.
    #
    # [name]
    # pattern = regex
    # retentions = timePerPoint:timeToStore, timePerPoint:timeToStore, ...

    [stats]
    priority = 110
    pattern = ^stats\..*
    retentions = 10:2160,60:10080,600:262974


    [default_1min_for_1day]
    pattern = .*
    retentions = 60s:1d
  6. @mat mat revised this gist Oct 13, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup-graphite.sh
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,7 @@ done
    pip install django-tagging

    # carbon: copy conf.example to conf
    for a in carbon.conf storage-schemas.conf graphite.wsgi; do
    for a in carbon.conf graphTemplates.conf storage-schemas.conf graphite.wsgi; do
    cp -v /opt/graphite/conf/$a.example /opt/graphite/conf/$a
    done

  7. @mat mat revised this gist Oct 13, 2011. 2 changed files with 4 additions and 4 deletions.
    1 change: 0 additions & 1 deletion INSTALL
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,3 @@

    TODO:

    - edit /opt/statsd/local.js
    7 changes: 4 additions & 3 deletions setup-graphite.sh
    Original file line number Diff line number Diff line change
    @@ -1,21 +1,22 @@
    #!/bin/bash

    version=0.9.8
    version=0.9.9

    # install git and graphite dependencies
    aptitude install git-core python-cairo python-django memcached python-memcache python-ldap python-twisted apache2 libapache2-mod-python libapache2-mod-wsgi
    # aptitude install git-core python-cairo python-pip python-django memcached python-memcache python-ldap python-twisted apache2 libapache2-mod-python libapache2-mod-wsgi

    # download and install everything for graphite
    mkdir -pv /opt/graphite/install
    cd /opt/graphite/install
    for a in graphite-web carbon whisper; do
    wget "http://launchpad.net/graphite/1.0/$version/+download/$a-$version.tar.gz"
    wget "http://launchpad.net/graphite/0.9/$version/+download/$a-$version.tar.gz"
    tar xfz $a-$version.tar.gz
    cd $a-$version
    python setup.py install
    cd ..
    done

    pip install django-tagging

    # carbon: copy conf.example to conf
    for a in carbon.conf storage-schemas.conf graphite.wsgi; do
  8. @mat mat revised this gist Aug 13, 2011. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions INSTALL
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@

    TODO:

    - edit /opt/statsd/local.js
    - correct the graphite host to localhost
    - if desired, put 'debug: true' in there
    - make the box accessible via the hostname 'graphite'
    - patch graphite, like described in https://answers.launchpad.net/graphite/+question/152851
  9. @mat mat revised this gist Aug 12, 2011. 1 changed file with 21 additions and 0 deletions.
    21 changes: 21 additions & 0 deletions setup-statsd.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    #!/bin/bash

    version=116dfe36820159ff2633090d130abcd16a98aefe

    # install nodejs from seperate apt repo
    aptitude install python-software-properties
    add-apt-repository ppa:chris-lea/node.js
    aptitude update
    aptitude install nodejs=0.4.10-1chl1~lucid1

    # install the node package manager for later use
    curl http://npmjs.org/install.sh | sudo sh
    npm install express

    # clone and setup statsd
    git clone https://github.com/etsy/statsd.git /opt/statsd
    cd /opt/statsd && git checkout $version
    cp -v /opt/statsd/exampleConfig.js /opt/statsd/local.js

    # start statsd
    node stats.js local.js &
  10. @mat mat renamed this gist Aug 12, 2011. 1 changed file with 5 additions and 20 deletions.
    25 changes: 5 additions & 20 deletions setup-statsd.sh → setup-graphite.sh
    Original file line number Diff line number Diff line change
    @@ -2,30 +2,21 @@

    version=0.9.8

    # install git and graphite dependacies
    # install git and graphite dependencies
    aptitude install git-core python-cairo python-django memcached python-memcache python-ldap python-twisted apache2 libapache2-mod-python libapache2-mod-wsgi

    # install nodejs from seperate apt repo
    aptitude install python-software-properties
    add-apt-repository ppa:chris-lea/node.js
    aptitude update
    aptitude install nodejs=0.4.10-1chl1~lucid1

    # install the node package manager for later use
    curl http://npmjs.org/install.sh | sudo sh
    npm install express

    # download and install everything for graphite
    mkdir -pv /opt/graphite/install
    cd /opt/graphite/install
    for a in graphite-web carbon whisper; do
    wget "http://launchpad.net/graphite/1.0/$version/+download/$a-$version.tar.gz"
    tar xfz $a-$version.tar.gz
    cd $a
    cd $a-$version
    python setup.py install
    cd ..
    done


    # carbon: copy conf.example to conf
    for a in carbon.conf storage-schemas.conf graphite.wsgi; do
    cp -v /opt/graphite/conf/$a.example /opt/graphite/conf/$a
    @@ -43,14 +34,8 @@ ln -sv /etc/apache2/sites-available/graphite.conf \
    /etc/init.d/apache2 restart

    # run syncdb to setup the db and prime the authentication model (if you're using the DB model)
    #python manage.py syncdb
    cd /opt/graphite/webapp/graphite
    python manage.py syncdb

    # start the carbon cache
    /opt/graphite/bin/carbon-cache.py start

    # clone and setup statsd
    git clone https://github.com/etsy/statsd.git /opt/statsd
    cp -v /opt/statsd/exampleConfig.js /opt/statsd/local.js

    # start statsd
    node stats.js local.js &
  11. @quanghiem quanghiem revised this gist Aug 11, 2011. 1 changed file with 51 additions and 66 deletions.
    117 changes: 51 additions & 66 deletions setup-statsd.sh
    Original file line number Diff line number Diff line change
    @@ -1,71 +1,56 @@
    # install git
    sudo apt-get install g++ curl libssl-dev apache2-utils
    sudo apt-get install git-core
    # download the Node source, compile and install it
    git clone https://github.com/joyent/node.git
    cd node
    ./configure
    make
    sudo make install
    # install the Node package manager for later use
    #!/bin/bash

    version=0.9.8

    # install git and graphite dependacies
    aptitude install git-core python-cairo python-django memcached python-memcache python-ldap python-twisted apache2 libapache2-mod-python libapache2-mod-wsgi

    # install nodejs from seperate apt repo
    aptitude install python-software-properties
    add-apt-repository ppa:chris-lea/node.js
    aptitude update
    aptitude install nodejs=0.4.10-1chl1~lucid1

    # install the node package manager for later use
    curl http://npmjs.org/install.sh | sudo sh
    npm install express
    # clone the statsd project
    git clone https://github.com/etsy/statsd.git
    # download everything for graphite
    mkdir graphite
    cd graphite/
    wget "http://launchpad.net/graphite/trunk/0.9.6/+download/carbon-0.9.6.tar.gz"
    wget "http://launchpad.net/graphite/trunk/0.9.6/+download/whisper-0.9.6.tar.gz"
    wget "http://launchpad.net/graphite/trunk/0.9.6/+download/graphite-web-0.9.6.tar.gz"
    tar xzvf whisper-0.9.6.tar.gz
    tar xzvf carbon-0.9.6.tar.gz
    tar xzvf graphite-web-0.9.6.tar.gz
    # install whisper - Graphite's DB system
    cd whisper-0.9.6
    sudo python setup.py install
    popd
    # install carbon - the Graphite back-end
    cd carbon-0.9.6
    python setup.py install
    cd /opt/graphite/conf
    cp carbon.conf.example carbon.conf
    # copy the example schema configuration file, and then configure the schema
    # see: http://graphite.wikidot.com/getting-your-data-into-graphite
    cp storage-schemas.conf.example storage-schemas.conf
    # install other graphite dependencies
    sudo apt-get install python-cairo
    sudo apt-get install python-django
    sudo apt-get install memcached
    sudo apt-get install python-memcache
    sudo apt-get install python-ldap
    sudo apt-get install python-twisted
    sudo apt-get install apache2 libapache2-mod-python
    cd ~/graphite/graphite-web-0.9.6
    python setup.py install
    # copy the graphite vhost example to available sites, edit it to you satisfaction, then link it from sites-enabled
    cp example-graphite-vhost.conf /etc/apache2/sites-available/graphite.conf
    ln -s /etc/apache2/sites-available/graphite.conf /etc/apache2/sites-enabled/graphite.conf
    apache2ctl restart
    # I had to create these log files manually
    /opt/graphite/storage/log/webapp
    touch info.log
    chmod 777 info.log
    touch exception.log
    chmod 777 exception.log
    # make sure to change ownership of the storage folder to the Apache user/group - mine was www-data
    sudo chown -R www-data:www-data /opt/graphite/storage/
    cd /opt/graphite/webapp/graphite
    # copy the local_settings example file to creating the app's settings
    # this is where both carbon federation and authentication is configured
    cp local_settings.py.example local_settings.py

    # download and install everything for graphite
    mkdir -pv /opt/graphite/install
    cd /opt/graphite/install
    for a in graphite-web carbon whisper; do
    wget "http://launchpad.net/graphite/1.0/$version/+download/$a-$version.tar.gz"
    tar xfz $a-$version.tar.gz
    cd $a
    python setup.py install
    cd ..
    done

    # carbon: copy conf.example to conf
    for a in carbon.conf storage-schemas.conf graphite.wsgi; do
    cp -v /opt/graphite/conf/$a.example /opt/graphite/conf/$a
    done

    cp -v /opt/graphite/webapp/graphite/local_settings.py.example \
    /opt/graphite/webapp/graphite/local_settings.py

    # apache conf
    chown -Rv www-data:www-data /opt/graphite/storage/
    cp -v /opt/graphite/install/graphite-web-$version/examples/example-graphite-vhost.conf \
    /etc/apache2/sites-available/graphite.conf
    ln -sv /etc/apache2/sites-available/graphite.conf \
    /etc/apache2/sites-enabled/graphite.conf
    /etc/init.d/apache2 restart

    # run syncdb to setup the db and prime the authentication model (if you're using the DB model)
    sudo python manage.py syncdb
    #python manage.py syncdb

    # start the carbon cache
    cd /opt/graphite/bin/carbon-cache.py start
    # copy the the statsd config example to create the config file
    # unless you used non-default ports for some other feature of the system, the defaults in the config file are fine
    cd ~/statsd
    cp exampleConfig.js local.js
    /opt/graphite/bin/carbon-cache.py start

    # clone and setup statsd
    git clone https://github.com/etsy/statsd.git /opt/statsd
    cp -v /opt/statsd/exampleConfig.js /opt/statsd/local.js

    # start statsd
    node stats.js local.js
    node stats.js local.js &
  12. @collegeman collegeman revised this gist Apr 19, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup-statsd.sh
    Original file line number Diff line number Diff line change
    @@ -62,7 +62,7 @@ cp local_settings.py.example local_settings.py
    # run syncdb to setup the db and prime the authentication model (if you're using the DB model)
    sudo python manage.py syncdb
    # start the carbon cache
    /opt/graphite/bin/carbon-cache.py start
    cd /opt/graphite/bin/carbon-cache.py start
    # copy the the statsd config example to create the config file
    # unless you used non-default ports for some other feature of the system, the defaults in the config file are fine
    cd ~/statsd
  13. @collegeman collegeman created this gist Mar 9, 2011.
    71 changes: 71 additions & 0 deletions setup-statsd.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,71 @@
    # install git
    sudo apt-get install g++ curl libssl-dev apache2-utils
    sudo apt-get install git-core
    # download the Node source, compile and install it
    git clone https://github.com/joyent/node.git
    cd node
    ./configure
    make
    sudo make install
    # install the Node package manager for later use
    curl http://npmjs.org/install.sh | sudo sh
    npm install express
    # clone the statsd project
    git clone https://github.com/etsy/statsd.git
    # download everything for graphite
    mkdir graphite
    cd graphite/
    wget "http://launchpad.net/graphite/trunk/0.9.6/+download/carbon-0.9.6.tar.gz"
    wget "http://launchpad.net/graphite/trunk/0.9.6/+download/whisper-0.9.6.tar.gz"
    wget "http://launchpad.net/graphite/trunk/0.9.6/+download/graphite-web-0.9.6.tar.gz"
    tar xzvf whisper-0.9.6.tar.gz
    tar xzvf carbon-0.9.6.tar.gz
    tar xzvf graphite-web-0.9.6.tar.gz
    # install whisper - Graphite's DB system
    cd whisper-0.9.6
    sudo python setup.py install
    popd
    # install carbon - the Graphite back-end
    cd carbon-0.9.6
    python setup.py install
    cd /opt/graphite/conf
    cp carbon.conf.example carbon.conf
    # copy the example schema configuration file, and then configure the schema
    # see: http://graphite.wikidot.com/getting-your-data-into-graphite
    cp storage-schemas.conf.example storage-schemas.conf
    # install other graphite dependencies
    sudo apt-get install python-cairo
    sudo apt-get install python-django
    sudo apt-get install memcached
    sudo apt-get install python-memcache
    sudo apt-get install python-ldap
    sudo apt-get install python-twisted
    sudo apt-get install apache2 libapache2-mod-python
    cd ~/graphite/graphite-web-0.9.6
    python setup.py install
    # copy the graphite vhost example to available sites, edit it to you satisfaction, then link it from sites-enabled
    cp example-graphite-vhost.conf /etc/apache2/sites-available/graphite.conf
    ln -s /etc/apache2/sites-available/graphite.conf /etc/apache2/sites-enabled/graphite.conf
    apache2ctl restart
    # I had to create these log files manually
    /opt/graphite/storage/log/webapp
    touch info.log
    chmod 777 info.log
    touch exception.log
    chmod 777 exception.log
    # make sure to change ownership of the storage folder to the Apache user/group - mine was www-data
    sudo chown -R www-data:www-data /opt/graphite/storage/
    cd /opt/graphite/webapp/graphite
    # copy the local_settings example file to creating the app's settings
    # this is where both carbon federation and authentication is configured
    cp local_settings.py.example local_settings.py
    # run syncdb to setup the db and prime the authentication model (if you're using the DB model)
    sudo python manage.py syncdb
    # start the carbon cache
    /opt/graphite/bin/carbon-cache.py start
    # copy the the statsd config example to create the config file
    # unless you used non-default ports for some other feature of the system, the defaults in the config file are fine
    cd ~/statsd
    cp exampleConfig.js local.js
    # start statsd
    node stats.js local.js