瞻博网络 Docker 容器抱怨免费大页面不可用

瞻博网络 Docker 容器抱怨免费大页面不可用

在我的 CentOS 7.2 中,我运行 openjnpr-container-vmx,但出现错误:

[root@centos ~]# docker run  juniper/openjnpr-container-vmx
Juniper Networks vMX Docker Light Container
 
Linux b32d308d36eb 4.18.0-193.el8.x86_64 #1 SMP Fri May 8 10:59:10 UTC 2020 x86_64
 
CPU Model ................................ Intel(R) Xeon(R) CPU E3-1230 v5 @ 3.40GHz
CPU affinity of this container ........... 0-7
KVM hardware virtualization extension .... yes
Total System Memory ...................... 15 GB
Free Hugepages ........................... none! Please provision at least 1G (512x2MB or 1x1GB) hugepage
Check for container privileged mode ...... yes
Check for sudo/root privileges ........... yes
Loop mount filesystem capability ......... no
docker access ............................ no (optional)

lcpu affinity ............................  0-7

NUMA node(s):        1
NUMA node0 CPU(s):   0-7

1 optional features missing. Ignored
2 failed system dependencies. Terminating

===

我的专用服务器硬件信息:

[root@centos ~]# free -mh
              total        used        free      shared  buff/cache   available
Mem:           15Gi       1.4Gi       395Mi       832Mi        13Gi        13Gi
Swap:         7.8Gi       2.0Mi       7.8Gi

CPU 型号:Intel(R) Xeon(R) CPU E3-1230 v5 @ 3.40GHz

答案1

来自 OpenJNPR-Container-vMX启用大页面部分:

启用大页面

通过添加以下内核选项定义至少 1024 x 2MB 大页面或 2 x 1GB 大页面:

GRUB_CMDLINE_LINUX="default_hugepagesz=1G hugepagesz=1G hugepages=2"

或者

GRUB_CMDLINE_LINUX="hugepages=1024"

到文件 /etc/default/grub,然后运行 ​​update-grub 并重新启动:

$ sudo update-grub
$ reboot

系统恢复后,检查大页面的可用性(所示示例保留了 16x1GB 页面):

$ cat /proc/meminfo |grep Huge
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
HugePages_Total:      16
HugePages_Free:       16
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:    1048576 kB

相关内容