When checking the service daily, when I went to look at the container logs from portainer, I found a red exclamation mark in the upper right corner: Unable to retrieve container logs. Because this problem has never occurred before, I first went to the server and used the command docker logs -f containerID to check the logs. I found that the logs could not be moved and were still stuck at a certain time. After thinking for a while, I thought that it should not be a problem with the service log printing. I searched on Google first, but found that there was no result that matched my problem. Because logs can sometimes be collected and displayed, but some logs cannot, there should be a problem with the log engine set up by Docker. I originally wanted to install a set of EFK, but I felt that the amount of logs was not large enough, so I did not modify the docker log engine and still used the default journald. [root@ad-official xiaoxiao]# docker info|grep Logging WARNING: You're not using the default seccomp profile Logging Driver: journald There is such a description in the official documentation of journald:
It is written here that by default only 1,000 logs can be received within 30 seconds. You can understand it from here, because a while ago we released a service with a daily log file size of almost 3G in Docker, which affected the logs of other services. A large number of logs were discarded by journald, so we can modify the configuration and there will be no problem. Open the /etc/systemd/journald.conf file and change RateLimitBurst from the default 1000 to 5000, adjusting it according to your current log output: [root@ad-official log]# cat /etc/systemd/journald.conf # This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # Entries in this file show the compile time defaults. # You can change settings by editing this file. # Defaults can be restored by simply deleting this file. # # See journald.conf(5) for details. [Journal] #Storage=auto #Compress=yes #Seal=yes #SplitMode=uid #SyncIntervalSec=5m #RateLimitInterval=30s RateLimitBurst=5000 #SystemMaxUse= #SystemKeepFree= #SystemMaxFileSize= #RuntimeMaxUse= #RuntimeKeepFree= #RuntimeMaxFileSize= #MaxRetentionSec= #MaxFileSec=1month ForwardToSyslog=no #ForwardToKMsg=no #ForwardToConsole=no ForwardToWall=no #TTYPath=/dev/console #MaxLevelStore=debug #MaxLevelSyslog=debug #MaxLevelKMsg=notice #MaxLevelConsole=info #MaxLevelWall=emerg #LineMax=48K By the way, set ForwardToSyslog and ForwardToWall to no, because the default is yes, which will cause us to clean up the journal log files while the Syslog log files are not cleared, which will slowly fill up the disk. Then restart journald to resume normal use: The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: How to modify the root user password in mysql 8.0.16 winx64 and Linux
>>: The MySql 8.0.16 version installation prompts that "UTF8B4" is used instead of "UTF8B3"
It is mainly a CSS style control and a META tag; C...
This article shares the specific code of Vue3.0 h...
Copy code The code is as follows: <style type=...
I haven't used mysql on my computer for a lon...
Table of contents Preface analyze Initial Renderi...
In the MySQL database, after tables are associate...
When it comes to databases, one of the most frequ...
1. The proxy_pass directive of the 1.ngx_stream_p...
1. Introduction to Linux .NET Core Microsoft has ...
1. HBase Overview 1.1 What is HBase HBase is a No...
Nginx log description Through access logs, you ca...
This article does not have any quibbles, it is jus...
Pseudo-elements and pseudo-classes Speaking of th...
Table of contents 1. What does shallow copy mean?...
Preface Ordinary users define crontab scheduled t...