背景:
centos 内核版本 3.10 。该版本不支持 k8s的使用,需要升级。
首先是用yum进行升级,
如:https://www.cnblogs.com/xzkzzz/p/9627658.html 所示
(或者:https://www.linuxprobe.com/update-kernel-centos7.html)
说明: 安装grub2-mkconfig:
通过 yum provides grub2-mkconfig 找到对应的包,然后yum install 包
以上方法更新失败。
尝试本地编译安装:
可参考: https://www.linuxidc.com/Linux/2019-11/161257.htm
最后 make install 时,报错:
sh ./arch/x86/boot/install.sh 5.4.69 arch/x86/boot/bzImage
System.map “/boot”
/sbin/dracut: line 1215: /proc/crypto: No such file or directory
后来查到原因:
it means that you don’t have a real CentOS system and are not in control of the kernel in any case so it’s pointless trying to yum update it. You need to talk to your hoster and ask them about it. If you were sold this as a CentOS system then you don’t have one, you have openvz instead.
也就说用的是个容器并非真的centos系统, 所以更改失败。只能找云服务器厂商帮忙升级。
OpenVZ:
OpenVZ是开源软件,是基于Linux平台的操作系统级服务器虚拟化解决方案。OpenVZ采用SWsoft的Virtuozzo虚拟化服务器软件产品的内核,Virutozzo是SWsoft公司提供的商业虚拟化解决方案