最近2018中文字幕在日韩欧美国产成人片_国产日韩精品一区二区在线_在线观看成年美女黄网色视频_国产精品一区三区五区_国产精彩刺激乱对白_看黄色黄大色黄片免费_人人超碰自拍cao_国产高清av在线_亚洲精品电影av_日韩美女尤物视频网站

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
docker日志出現(xiàn)無法檢索怎么辦-創(chuàng)新互聯(lián)

這篇文章主要介紹docker日志出現(xiàn)無法檢索怎么辦,文中介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們一定要看完!

10多年的市中網(wǎng)站建設(shè)經(jīng)驗,針對設(shè)計、前端、開發(fā)、售后、文案、推廣等六對一服務(wù),響應(yīng)快,48小時及時工作處理。營銷型網(wǎng)站的優(yōu)勢是能夠根據(jù)用戶設(shè)備顯示端的尺寸不同,自動調(diào)整市中建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計,從而大程度地提升瀏覽體驗。創(chuàng)新互聯(lián)公司從事“市中網(wǎng)站設(shè)計”,“市中網(wǎng)站推廣”以來,每個客戶項目都認(rèn)真落實執(zhí)行。

日常檢查服務(wù)的時候,從portainer那里進(jìn)去看容器日志的時候,發(fā)現(xiàn)右上角出現(xiàn)紅色的感嘆號:Unable to retrieve container logs。

因為之前沒出現(xiàn)過這樣的問題,所以就先上服務(wù)器上用命令docker logs -f containerID看日志,發(fā)現(xiàn)日志也是動不了,還是停留在某個時間的日志記錄上。

想了一下不應(yīng)該是服務(wù)的日志打印出問題,先照著Google搜索了一遍,發(fā)現(xiàn)都沒有跟我的問題相匹配的。因為日志有時能收集顯示,有些日志不可以,應(yīng)該是跟docker設(shè)置的日志引擎有問題。

本來是想整一套EFK的,但是感覺現(xiàn)在日志量還不夠大,所以并沒有修改docker的日志引擎,還是默認(rèn)的journald

[root@ad-official xiaoxiao]# docker info|grep Logging
 WARNING: You're not using the default seccomp profile
Logging Driver: journald

journald的官方文檔上有這么一個說明:

man journald.conf ... RateLimitInterval=, RateLimitBurst= Configures the rate limiting that is applied to all messages generated on the system. If, in the time interval defined by RateLimitInterval=, more messages than specified in RateLimitBurst= are logged by a service, all further messages within the interval are dropped until the interval is over. A message about the number of dropped messages is generated. This rate limiting is applied per-service, so that two services which log do not interfere with each other's limits. Defaults to 1000 messages in 30s. The time specification for RateLimitInterval= may be specified in the following units: "s", "min", "h", "ms", "us". To turn off any kind of rate limiting, set either value to 0. ...

這里寫了默認(rèn)30秒內(nèi)只能接收1000條日志,看到這里就能明白了,因為前陣子剛在docker發(fā)布了一個單日日志文件大小差不多達(dá)到3G的服務(wù),導(dǎo)致到了其他服務(wù)的日志也受到了影響,大量的日志被journald丟棄,所以我們修改一下配置就沒有問題了。

打開/etc/systemd/journald.conf文件,將RateLimitBurst從默認(rèn)的1000修改成5000,根據(jù)自己目前的日志輸出量進(jìn)行調(diào)整:

[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

順便將ForwardToSyslog和ForwardToWall設(shè)置成no,因為默認(rèn)是yes,會導(dǎo)致我們清理了journal的日志文件,而Syslog中的沒有清除掉,慢慢的就會將磁盤占滿。

然后重啟一下journald就可以恢復(fù)正常使用啦:systemctl restart systemd-journald.service

以上是“docker日志出現(xiàn)無法檢索怎么辦”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)成都網(wǎng)站設(shè)計公司行業(yè)資訊頻道!

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。


當(dāng)前題目:docker日志出現(xiàn)無法檢索怎么辦-創(chuàng)新互聯(lián)
網(wǎng)站路徑:http://fisionsoft.com.cn/article/dsjijd.html