故障

企业微信截图_0158bcf7-a1b3-427f-a525-e8b3f09cda46

如图:系统日志中报出不能分配内存

解决方法:

  • 临时解决:重启相关节点
  • 永久解决:
    • 升级内核:3.10.0-1062.XXX.el7.x86_64
      yum provides kernel
      yum install -y kernel-3.10.0-1062.9.1.el7.x86_64
      awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
      
    • 添加内核参数 cgroup.memory=nokmem
      [root@acp2-node-1 ~]# cat /etc/default/grub
      GRUB_TIMEOUT=5
      GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
      GRUB_DEFAULT=saved
      GRUB_DISABLE_SUBMENU=true
      GRUB_TERMINAL="serial console"
      GRUB_TERMINAL_OUTPUT="serial console"
      GRUB_CMDLINE_LINUX="crashkernel=auto cgroup.memory=nokmem console=ttyS0 console=tty0 panic=5 net.ifnames=0 biosdevname=0"
      GRUB_DISABLE_RECOVERY="true"
      GRUB_SERIAL_COMMAND="serial --speed=9600 --unit=0 --word=8 --parity=no --stop=1"
      [root@acp2-node-1 ~]#
      
    • 保存退出,刷新grup菜单,并重启节点使永久生效
      [root@acp2-node-1 ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
      [root@acp2-node-1 ~]# reboot
      
    • 查看是否生效
      [root@region ~]# cat /proc/cmdline
      BOOT_IMAGE=/vmlinuz-3.10.0-1062.9.1.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto cgroup.memory=nokmem rd.lvm.lv=centos/root rhgb quiet