Bboysoul's Blog

首页 公告 RSS

openfaas容器莫名退出

August 9, 2020 本文有 326 个字 需要花费 1 分钟阅读

简介

最近创建了很多的openfaas函数,但是发现一个问题,就是容器会莫名其妙的就退出停止了

操作

容器退出是下面这个样子的

b6d4e81b18ee        reg.bboysoul.cn:5000/weibo:v1.0.1                          "fwatchdog"              2 days ago          Exited (137) 43 hours ago                       weibo.1.a6e63diwlk65y01e2ygpxp912
213c350ef746        reg.bboysoul.cn:5000/weibo:v1.0.1                          "fwatchdog"              2 days ago          Exited (137) 2 days ago                         weibo.1.5sk811e6mk2443jqqhs5rc8jh
7ea15fab5c15        reg.bboysoul.cn:5000/weibo:v1.0.1                          "fwatchdog"              2 days ago          Exited (137) 2 days ago                         weibo.1.012e92o6tuyc5525x8ea49ugf
0c0387ceb86a        d56829648d6e                                               "fwatchdog"              2 days ago          Exited (137) 44 hours ago                       weather.2.wx41u5szc3y0cf6qbo2zpnhvp
cd673223edb3        d56829648d6e                                               "fwatchdog"              2 days ago          Exited (137) 2 days ago                         weather.2.e7ai8vki9qchj1trt53ob7zq4
2b819b7f1793        reg.bboysoul.cn:5000/weather-redis:v1.0.4                  "fwatchdog"              2 days ago          Exited (137) 31 hours ago                       weather-redis.1.i24nh027j4qr1qu6j43v62mow

刚开始以为是内存的问题,所以加了内存

    limits:
      memory: 512m
    requests:
      memory: 256m

但是情况还是不变,之后看了容器的详细信息,有一段是下面这样的

docker inspect aa8fc6b16df3

            "Health": {
                "Status": "unhealthy",
                "FailingStreak": 1,
                "Log": [
                    {
                        "Start": "2020-08-07T05:15:14.215208046+08:00",
                        "End": "2020-08-07T05:15:14.646180265+08:00",
                        "ExitCode": 0,
                        "Output": ""
                    },
                    {
                        "Start": "2020-08-07T05:15:17.673740529+08:00",
                        "End": "2020-08-07T05:15:18.314430724+08:00",
                        "ExitCode": 0,
                        "Output": ""
                    },
                    {
                        "Start": "2020-08-07T05:15:21.340407903+08:00",
                        "End": "2020-08-07T05:15:21.852773024+08:00",
                        "ExitCode": 0,
                        "Output": ""
                    },
                    {
                        "Start": "2020-08-07T05:15:24.877707477+08:00",
                        "End": "2020-08-07T05:15:25.468700047+08:00",
                        "ExitCode": 0,
                        "Output": ""
                    },
                    {
                        "Start": "2020-08-07T05:15:28.498993972+08:00",
                        "End": "2020-08-07T05:15:28.822153747+08:00",
                        "ExitCode": -1,
                        "Output": "ttrpc: closed: unknown"
                    }
                ]
            }
        },

也就是在健康检查的时候出了问题,所以容器退出了

那么我就去掉了模板里面健康检查的项目

观察了几天,容器正常了

欢迎关注我的博客www.bboy.app
Have Fun


Tags:

本站总访问量 本站总访客数