Open huapox opened 3 years ago
啊,这个的确很头疼,应该是少输出了一个换行,我抽空瞅瞅,看怎么加回来。
BTW, 换个别的image也会出现同样的问题吗,比如nginx?
BTW, 换个别的image也会出现同样的问题吗,比如nginx?
time="2021-03-08T03:53:09Z" level=info msg="Starting Polaris dashboard server on port 8080"
.:53
[INFO] plugin/reload: Running configuration MD5 = 4665410bf21c8b272fcfd562c482cb82
______ ____ _ _______
/ ____/___ ________ / __ \/ | / / ___/ ~ CoreDNS-1.6.3
/ / / __ \/ ___/ _ \/ / / / |/ /\__ \ ~ linux/amd64, go1.12.9, 37b9550
/ /___/ /_/ / / / __/ /_/ / /| /___/ /
\____/\____/_/ \___/_____/_/ |_//____/
[webproc] 2021/03/08 03:53:13 loaded config files changes from disk
[webproc] 2021/03/08 03:53:13 agent listening on http://0.0.0.0:8080...
dnsmasq: started, version 2.80 cachesize 150
dnsmasq: compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset auth no-DNSSEC loop-detect inotify dumpfile
dnsmasq: using nameserver 10.0.0.1#53 for domain company
dnsmasq: using nameserver 8.8.8.8#53
dnsmasq: using nameserver 114.114.114.114#53
dnsmasq: read /etc/hosts - 7 addresses
大多只是每行多了空格, 还好做匹配处理
coredns那 显示效果过分了啊..~
[root@(⎈ |default:kube-system) /]$ kc logs -f --tail=20 coredns-6c6bb68b64-bjlgd
.:53
[INFO] plugin/reload: Running configuration MD5 = 4665410bf21c8b272fcfd562c482cb82
______ ____ _ _______
/ ____/___ ________ / __ \/ | / / ___/ ~ CoreDNS-1.6.3
/ / / __ \/ ___/ _ \/ / / / |/ /\__ \ ~ linux/amd64, go1.12.9, 37b9550
/ /___/ /_/ / / / __/ /_/ / /| /___/ /
\____/\____/_/ \___/_____/_/ |_//____/
#coredns 手工清理行首空格(不能完全匹配)
.:53
[INFO] plugin/reload: Running configuration MD5 = 4665410bf21c8b272fcfd562c482cb82
______ ____ _ _______
/ ____/___ ________ / __ \/ | / / ___/ ~ CoreDNS-1.6.3
/ / / __ \/ ___/ _ \/ / / / |/ /\__ \ ~ linux/amd64, go1.12.9, 37b9550
/ /___/ /_/ / / / __/ /_/ / /| /___/ /
\____/\____/_/ \___/_____/_/ |_//____/
[webproc] 2021/03/08 03:53:13 loaded config files changes from disk
[webproc] 2021/03/08 03:53:13 agent listening on http://0.0.0.0:8080...
dnsmasq: started, version 2.80 cachesize 150
dnsmasq: compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset auth no-DNSSEC loop-detect inotify dumpfile
dnsmasq: using nameserver 10.0.0.1#53 for domain company
dnsmasq: using nameserver 8.8.8.8#53
dnsmasq: using nameserver 114.114.114.114#53
dnsmasq: read /etc/hosts - 7 addresses
我debug了一下,是因为这些容器的输出少了 \r\n
,换一个简单的容器,比如 wrfly/echo
试试,日志就应该正常了。
感觉这个问题除了从容器角度修改,没有办法解决,logs是一次性输出了很多日志,无法判断哪个是新的一行。如果只从fix当前问题考虑的话,可以在 \r
后面追加一个 \n
, 但是这样就修改原始日志了,我不确定这是一个好的方法。
tail /var/lib/docker/containers/470eeb1c4b3e64caf67aedc67b2b24304012a22ee559aa3ffdbf51f0a62a6dca/470eeb1c4b3e64caf67aedc67b2b24304012a22ee559aa3ffdbf51f0a62a6dca-json.log
{"log":" `-._ _.-' \r\n","stream":"stdout","time":"2021-03-13T16:36:14.253970513Z"}
{"log":" `-.__.-' \r\n","stream":"stdout","time":"2021-03-13T16:36:14.253974316Z"}
{"log":"\r\n","stream":"stdout","time":"2021-03-13T16:36:14.253978398Z"}
{"log":"1:M 13 Mar 2021 16:36:14.253 # Server initialized\r\n","stream":"stdout","time":"2021-03-13T16:36:14.253982264Z"}
{"log":"1:M 13 Mar 2021 16:36:14.253 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.\r\n","stream":"stdout","time":"2021-03-13T16:36:14.253987746Z"}
{"log":"1:M 13 Mar 2021 16:36:14.253 * Loading RDB produced by version 6.0.10\r\n","stream":"stdout","time":"2021-03-13T16:36:14.253995756Z"}
{"log":"1:M 13 Mar 2021 16:36:14.253 * RDB age 8360 seconds\r\n","stream":"stdout","time":"2021-03-13T16:36:14.254064352Z"}
{"log":"1:M 13 Mar 2021 16:36:14.253 * RDB memory usage when created 0.77 Mb\r\n","stream":"stdout","time":"2021-03-13T16:36:14.254076763Z"}
{"log":"1:M 13 Mar 2021 16:36:14.253 * DB loaded from disk: 0.000 seconds\r\n","stream":"stdout","time":"2021-03-13T16:36:14.254090025Z"}
{"log":"1:M 13 Mar 2021 16:36:14.253 * Ready to accept connections\r\n","stream":"stdout","time":"2021-03-13T16:36:14.254094666Z"}
docker 原始日志文件里面都有一个 \r\n
, 所以在浏览器上也可以正常显示。
我debug了一下,是因为这些容器的输出少了
\r\n
,换一个简单的容器,比如wrfly/echo
试试,日志就应该正常了。感觉这个问题除了从容器角度修改,没有办法解决,logs是一次性输出了很多日志,无法判断哪个是新的一行。如果只从fix当前问题考虑的话,可以在
\r
后面追加一个\n
, 但是这样就修改原始日志了,我不确定这是一个好的方法。
ar 17 10:13:35 UTC 2021
Wed Mar 17 10:13:36 UTC 2021
Wed Mar 17 10:13:37 UTC 2021
Wed Mar 17 10:13:38 UTC 2021
Wed Mar 17 10:13:39 UTC 2021
Wed Mar 17 10:13:40 UTC 2021
Wed Mar 17 10:13:41 UTC 2021
Wed Mar 17 10:13:42 UTC 2021
Wed Mar 17 10:13:43 UTC 2021
Wed Mar 17 10:13:44 UTC 2021
Wed Mar 17 10:13:45 UTC 2021
Wed Mar 17 10:13:46 UTC 2021
Wed Mar 17 10:13:47 UTC 2021
Wed Mar 17 10:13:48 UTC 2021
Wed Mar 17 10:13:49 UTC 2021
Wed Mar 17 10:13:50 UTC 2021
也不行
Hi @huapox 我升级了一下所有的依赖库 (docker/k8s) 你pull一下最新的image看有没有fix这个issue
Hi @huapox 我升级了一下所有的依赖库 (docker/k8s) 你pull一下最新的image看有没有fix这个issue
感谢,晚些时间验证后回复