Help us understand the problem. What is going on with this article?

コンテナ内でfluentd実行したら"unexpected error error_class=Errno::EADDRINUSE"でエラッた話

はじめに

書いた記事の続き?にあたるもの
https://qiita.com/arata-honda/items/03d6da7c9f84f67466a9

エラー内容

2020-02-17 11:21:26 +0900 [error]: #0 suppressed same stacktrace
2020-02-17 11:21:26 +0900 [info]: Worker 0 finished unexpectedly with status 1
2020-02-17 11:21:26 +0900 [info]: adding match in @mainstream pattern="docker.**" type="file"
2020-02-17 11:21:26 +0900 [warn]: #0 [output_docker1] 'time_format' specified without 'time_key', will be ignored
2020-02-17 11:21:26 +0900 [info]: adding match in @mainstream pattern="**" type="file"
2020-02-17 11:21:26 +0900 [warn]: #0 [output1] 'time_format' specified without 'time_key', will be ignored
2020-02-17 11:21:26 +0900 [info]: adding filter pattern="**" type="stdout"
2020-02-17 11:21:26 +0900 [info]: adding source type="forward"
2020-02-17 11:21:26 +0900 [warn]: #0 define <match fluent.**> to capture fluentd logs in top level is deprecated. Use <label @FLUENT_LOG> instead
2020-02-17 11:21:26 +0900 [info]: #0 starting fluentd worker pid=204 ppid=34 worker=0
2020-02-17 11:21:26 +0900 [info]: #0 [input1] listening port port=24224 bind="0.0.0.0"
2020-02-17 11:21:26 +0900 [error]: #0 unexpected error error_class=Errno::EADDRINUSE error="Address in use - bind(2) for 0.0.0.0:24224"
  2020-02-17 11:21:26 +0900 [error]: #0 /usr/lib/ruby/2.5.0/socket.rb:201:in `bind'
  2020-02-17 11:21:26 +0900 [error]: #0 /usr/lib/ruby/2.5.0/socket.rb:201:in `listen'
  2020-02-17 11:21:26 +0900 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.2/lib/fluent/plugin_helper/server.rb:355:in `server_create_tcp_socket'
  2020-02-17 11:21:26 +0900 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.2/lib/fluent/plugin_helper/server.rb:212:in `server_create_for_tcp_connection'
  2020-02-17 11:21:26 +0900 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.2/lib/fluent/plugin_helper/server.rb:92:in `server_create_connection'
  2020-02-17 11:21:26 +0900 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.2/lib/fluent/plugin/in_forward.rb:172:in `start'
  2020-02-17 11:21:26 +0900 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.2/lib/fluent/root_agent.rb:200:in `block in start'
  2020-02-17 11:21:26 +0900 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.2/lib/fluent/root_agent.rb:189:in `block (2 levels) in lifecycle'
  2020-02-17 11:21:26 +0900 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.2/lib/fluent/root_agent.rb:188:in `each'
  2020-02-17 11:21:26 +0900 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.2/lib/fluent/root_agent.rb:188:in `block in lifecycle'
  2020-02-17 11:21:26 +0900 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.2/lib/fluent/root_agent.rb:175:in `each'
  2020-02-17 11:21:26 +0900 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.2/lib/fluent/root_agent.rb:175:in `lifecycle'
  2020-02-17 11:21:26 +0900 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.2/lib/fluent/root_agent.rb:199:in `start'
  2020-02-17 11:21:26 +0900 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.2/lib/fluent/engine.rb:248:in `start'
  2020-02-17 11:21:26 +0900 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.2/lib/fluent/engine.rb:147:in `run'
  2020-02-17 11:21:26 +0900 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.2/lib/fluent/supervisor.rb:592:in `block in run_worker'
  2020-02-17 11:21:26 +0900 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.2/lib/fluent/supervisor.rb:823:in `main_process'
  2020-02-17 11:21:26 +0900 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.2/lib/fluent/supervisor.rb:586:in `run_worker'
  2020-02-17 11:21:26 +0900 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.2/lib/fluent/command/fluentd.rb:338:in `<top (required)>'
  2020-02-17 11:21:26 +0900 [error]: #0 /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
  2020-02-17 11:21:26 +0900 [error]: #0 /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
  2020-02-17 11:21:26 +0900 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.2/bin/fluentd:8:in `<top (required)>'
  2020-02-17 11:21:26 +0900 [error]: #0 /usr/bin/fluentd:23:in `load'
  2020-02-17 11:21:26 +0900 [error]: #0 /usr/bin/fluentd:23:in `<main>'
2020-02-17 11:21:26 +0900 [error]: #0 unexpected error error_class=Errno::EADDRINUSE error="Address in use - bind(2) for 0.0.0.0:24224"

エラー原因

ここら辺に近しい
psすると

/ # ps
PID   USER     TIME  COMMAND
    1 root      0:00 tini -- /bin/entrypoint.sh fluentd
    6 root      0:00 {fluentd} /usr/bin/ruby /usr/bin/fluentd -c /fluentd/etc/fluent.conf -p /fluentd/plugins
   20 root      0:00 /usr/bin/ruby -Eascii-8bit:ascii-8bit /usr/bin/fluentd -c /fluentd/etc/fluent.conf -p /fluentd/pl
   29 root      0:00 /bin/sh
  288 root      0:00 ps

すでにfluentdのプロセスがexecした時に起動されていてポート24224が使用されていたため

unexpected error error_class=Errno::EADDRINUSE error="Address in use - bind(2) for 0.0.0.0:24224"
のエラーがいっぱいでました。

arata-honda
株式会社レコチョクでマイクロサービスまわりの開発を行っています。 バックグラウンドは大学、大学院で機械学習、信号処理系の理論をやってました。 記事を上げるとすれば自分のバックグラウンドに絡めたものか、 業務で培った知識を備忘録として残すために書きます
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした