【问题标题】:No swap limit support - docker engine无交换限制支持 - docker 引擎
【发布时间】:2019-10-15 18:23:28
【问题描述】:

以下命令给出不支持交换限制的警告。

$ docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 18.09.5
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 
runc version: N/A
init version: v0.18.0 (expected: fec3683b971d9c3ef73f284f176672c44b448662)
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.4.0-150-generic
Operating System: Ubuntu 16.04.6 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.704GiB
Name: mohet01-ubuntu
ID: 5R7Z:D7DP:LAFK:OEFL:QTBB:TNMS:R36T:52NW:ZDE7:5KSS:RFIF:FOEU
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: No swap limit support

我听说在安装 Ubuntu 操作系统时交换空间是 RAM 大小的两倍,但是

这个警告对于 docker 意味着什么?

【问题讨论】:

标签: docker


【解决方案1】:

交换限制支持允许您限制容器使用的交换

在 Linux 上: 编辑 /etc/default/grub 文件。添加或更改此值:

GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"

最后,保存后,运行以下命令:

sudo update-grub

如果您有耐心,也请阅读这篇文章: https://docs.docker.com/config/containers/resource_constraints/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-12-23
    • 2022-11-23
    • 1970-01-01
    • 2020-07-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多