Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure StatsD and Graphite to run on different servers

I have looked all over for this but have not found anyone talking about how to setup and configure StatsD and Graphite to communicate on separate servers. I currently have everything running on one but I have attempted unsuccessfully to separate them.

Here is how I setup the StatsD exampleConfig.js

exampleconfig
{
  graphitePort: 2003
, graphiteHost: "(graphite server IP)"
, port: 8125
}

The only other thing I can think to setup on the other box is the example-client.py.

currently it says this:
CARBON_SERVER = '127.0.0.1'
CARBON_PORT = 2003

I would think it needs to stay local host to communicate with whisper or graphite on the same server. I have my firewall setup to listen for 2003, and Using a packet dump the server does get the UDP from statsd. It just doesn't seem to get consumed by carbon and graphite.

What am I missing?
Also what is recommended for scaling the statsd graphite setup? I have statsd on its own right now and graphite + carbon + whisper on another server. Does statsd take the most power to run or is it the graphite box? I am wondering this because I will soon be sending millions of bits of data to the servers every day for testing.

like image 522
user1753719 Avatar asked Oct 17 '12 16:10

user1753719


People also ask

Is StatsD push or pull?

StatsD is an example of a monitoring system where the application pushes the metrics to the system.

What is StatsD protocol?

A network daemon that runs on the Node. js platform and listens for statistics, like counters and timers, sent over UDP or TCP and sends aggregates to one or more pluggable backend services (e.g., Graphite).

What is StatsD gauge?

StatsD is a simple network daemon that continuously receives metrics pushed over UDP and periodically sends aggregate metrics to upstream services like Graphite and Librato Metrics. Because it uses UDP, clients (for example, web applications) can ship metrics to it very fast with little to no overhead.


1 Answers

Modify example-client.py

If you want to run the example-client.py on a different server that is running your graphite/carbon instance. Then you will need to change the CARBON_SERVER to the IP address of the graphite/carbon server.


Network Tests

You might want to also do a few quick tests to make sure that the processes are listening correcting on the ports that your expect and the underlying network will allow this communication.

On the server running graphite/carbon you should be able to check if the server is accepting connections from more than just the localhost via the lsof command

$ lsof -Pi:2003
COMMAND    PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
carbon-ca 1596 graphite   7u  IPv4   9517      0t0  TCP *:2003 (LISTEN)

You can see from the above that I have a carbon-cache process running and listening on all interfaces on TCP 2003.

A very simple test from the remote machine would be to do a telnet connection to the graphite/carbon server on the port that it is listening on ( default: 2003 ) and see if that works.

Example of a listening socket*

$ telnet graphite-server 2003
Trying graphite-server...
Connected to graphite-server.
Escape character is '^]'.
^]
telnet> quit
Connection closed.

Example of a closed socket*

$ telnet graphite-server 2003
Trying graphite-server...
telnet: Unable to connect to remote host: Connection refused
like image 98
dannyla Avatar answered Sep 25 '22 17:09

dannyla