Closed simontigers closed 2 months ago
增加一个定时重启的功能会不会有所改善?
嗯呢,我现在是用 cron 每半小时检查容器最新的日志中是否包含 err:os: process already finished, 来确认要不要 restart 容器
嗯呢,我现在是用 cron 每半小时检查容器最新的日志中是否包含 err:os: process already finished, 来确认要不要 restart 容器
哈喽,我无法通过grep查找到相关log,进而无法设置cron任务,请问您是怎么做的? 我是debian12
docker logs #containername --tail 50 | grep "kill process error:os: process already finished"
10/07 05:36:41 INF [xunlei-pan-cli] [userID=4936261&trace_id=ONJAAwdC&sync_seq=1&device_id=7abd3182d399f7bdda199550d8babede&device_space=&func_name=watchMqtt&start_time=10/07 03:39:29] > receive /user/me/asset stoped 10/07 05:36:41 INF [xunlei-pan-cli] [device_id=7abd3182d399f7bdda199550d8babede&device_space=&func_name=watchMqtt&start_time=10/07 03:39:29&userID=4936261&trace_id=ONJAAwdC&sync_seq=1] > receive /user/me/drive/tasks stoped 10/07 05:36:41 WRN [xunlei-pan-cli] [userID=4936261&func_name=MySync.Reverse&trace_id=mMmdf3eS&start_time=10/07 03:39:30&deviceID=7abd3182d399f7bdda199550d8babede] > srv.Serve err:http: Server closed 10/07 05:36:41 WRN [xunlei-pan-cli] [sync_seq=1&device_id=7abd3182d399f7bdda199550d8babede&device_space=&func_name=watchMqtt&start_time=10/07 03:39:29&userID=4936261&trace_id=ONJAAwdC] > receive reverse error http: Server closed 10/07 05:36:54 WRN [xunlei-pan-cli] [device_space=&rssMB=382&out_memory_times=105&idle_rss_limit=260] > memory usage limit rss > idle_rss_limit 10/07 05:36:54 INF [xunlei-pan-cli] [device_space=&rssMB=382&memOut=105&idle_rss_limit=260] > memory usage out of limit 10/07 05:36:57 WRN [xunlei-pan-cli] > directWakeup err wakupMessage agent is empty invalid character '<' looking for beginning of value 10/07 05:36:57 WRN [xunlei-pan-cli]
if docker logs -n 20 xunlei_container-new | grep -q "err:os: process already finished"; then echo "[$current_time] Error found in logs. Proceeding with docker-compose restart..." else echo -e "\n[$current_time] No error found in logs. Exiting script." fi
if docker logs -n 20 xunlei_container-new | grep -q "err:os: process already finished"; then echo "[$current_time] Error found in logs. Proceeding with docker-compose restart..." else echo -e "\n[$current_time] No error found in logs. Exiting script." fi
不行。显示没有找到log 运行docker logs -n 20 xunlei_container-new | grep -q "err:os: process already finished",则打印全部20行log
更换适合你这这种情况的搜索关键词
重启后,过一两个小时还是会出现, 请问有遇到过么?或者哪里可以修改 idle_rss_limit=260 的限制?
运行信息如下 docker-compose.yml services: xunlei: image: cnk3x/xunlei container_name: xunlei_container privileged: true ports:
cat /etc/os-release PRETTY_NAME="Ubuntu 22.04.4 LTS" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04.4 LTS (Jammy Jellyfish)" VERSION_CODENAME=jammy ID=ubuntu ID_LIKE=debian
日志: 08/26 18:59:56 WRN [xunlei-pan-cli] [device_space=&rssMB=548&idle_rss_limit=260&out_memory_times=116] > memory usage limit rss > idle_rss_limit 08/26 18:59:56 INF [xunlei-pan-cli] [device_space=&rssMB=548&idle_rss_limit=260&memOut=116] > memory usage out of limit 08/26 19:00:26 WRN [xunlei-pan-cli] [out_memory_times=117&device_space=&rssMB=548&idle_rss_limit=260] > memory usage limit rss > idle_rss_limit 08/26 19:00:26 INF [xunlei-pan-cli] [rssMB=548&idle_rss_limit=260&memOut=117&device_space=] > memory usage out of limit 08/26 19:00:56 WRN [xunlei-pan-cli] [idle_rss_limit=260&device_space=&rssMB=548&out_memory_times=118] > memory usage limit rss > idle_rss_limit 08/26 19:00:56 INF [xunlei-pan-cli] [device_space=&rssMB=548&idle_rss_limit=260&memOut=118] > memory usage out of limit 08/26 19:01:26 WRN [xunlei-pan-cli] [rssMB=549&device_space=&idle_rss_limit=260&out_memory_times=119] > memory usage limit rss > idle_rss_limit 08/26 19:01:26 INF [xunlei-pan-cli] [rssMB=549&device_space=&idle_rss_limit=260&memOut=119] > memory usage out of limit 08/26 19:01:56 WRN [xunlei-pan-cli] [device_space=&rssMB=549&out_memory_times=120&idle_rss_limit=260] > memory usage limit rss > idle_rss_limit 08/26 19:01:56 INF [xunlei-pan-cli] [idle_rss_limit=260&memOut=120&device_space=&rssMB=549] > memory usage out of limit 08/26 19:01:56 WRN [xunlei-pan-cli] [idle_rss_limit=260&memOut=120&device_space=&rssMB=549] > memory usage out of limit panic 08/26 19:01:56 WRN [xunlei-pan-cli] panic: idle memory usage out of limit 08/26 19:01:56 WRN [xunlei-pan-cli] 08/26 19:01:56 WRN [xunlei-pan-cli] goroutine 105 [running]: 08/26 19:01:56 WRN [xunlei-pan-cli] gitlab.xunlei.cn/xlppc/pan-cli/pkg/download_runner.ProcessStat(0xc00045de00) 08/26 19:01:56 WRN [xunlei-pan-cli] /xunlei-pan-cli/pkg/download_runner/upload.go:153 +0xa2d 08/26 19:01:56 WRN [xunlei-pan-cli] created by gitlab.xunlei.cn/xlppc/pan-cli/pkg/commands.StartDeviceRunner 08/26 19:01:56 WRN [xunlei-pan-cli] /xunlei-pan-cli/pkg/commands/runner.go:80 +0xb6 08/26 19:01:57 WRN [xunlei-pan-cli] [report=true&panCliPid=35] > CheckProcess Signal err:os: process already finished 08/26 19:01:57 WRN [xunlei-pan-cli] > start new version 3.21.0=>3.21.0 err:os: process already finished