我使用以下说明在石墨服务器上安装和配置StatsD:
现在我已经有了一个运行StatsD的服务器,在测试从命令行发送它们时,我没有看到在/var/log/statsd/statsd.log下记录的指标。以下是我所看到的:
29 Oct 02:30:39 - server is up
29 Oct 02:47:49 - reading config file: /etc/statsd/localConfig.js
29 Oct 02:47:49 - server is up
29 Oct 14:16:45 - reading config file: /etc/statsd/localConfig.js
29 Oct 14:16:45 - server is up
29 Oct 15:36:47 - reading config file: /etc/statsd/localConfig.js
29 Oct 15:36:47 - DEBUG: Loading server: ./servers/udp
29 Oct 15:36:47 - server is up
29 Oct 15:36:47 - DEBUG: Loading backend: ./backends/graphite
29 Oct 15:36:47 - DEBUG: numStats: 3日志停留在'numStats: 3‘的最后一个条目,尽管我一直在命令行输入不同的指标。
下面是我输入的度量的示例:
echo "sample.gauge:14|g" | nc -u -w0 127.0.0.1 8125
echo "sample.gauge:10|g" | nc -u -w0 127.0.0.1 8125
echo "sample.count:1|c" | nc -u -w0 127.0.0.1 8125
echo "sample.set:50|s" | nc -u -w0 127.0.0.1 8125令人感兴趣的是,我在/var/log/statsd/stderr.log下面看到了以下内容:
events.js:72
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE
at errnoException (net.js:901:11)
at Server._listen2 (net.js:1039:14)
at listen (net.js:1061:10)
at Server.listen (net.js:1135:5)
at /usr/share/statsd/stats.js:383:16
at null.<anonymous> (/usr/share/statsd/lib/config.js:40:5)
at EventEmitter.emit (events.js:95:17)
at /usr/share/statsd/lib/config.js:20:12
at fs.js:268:14
at Object.oncomplete (fs.js:107:15)下面是我的localConfig.js文件的样子:
{
graphitePort: 2003
, graphiteHost: "localhost"
, port: 8125
, graphite: {
legacyNamespace: false
},
debug: true,
dumpMessages: true
}谁能弄清楚问题的所在呢?
谢谢!
发布于 2014-11-13 08:21:40
端口8126:interface.md上默认存在一个管理接口。
您可能会有另一个服务侦听同一系统中的端口。
试试这个:
# localConfig.js
{
graphitePort: 2003
, graphiteHost: "localhost"
, port: 8125
, mgmt_port: 8127
, graphite: {
legacyNamespace: false
},
debug: true,
dumpMessages: true
}请参阅https://github.com/etsy/statsd/blob/master/exampleConfig.js#L28
https://stackoverflow.com/questions/26654749
复制相似问题