Home > database >  Connection refused listing fluentd plugins via in_monitor_agent
Connection refused listing fluentd plugins via in_monitor_agent

Time:09-21

I have added following in my conf file (ref - https://docs.fluentd.org/input/monitor_agent )-

<source>
  @type monitor_agent
  bind 0.0.0.0
  port 24220
</source>

When I run fluentd in a docker container , following log is also reported - >

2022-09-21 07:57:22  0000 [debug]: #0 [monitor_agent_stats] listening monitoring http server on http://0.0.0.0:24220/api/plugins for worker0

As per documentation,

This configuration launches HTTP server with 24220 port

But when I try to run following command in another terminal to list plugins =>

curl http://localhost:24220/api/plugins.json

I am getting ->

curl: (7) Failed to connect to localhost port 24220 after 9 ms: Connection refused

CodePudding user response:

When running Fluentd in a container you need to map the ports on host in order to access its api:

docker run -p 24220:24220 ...

then from host you can run

curl http://localhost:24220/api/plugins.json
  • Related