collectd是否正确地支持write_graphite插件的多个实例?在一个例子中,收藏品手册似乎表明了这一点:targets
我正试图配置chains,特别是PostCacheChain,并通过write_graphite插件的多个实例在trying中发送度量。原因是不同的度量需要不同的前缀。
我无法让这两个实例都将数据发送到石墨,只有一个或另一个工作。
使用netstat,我可以看到从收藏主机到石墨主机建立的两个套接字。运行tcpdump显示两个连接的SYN,但只有一个实例发送数据。应该通过第二个实例发送的度量标准不会出现在tcpdump或石墨上。
write_graphite的配置如下所示:
LoadPlugin "write_graphite"
<Plugin "write_graphite">
<Node "def_prefix">
Host "metrics.example.com"
Port "2003"
Prefix "collectd."
LogSendErrors true
Protocol "TCP"
StoreRates true
AlwaysAppendDS true
SeparateInstances true
</Node>
<Node "statsd_prefix">
Host "metrics.example.com"
Port "2003"
Prefix "statsd."
LogSendErrors true
Protocol "TCP"
StoreRates true
AlwaysAppendDS true
SeparateInstances true
</Node>
</Plugin>对于PostCacheChain
LoadPlugin match_regex
PostCacheChain "PostCache"
<Chain "PostCache">
<Rule "statsd_prefix"> # metrics from statsd plugin use diff prefix
<Match "regex">
Plugin "^statsd$"
</Match>
<Target "write">
Plugin "write_graphite/statsd_prefix"
</Target>
<Target "return">
</Target>
</Rule>
<Target "write">
Plugin "write_graphite/def_prefix"
</Target>
</Chain>谢谢你的帮助。
发布于 2016-05-12 04:48:54
在我的例子中的问题是一个设置问题。为了快速测试,我让nc在侦听模式下运行,而不是实际的石墨服务器。这导致,只有一个石墨插件实例完全连接和传输数据。
在我的情况下很糟糕的测试场景。
发布于 2021-05-21 00:00:21
<Node "server1">
Host "graphite1.example.com"
Prefix "collectd."
StoreRates true
</Node>
<Node "server2">
Host "graphite2.example.com"
Prefix "collectd."
StoreRates true
</Node>https://stackoverflow.com/questions/35856431
复制相似问题