Skip to content

Instantly share code, notes, and snippets.

@jayv
Created October 26, 2012 09:14

Revisions

  1. jayv revised this gist Oct 31, 2012. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,7 @@ cd /opt/statsd
    cp exampleConfig.js dConfig.js
    # edit config file your settings
    sudo vim dConfig.js

    sudo vim /opt/statsd/backend/repeater.js change udp6 in udp4 else statsd crashes (fails to resolve hostname)
    # Create an upstart script

    sudo vi /etc/init/statsd.conf
    @@ -36,4 +36,3 @@ end script
    sudo chmod u+x /etc/init/statsd.conf

    sudo start statsd

  2. jayv revised this gist Oct 26, 2012. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -23,7 +23,7 @@ sudo vi /etc/init/statsd.conf
    description "statsd server"
    author "jayv"

    start on startup
    start on filesystem or runlevel [2345]
    stop on shutdown

    script
    @@ -37,4 +37,3 @@ sudo chmod u+x /etc/init/statsd.conf

    sudo start statsd


  3. jayv revised this gist Oct 26, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,7 @@ sudo vim dConfig.js

    # Create an upstart script

    sudo vi /etc/init/statsd
    sudo vi /etc/init/statsd.conf

    description "statsd server"
    author "jayv"
  4. jayv revised this gist Oct 26, 2012. 1 changed file with 4 additions and 6 deletions.
    10 changes: 4 additions & 6 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -16,10 +16,7 @@ cp exampleConfig.js dConfig.js
    # edit config file your settings
    sudo vim dConfig.js

    # START STATSD
    node stats.js dConfig.js

    # If it's running kill it ;-) Now let's create an upstart script
    # Create an upstart script

    sudo vi /etc/init/statsd

    @@ -32,11 +29,12 @@ stop on shutdown
    script
    # We found $HOME is needed. Without it, we ran into problems
    export HOME="/ubuntu"

    exec /usr/bin/node /opt/statsd/stats.js 2>&1 >> /var/log/statsd.log
    cd /opt/statsd/
    exec /usr/bin/node stats.js dConfig.js 2>&1 >> /var/log/statsd.log
    end script

    sudo chmod u+x /etc/init/statsd.conf

    sudo start statsd


  5. jayv revised this gist Oct 26, 2012. 1 changed file with 22 additions and 0 deletions.
    22 changes: 22 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -18,3 +18,25 @@ sudo vim dConfig.js

    # START STATSD
    node stats.js dConfig.js

    # If it's running kill it ;-) Now let's create an upstart script

    sudo vi /etc/init/statsd

    description "statsd server"
    author "jayv"

    start on startup
    stop on shutdown

    script
    # We found $HOME is needed. Without it, we ran into problems
    export HOME="/ubuntu"

    exec /usr/bin/node /opt/statsd/stats.js 2>&1 >> /var/log/statsd.log
    end script

    sudo chmod u+x /etc/init/statsd.conf



  6. jayv revised this gist Oct 26, 2012. 1 changed file with 17 additions and 1 deletion.
    18 changes: 17 additions & 1 deletion gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,20 @@
    # Install NodeJS

    sudo apt-get install python-software-properties git-core
    sudo add-apt-repository ppa:chris-lea/node.js
    sudo apt-get update
    sudo apt-get install nodejs npm
    sudo apt-get install nodejs npm

    # Install Statsd

    git clone https://github.com/etsy/statsd.git
    sudo mv statsd/ /opt/

    # CREATE A CONFIG FILE
    cd /opt/statsd
    cp exampleConfig.js dConfig.js
    # edit config file your settings
    sudo vim dConfig.js

    # START STATSD
    node stats.js dConfig.js
  7. jayv created this gist Oct 26, 2012.
    4 changes: 4 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    sudo apt-get install python-software-properties git-core
    sudo add-apt-repository ppa:chris-lea/node.js
    sudo apt-get update
    sudo apt-get install nodejs npm