Skip to content

Instantly share code, notes, and snippets.

@islander
Created March 24, 2020 00:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save islander/daca9e40acd44ba0b70141ca7a12462b to your computer and use it in GitHub Desktop.
Save islander/daca9e40acd44ba0b70141ca7a12462b to your computer and use it in GitHub Desktop.
Install StatsD on Debian Stretch

Install StatsD on Debian Stretch

Install nodejs:

# curl -sL https://deb.nodesource.com/setup_12.x | bash -
# apt install -y nodejs

Install build dependencies:

$ sudo apt install git debhelper devscripts dh-systemd                                                                                                                                                                                  

Clone repository:

$ git clone https://github.com/statsd/statsd.git                                                                                                                                                                                        

Build package:

$ cd statsd                                                                                                                                                                                                                             
$ dpkg-buildpackage                                                                                                                                                                                                                     

Install package:

$ cd ..                                                                                                                                                                                                                                 
$ sudo dpkg -i statsd_0.8.5-1_all.deb                                                                                                                                                                                                   

Configure:

# cat /etc/statsd/localConfig.js                                                                                                                                                                                                        
{                                                                                                                                                                                                                                       
  address: '0.0.0.0',                                                                                                                                                                                                                   
  port: 8125,                                                                                                                                                                                                                           
  graphitePort: 2003,                                                                                                                                                                                                                   
  graphiteHost: "localhost",
  backends: [ "./backends/graphite" ],
  graphite: {
    legacyNamespace: false
  },
  log: {
    backend: "syslog"
  }
}

Start and enable service:

# systemctl start statsd
# systemctl enable statsd
# systemctl status statsd
● statsd.service - Network daemon for aggregating statistics
   Loaded: loaded (/etc/systemd/system/statsd.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2020-01-21 09:46:19 +11; 1h 17min ago
     Docs: https://github.com/etsy/statsd/
 Main PID: 10876 (statsd /etc/sta)
   CGroup: /system.slice/statsd.service
           └─10876 statsd /etc/statsd/localConfig.js

jan 21 09:46:20 graphs systemd[1]: Started Network daemon for aggregating statistics.
jan 21 09:46:20 graphs nodejs[10876]: 21 Jan 09:46:20 - [10876] reading config file: /etc/statsd/localConfig.js
jan 21 09:46:20 graphs nodejs[10876]: 21 Jan 09:46:20 - server is up INFO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment