欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

docker啟動報錯205/limit的解決方案

 更新時間:2024年06月28日 14:51:01   作者:小白的程序員  
Dcoker啟動報錯經(jīng)常能看到 205/limit這個錯誤提示,這是告訴你linux操作系統(tǒng)的文件描述符設(shè)置的和Docker的不匹配,或者是設(shè)置的比較小了,本文介紹了docker啟動報錯205/limit的解決方案,需要的朋友可以參考下

背景

Dcoker啟動報錯經(jīng)常能看到 205/limit這個錯誤提示,這是告訴你linux操作系統(tǒng)的文件描述符設(shè)置的和Docker的不匹配,或者是設(shè)置的比較小了。

解決方案

linux中一切皆文件。例如一個socket都會用一個文件描述符去表示,所以linux系統(tǒng)文件描述符的大小,對系統(tǒng)是至關(guān)重要的,例如高并發(fā)的時候,如果文件描述符太小,服務(wù)器的并發(fā)是上不去的。

要解決 205/limit 可以使用兩種方式。

  • 修改系統(tǒng)文件描述符 vim /etc/sysctl.conf
# sysctl settings are defined through files in 
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/. 
# 
# Vendors settings live in /usr/lib/sysctl.d/. # To override a whole file, create a new file with the same in 
# /etc/sysctl.d/ and put new settings there. To override 
# only specific settings, add a file with a lexically later 
# name in /etc/sysctl.d/ and put new settings there. # # For more information, see sysctl.conf(5) and sysctl.d(5). 
fs.file-max =6553600 # 這里按照實際情況填寫。
fs.nr_open = 6553600

修改文件使用執(zhí)行命令sysctl -p命令讓設(shè)置的內(nèi)容生效,并重啟docker systemctl restart docker

  • 修改Docker的docker.service文件路徑/usr/lib/systemd/system/docker.service文件中對文件描述符的配置,可以修改的比系統(tǒng)配置的最大文件描述符小一些
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
BindsTo=containerd.service
After=network-online.target firewalld.service containerd.service
Wants=network-online.target
Requires=docker.socket

