Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker logs growing infinitely #5782

Closed
ygersie opened this issue Jun 5, 2019 · 5 comments
Closed

Docker logs growing infinitely #5782

ygersie opened this issue Jun 5, 2019 · 5 comments

Comments

@ygersie
Copy link
Contributor

ygersie commented Jun 5, 2019

Nomad version

Nomad v0.9.1 (4b2bdbd)

Issue

Infinitely growing Docker logs. Docker stores the logs under the dockerd --data-root. Nomad seems to be collecting them separately and also performs the nice log rotation there. However, the actual source of the logs is never cleaned. We already have a file which grew to 116GB worth of access logs in a short time, here a du -h snippet:
117G /var/lib/docker/containers/dafbe8ab0f5aec724e49d80aee5ef77824838870460a0182e76c0924b45ae4ba/dafbe8ab0f5aec724e49d80aee5ef77824838870460a0182e76c0924b45ae4ba-json.log

Reproduction steps

Any job producing logs

@gpaggi
Copy link

gpaggi commented Jun 6, 2019

This seems to be a side effect of the recent changes in how Nomad collects logs from the Docker driver.
It changed from syslog to json-file, without max-size/max-file configured.

For the time being I configured Docker to rotate its files in /etc/docker/daemon.json

{
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "100m",
    "max-file": "2"
  }
}

I know I can pass the logging config to the driver in the job file but it would be nice to be able to do so also in the client config, under the newly introduced plugin/docker/config stanza

@hsmade
Copy link
Contributor

hsmade commented Jun 17, 2019

How to add it to a nomad task stanza:

     task "redis" {
      driver = "docker"
      config {
        image = "redis:3.2"
        port_map {
          db = 6379
        }
        logging {
          config {
            max-size= "10m",
            max-file= "10"
          }
        }
      }
....

@camerondavison
Copy link
Contributor

does #5846 fix this issue?

@schmichael
Copy link
Member

Oops, yes! Thanks for the reminder @camerondavison !

Please test out 0.9.4-rc1 if you were hit by this: https://groups.google.com/d/msg/nomad-tool/Zi2I7P-PWo0/yAPFPmgLDQAJ

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants