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"
introduction Today I learned how to connect to th...
Get ip tool import lombok.extern.slf4j.Slf4j; imp...
Analyze four common methods and principles: float...
This article example shares the specific code of ...
1. Packetdrill compilation and installation Sourc...
The display without the effect picture is just em...
At present, most people who use Linux either use ...
As a super rookie, I just started learning MySQL ...
1. Uninstall npm first sudo npm uninstall npm -g ...
background I have a project service that uses AWS...
The MySQL query result row field splicing can be ...
This article records the installation and configu...
Recently, I have a project that requires using ifr...
1. Download and install the official MySQL Yum Re...
I have used the vi editor for several years, but ...