[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd --exec-opt=native.cgroupdriver=cgroupfs --log-level=warn --log-opt max-size=50M --storage-driver=overlay2 -H fd:// --containerd=/run/containerd/containerd.sock -H unix:///var/run/docker.sock -H tcp://0.0.0.0:900 --data-root=/data1/docker_customized
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always

# Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229.
# Both the old, and new location are accepted by systemd 229 and up, so using the old location
# to make them work for either version of systemd.
StartLimitBurst=3

# Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230.
# Both the old, and new name are accepted by systemd 230 and up, so using the old name to make
# this option work for either version of systemd.
StartLimitInterval=60s

# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=6553500     # 修改這里
LimitNPROC=infinity
LimitCORE=infinity

# Comment TasksMax if your systemd version does not supports it.
# Only systemd 226 and above support this option.
TasksMax=infinity

# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes

# kill only the docker process, not all processes in the cgroup
KillMode=process

[Install]
WantedBy=multi-user.target

修改完Docker后,可能還需要修改containerd的啟動配置文件, 文件路徑/usr/lib/systemd/system/containerd.service

[Unit]
Description=containerd container runtime
Documentation=https://containerd.io
After=network.target

[Service]
ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/bin/containerd
KillMode=process
Delegate=yes
LimitNOFILE=6553500   # 修改這里
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity

[Install]
WantedBy=multi-user.target

修改文件后先執(zhí)行 systemctl daemon-reload 然后執(zhí)行 systemctl restart docker docker 正常啟動。

以上就是docker啟動報錯205/limit的解決方案的詳細內(nèi)容,更多關(guān)于docker啟動報錯205/limit的資料請關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

  • docker image tag為什么出現(xiàn)none的原因及解決

    docker image tag為什么出現(xiàn)none的原因及解決

    當(dāng)我們使用docker加載新的鏡像時,有時候會發(fā)現(xiàn)Repository和Tag名稱都為none的情況,這通常是由于沒有指定正確的標(biāo)簽名稱或者倉庫名稱所導(dǎo)致的,本文主要介紹了docker image tag為什么出現(xiàn)none的原因及解決,感興趣的可以了解一下
    2023-10-10
  • 使用 docker部署tomcat并接入skywalking的使用

    使用 docker部署tomcat并接入skywalking的使用

    這里主要介紹了使用 docker 部署 tomact 并接入 skywalking 的使用,因為在網(wǎng)上并沒有查到太多相關(guān)的信息,所以這里記錄下來,需要對有需求的小伙伴提供一些幫助
    2021-04-04
  • Docker工作模式及原理詳解

    Docker工作模式及原理詳解

    Docker是一個Client-Server結(jié)構(gòu)的系統(tǒng),Docker的守護進程運行在主機上,通過Socket從客戶端訪問!DockerServer接受到DockerClient的指令,就會執(zhí)行這個命令
    2021-09-09
  • 解決docker容器與宿主機相差8小時的問題

    解決docker容器與宿主機相差8小時的問題

    使用docker-compose部署時,在輸出的日志以及相關(guān)事件校驗及輸出時,導(dǎo)致事件與現(xiàn)實相差8小時。糾結(jié)怎么回事呢?下面小編給大家分享下解決docker容器與宿主機相差8小時的問題,一起看看吧
    2021-09-09
  • Docker容器使用方法詳解

    Docker容器使用方法詳解

    容器是基于鏡像創(chuàng)建的,容器中的進程依賴于鏡像中的文件,那么本篇文章我們就來深入學(xué)習(xí)容器的基本操作方法,通過示例來加深各位看官對docker容器操作的理解以及記憶,需要的朋友可以參考下
    2022-07-07
  • Docker無法登錄與推送問題解決的詳細教程

    Docker無法登錄與推送問題解決的詳細教程

    這篇文章主要介紹了如何使用阿里云容器鏡像服務(wù)來解決國內(nèi)訪問Docker?Hub速度慢的問題,并詳細描述了如何設(shè)置阿里云鏡像服務(wù)、配置Docker、操作鏡像(包括pull和push)以及測試拉取鏡像的過程,需要的朋友可以參考下
    2025-02-02
  • 聊聊Docker中容器的創(chuàng)建與啟停問題

    聊聊Docker中容器的創(chuàng)建與啟停問題

    一個進程可以視為一個被執(zhí)行的應(yīng)用程序,同樣,一個Docker容器可以視為一個運行中的Docker鏡像,這篇文章主要介紹了Docker中容器的創(chuàng)建與啟停,需要的朋友可以參考下
    2022-06-06
  • docker使用Dockerfile構(gòu)建鏡像的方法

    docker使用Dockerfile構(gòu)建鏡像的方法

    這篇文章主要介紹了docker使用Dockerfile構(gòu)建鏡像的方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2018-12-12
  • Docker 鏡像國內(nèi)加速的方法匯總(收藏版)

    Docker 鏡像國內(nèi)加速的方法匯總(收藏版)

    本文介紹了在國內(nèi)使用Docker時遇到的加速和優(yōu)化方法,針對國內(nèi)下載速度慢和斷線問題,可以使用國內(nèi)可用的DockerRegistryMirrors或自建DockerRegistryMirror/Proxy,針對沒有公共鏡像庫賬號導(dǎo)致的限流問題,可以注冊各個鏡像庫賬號并登錄,感興趣的朋友跟隨小編一起看看吧
    2025-01-01
  • 如何通過vs2017的Dockerfile來生成鏡像

    如何通過vs2017的Dockerfile來生成鏡像

    這篇文章主要為大家詳細介紹了如何通過vs2017的Dockerfile來生成鏡像,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2017-07-07

最新評論