Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mostlygeek/6108373 to your computer and use it in GitHub Desktop.
Save mostlygeek/6108373 to your computer and use it in GitHub Desktop.

Revisions

  1. mostlygeek revised this gist Jul 30, 2013. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions install_graphite_statsd_ubuntu_precise.sh
    Original file line number Diff line number Diff line change
    @@ -58,6 +58,12 @@ EOF

    sudo cp /tmp/storage-schemas.conf storage-schemas.conf

    cat > /opt/graphite/conf/storage-aggregation.conf << 'EOF'
    [aggregate_sparse]
    pattern = ^telemetry.*
    xFilesFactor = 0.0
    EOF

    # Make sure log dir exists for webapp
    sudo mkdir -p /opt/graphite/storage/log/webapp

    @@ -66,6 +72,7 @@ cd /opt/graphite/webapp/graphite/
    sudo cp local_settings.py.example local_settings.py
    sudo python manage.py syncdb # Follow the prompts, creating a superuser is optional


    #
    # Start it up Ghetto style!
    #
  2. mostlygeek revised this gist Jul 30, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install_graphite_statsd_ubuntu_precise.sh
    Original file line number Diff line number Diff line change
    @@ -69,7 +69,7 @@ sudo python manage.py syncdb # Follow the prompts, creating a superuser is opti
    #
    # Start it up Ghetto style!
    #
    cat >> '/etc/rc.local' << EOF
    cat > '/etc/rc.local' << EOF
    #!/bin/sh -e
    /opt/graphite/bin/carbon-cache.py start
  3. mostlygeek revised this gist Jul 30, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install_graphite_statsd_ubuntu_precise.sh
    Original file line number Diff line number Diff line change
    @@ -52,7 +52,7 @@ cat >> /tmp/storage-schemas.conf << EOF
    # retentions = timePerPoint:timeToStore, timePerPoint:timeToStore, ...
    [stats]
    priority = 110
    #pattern = ^stats\..*
    pattern = ^telemetry.*
    retentions = 10s:6h,1m:7d,10m:1y
    EOF

  4. mostlygeek revised this gist Jul 30, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install_graphite_statsd_ubuntu_precise.sh
    Original file line number Diff line number Diff line change
    @@ -52,7 +52,7 @@ cat >> /tmp/storage-schemas.conf << EOF
    # retentions = timePerPoint:timeToStore, timePerPoint:timeToStore, ...
    [stats]
    priority = 110
    pattern = ^stats\..*
    #pattern = ^stats\..*
    retentions = 10s:6h,1m:7d,10m:1y
    EOF

  5. mostlygeek revised this gist Jul 29, 2013. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions install_graphite_statsd_ubuntu_precise.sh
    Original file line number Diff line number Diff line change
    @@ -66,6 +66,9 @@ cd /opt/graphite/webapp/graphite/
    sudo cp local_settings.py.example local_settings.py
    sudo python manage.py syncdb # Follow the prompts, creating a superuser is optional

    #
    # Start it up Ghetto style!
    #
    cat >> '/etc/rc.local' << EOF
    #!/bin/sh -e
  6. mostlygeek revised this gist Jul 29, 2013. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion install_graphite_statsd_ubuntu_precise.sh
    Original file line number Diff line number Diff line change
    @@ -70,4 +70,5 @@ cat >> '/etc/rc.local' << EOF
    #!/bin/sh -e
    /opt/graphite/bin/carbon-cache.py start
    exit 0
    exit 0
    EOF
  7. mostlygeek revised this gist Jul 29, 2013. 1 changed file with 4 additions and 12 deletions.
    16 changes: 4 additions & 12 deletions install_graphite_statsd_ubuntu_precise.sh
    Original file line number Diff line number Diff line change
    @@ -66,16 +66,8 @@ cd /opt/graphite/webapp/graphite/
    sudo cp local_settings.py.example local_settings.py
    sudo python manage.py syncdb # Follow the prompts, creating a superuser is optional

    # statsd
    cd /opt && sudo git clone git://github.com/etsy/statsd.git
    cat >> '/etc/rc.local' << EOF
    #!/bin/sh -e
    # StatsD configuration
    cat >> /tmp/localConfig.js << EOF
    {
    graphitePort: 2003
    , graphiteHost: "127.0.0.1"
    , port: 8125
    }
    EOF

    sudo cp /tmp/localConfig.js /opt/statsd/localConfig.js
    /opt/graphite/bin/carbon-cache.py start
    exit 0
  8. mostlygeek revised this gist Jul 29, 2013. 1 changed file with 1 addition and 37 deletions.
    38 changes: 1 addition & 37 deletions install_graphite_statsd_ubuntu_precise.sh
    Original file line number Diff line number Diff line change
    @@ -78,40 +78,4 @@ cat >> /tmp/localConfig.js << EOF
    }
    EOF

    sudo cp /tmp/localConfig.js /opt/statsd/localConfig.js

    # Add upstart jobs to start at boot

    cat >> /etc/init/carbon-cache.conf << 'EOF'
    #!/etc/init/carbon-cache.conf
    description "Carbon server"
    start on filesystem or runlevel [2345]
    stop on runlevel [!2345]
    umask 022
    expect daemon
    respawn
    pre-start script
    test -d /opt/graphite || { stop; exit 0; }
    end script
    chdir /opt/graphite
    # Note the use of a wrapper so we can activate our virtualenv:
    exec start-stop-daemon --oknodo --chdir /opt/graphite --user graphite --chuid graphite --pidfile /opt/graphite/storage/carbon-cache-a.pid --name carbon-cache --startas /opt/graphite/bin/run-carbon-cache.sh --start start
    EOF

    cat >> /opt/graphite/bin/run-carbon-cache.sh << 'EOF'
    #!/bin/sh
    set -e
    HOME=/opt/graphite
    . /opt/graphite/.virtualenv/bin/activate
    . /opt/graphite/.virtualenv/bin/postactivate
    exec /opt/graphite/bin/carbon-cache.py "$@"
    EOF
    sudo cp /tmp/localConfig.js /opt/statsd/localConfig.js
  9. mostlygeek revised this gist Jul 29, 2013. 1 changed file with 13 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions install_graphite_statsd_ubuntu_precise.sh
    Original file line number Diff line number Diff line change
    @@ -101,4 +101,17 @@ chdir /opt/graphite
    # Note the use of a wrapper so we can activate our virtualenv:
    exec start-stop-daemon --oknodo --chdir /opt/graphite --user graphite --chuid graphite --pidfile /opt/graphite/storage/carbon-cache-a.pid --name carbon-cache --startas /opt/graphite/bin/run-carbon-cache.sh --start start
    EOF

    cat >> /opt/graphite/bin/run-carbon-cache.sh << 'EOF'
    #!/bin/sh
    set -e
    HOME=/opt/graphite
    . /opt/graphite/.virtualenv/bin/activate
    . /opt/graphite/.virtualenv/bin/postactivate
    exec /opt/graphite/bin/carbon-cache.py "$@"
    EOF
  10. mostlygeek revised this gist Jul 29, 2013. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion install_graphite_statsd_ubuntu_precise.sh
    Original file line number Diff line number Diff line change
    @@ -83,7 +83,6 @@ sudo cp /tmp/localConfig.js /opt/statsd/localConfig.js
    # Add upstart jobs to start at boot

    cat >> /etc/init/carbon-cache.conf << 'EOF'
    #!/etc/init/carbon-cache.conf
    description "Carbon server"
  11. mostlygeek revised this gist Jul 29, 2013. 1 changed file with 35 additions and 9 deletions.
    44 changes: 35 additions & 9 deletions install_graphite_statsd_ubuntu_precise.sh
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,20 @@
    #!/bin/bash

    # update the system
    sudo apt-get --yes update
    sudo apt-get --yes upgrade

    # node.js using PPA (for statsd)
    sudo apt-get install python-software-properties
    sudo apt-get install --yes python-software-properties
    sudo apt-add-repository ppa:chris-lea/node.js
    sudo apt-get update
    sudo apt-get install nodejs npm
    sudo apt-get update --yes
    sudo apt-get install --yes nodejs npm

    # Install git to get statsd
    sudo apt-get install git
    sudo apt-get install --yes git

    # System level dependencies for Graphite
    sudo apt-get install memcached python-dev python-pip sqlite3 libcairo2 \
    sudo apt-get install --yes memcached python-dev python-pip sqlite3 libcairo2 \
    libcairo2-dev python-cairo pkg-config

    # Get latest pip
    @@ -22,9 +26,9 @@ django==1.3
    python-memcached
    django-tagging
    twisted
    whisper==0.9.9
    carbon==0.9.9
    graphite-web==0.9.9
    whisper==0.9.10
    carbon==0.9.10
    graphite-web==0.9.10
    EOF

    sudo pip install -r /tmp/graphite_reqs.txt
    @@ -76,4 +80,26 @@ EOF

    sudo cp /tmp/localConfig.js /opt/statsd/localConfig.js


    # Add upstart jobs to start at boot

    cat >> /etc/init/carbon-cache.conf << 'EOF'
    #!/etc/init/carbon-cache.conf
    description "Carbon server"
    start on filesystem or runlevel [2345]
    stop on runlevel [!2345]
    umask 022
    expect daemon
    respawn
    pre-start script
    test -d /opt/graphite || { stop; exit 0; }
    end script
    chdir /opt/graphite
    # Note the use of a wrapper so we can activate our virtualenv:
    exec start-stop-daemon --oknodo --chdir /opt/graphite --user graphite --chuid graphite --pidfile /opt/graphite/storage/carbon-cache-a.pid --name carbon-cache --startas /opt/graphite/bin/run-carbon-cache.sh --start start
    EOF
  12. @bhang bhang revised this gist Jun 4, 2012. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions install_graphite_statsd_ubuntu_precise.sh
    Original file line number Diff line number Diff line change
    @@ -58,8 +58,8 @@ sudo cp /tmp/storage-schemas.conf storage-schemas.conf
    sudo mkdir -p /opt/graphite/storage/log/webapp

    # Copy over the local settings file and initialize database
    sudo cp local_settings.py.example local_settings.py
    cd /opt/graphite/webapp/graphite/
    sudo cp local_settings.py.example local_settings.py
    sudo python manage.py syncdb # Follow the prompts, creating a superuser is optional

    # statsd
    @@ -77,4 +77,3 @@ EOF
    sudo cp /tmp/localConfig.js /opt/statsd/localConfig.js



  13. @bhang bhang revised this gist May 15, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install_graphite_statsd_ubuntu_precise.sh
    Original file line number Diff line number Diff line change
    @@ -60,7 +60,7 @@ sudo mkdir -p /opt/graphite/storage/log/webapp
    # Copy over the local settings file and initialize database
    sudo cp local_settings.py.example local_settings.py
    cd /opt/graphite/webapp/graphite/
    sudo python manage.py syncdb
    sudo python manage.py syncdb # Follow the prompts, creating a superuser is optional

    # statsd
    cd /opt && sudo git clone git://github.com/etsy/statsd.git
  14. @bhang bhang created this gist May 15, 2012.
    80 changes: 80 additions & 0 deletions install_graphite_statsd_ubuntu_precise.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,80 @@
    #!/bin/bash

    # node.js using PPA (for statsd)
    sudo apt-get install python-software-properties
    sudo apt-add-repository ppa:chris-lea/node.js
    sudo apt-get update
    sudo apt-get install nodejs npm

    # Install git to get statsd
    sudo apt-get install git

    # System level dependencies for Graphite
    sudo apt-get install memcached python-dev python-pip sqlite3 libcairo2 \
    libcairo2-dev python-cairo pkg-config

    # Get latest pip
    sudo pip install --upgrade pip

    # Install carbon and graphite deps
    cat >> /tmp/graphite_reqs.txt << EOF
    django==1.3
    python-memcached
    django-tagging
    twisted
    whisper==0.9.9
    carbon==0.9.9
    graphite-web==0.9.9
    EOF

    sudo pip install -r /tmp/graphite_reqs.txt

    #
    # Configure carbon
    #
    cd /opt/graphite/conf/
    sudo cp carbon.conf.example carbon.conf

    # Create storage schema and copy it over
    # Using the sample as provided in the statsd README
    # https://github.com/etsy/statsd#graphite-schema

    cat >> /tmp/storage-schemas.conf << EOF
    # Schema definitions for Whisper files. Entries are scanned in order,
    # and first match wins. This file is scanned for changes every 60 seconds.
    #
    # [name]
    # pattern = regex
    # retentions = timePerPoint:timeToStore, timePerPoint:timeToStore, ...
    [stats]
    priority = 110
    pattern = ^stats\..*
    retentions = 10s:6h,1m:7d,10m:1y
    EOF

    sudo cp /tmp/storage-schemas.conf storage-schemas.conf

    # Make sure log dir exists for webapp
    sudo mkdir -p /opt/graphite/storage/log/webapp

    # Copy over the local settings file and initialize database
    sudo cp local_settings.py.example local_settings.py
    cd /opt/graphite/webapp/graphite/
    sudo python manage.py syncdb

    # statsd
    cd /opt && sudo git clone git://github.com/etsy/statsd.git

    # StatsD configuration
    cat >> /tmp/localConfig.js << EOF
    {
    graphitePort: 2003
    , graphiteHost: "127.0.0.1"
    , port: 8125
    }
    EOF

    sudo cp /tmp/localConfig.js /opt/statsd/localConfig.js