看起来 Ubuntu 18.04 破坏了 docker swap 支持。
它在 ubuntu 16.04 上运行良好,但今天早上当我用 ubuntu 18.04 设置新服务器时它却不工作了。
有人知道如何在 ubuntu 18.04 中启用 docker 中的交换会计吗?
我的docker信息:
root@proxima:~# docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 18.05.0-ce
Storage Driver: btrfs
Build Version: Btrfs v4.15.1
Library Version: 102
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 773c489c9c1b21a6d78b5c538cd395416ec50f88
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: 949e6fa
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.15.0-20-generic
Operating System: Ubuntu 18.04 LTS
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 31.33GiB
Name: proxima
ID: HFCK:DE5O:VDGY:PK3Z:WXNP:OF4P:CGIV:Z3XE:TM7F:VIMG:7ZUH:CXNW
Docker Root Dir: /ozone/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
我的etc/fstab:
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/md2 / ext4 errors=remount-ro,discard 0 1
/dev/md1 /boot ext4 errors=remount-ro,discard 0 1
/dev/sda3 swap swap defaults 0 0
/dev/sdb3 swap swap defaults 0 0
/dev/sda4 /ozone btrfs defaults,noatime,ssd,compress=zstd,commit=120 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
答案1
解决方案是在 中编辑文件,/etc/default/grub.d/
而不是编辑文件/etc/default/grub
。
不知道他们为什么改变它。