LoginSignup
5
1

More than 5 years have passed since last update.

Docker swarm modeでfluentdにログを集約する際の注意点

Posted at

swarm + fluentdを試していた時にちょっとつまづいたのでメモ。

予めfluentのサービスを起動
$ docker service create --name logger -p 24224:24224 fluent/fluentd
続けてnginxを起動
$ docker service create --name nginx -p 80:80 \
  --replicas 2 --log-driver=fluentd \
  --log-opt=fluentd-address=localhost:24224 nginx

fluentdにログが集約されるはずが、記録されていない。

こちらの情報によると、NAT64がサポートされていない模様。
127.0.0.1に書き換えてみる。

変更後
$ docker service create --name nginx -p 80:80 \
  --replicas 2 --log-driver=fluentd \
  --log-opt=fluentd-address=127.0.0.1:24224 nginx

正常に記録されるようになった。

参考文献

5
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
1