4

我正在尝试在启用 cgroups v2 的情况下运行 podman。我发现了几篇博文,解释了如何将运行时更改为crun并将cgroup_manager 更改cgroupfs。但我不知道如何实际将 cgroup 版本设置为 v2。

我在 Manjaro Linx Kernerl 5.4 上运行 podman,所以,如果我是正确的,应该支持 cgroups v2。

这里是 podman info 的输出:

host:
  BuildahVersion: 1.14.3
  CgroupVersion: v1
  Conmon:
    package: Unknown
    path: /usr/bin/conmon
    version: 'conmon version 2.0.15, commit: 1bddbf7051a973f4a4fecf06faa0c48e82f1e9e1'
  Distribution:
    distribution: manjaro
    version: unknown
  IDMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 65536
      size: 66536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 65536
      size: 66536
  MemFree: 9938743296
  MemTotal: 16709140480
  OCIRuntime:
    name: crun
    package: Unknown
    path: /usr/bin/crun
    version: |-
      crun version 0.13
      commit: e79e4de4ac16da0ce48777afb72c6241de870525
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  SwapFree: 18296258560
  SwapTotal: 18296258560
  arch: amd64
  cpus: 6
  eventlogger: journald
  hostname: josef-pc
  kernel: 5.4.30-1-MANJARO
  os: linux
  rootless: true
  slirp4netns:
    Executable: /usr/bin/slirp4netns
    Package: Unknown
    Version: |-
      slirp4netns version 1.0.0
      commit: a3be729152a33e692cd28b52f664defbf2e7810a
      libslirp: 4.1.0
  uptime: 18m 20.54s
registries:
  search:
  - docker.io
  - registry.fedoraproject.org
  - quay.io
  - registry.access.redhat.com
  - registry.centos.org
store:
  ConfigFile: /home/josmos/.config/containers/storage.conf
  ContainerStore:
    number: 0
  GraphDriverName: overlay
  GraphOptions:
    overlay.mount_program:
      Executable: /usr/bin/fuse-overlayfs
      Package: Unknown
      Version: |-
        fusermount3 version: 3.9.1
        fuse-overlayfs: version 0.7.8
        FUSE library version 3.9.1
        using FUSE kernel interface version 7.31
  GraphRoot: /home/josmos/.local/share/containers/storage
  GraphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  ImageStore:
    number: 9
  RunRoot: /run/user/1000/containers
  VolumePath: /home/josmos/.local/share/containers/storage/volumes
4

1 回答 1

3

你在使用 OpenRC 吗?据我所知,您需要rc_cgroup_mode="unified"rc.conf文件中进行设置。

如果您使用的是 systemd,则需要运行# grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=1".

于 2020-04-22T20:37:20.430 回答