Centos7 升级内核

庆云2年前技术文章866

1、查看当前内核版本

$ uname -rs
Linux 3.10.0-1160.45.1.el7.x86_64


2、安装 ELRepo

# 载入公钥
$ rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

# 安装 ELRepo 最新版本
$ yum install -y https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm


3、安装最新的内核版本

查询可使用的 Kernel 包版本:

  • lt 表示长期维护版

  • ml 表示最新稳定版

$ yum list available --disablerepo=* --enablerepo=elrepo-kernel
Loaded plugins: fastestmirror
elrepo-kernel                                                                    | 3.0 kB  00:00:00    
elrepo-kernel/primary_db                                                         | 3.1 MB  00:01:45    
Determining fastest mirrors
* elrepo-kernel: mirrors.tuna.tsinghua.edu.cn
Available Packages
kernel-lt.x86_64                              5.4.249-1.el7.elrepo                    elrepo-kernel
kernel-lt-devel.x86_64                        5.4.249-1.el7.elrepo                    elrepo-kernel
kernel-lt-doc.noarch                          5.4.249-1.el7.elrepo                    elrepo-kernel
kernel-lt-headers.x86_64                      5.4.249-1.el7.elrepo                    elrepo-kernel
kernel-lt-tools.x86_64                        5.4.249-1.el7.elrepo                    elrepo-kernel
kernel-lt-tools-libs.x86_64                   5.4.249-1.el7.elrepo                    elrepo-kernel
kernel-lt-tools-libs-devel.x86_64             5.4.249-1.el7.elrepo                    elrepo-kernel
kernel-ml.x86_64                              6.4.1-1.el7.elrepo                      elrepo-kernel
kernel-ml-devel.x86_64                        6.4.1-1.el7.elrepo                      elrepo-kernel
kernel-ml-doc.noarch                          6.4.1-1.el7.elrepo                      elrepo-kernel
kernel-ml-headers.x86_64                      6.4.1-1.el7.elrepo                      elrepo-kernel
kernel-ml-tools.x86_64                        6.4.1-1.el7.elrepo                      elrepo-kernel
kernel-ml-tools-libs.x86_64                   6.4.1-1.el7.elrepo                      elrepo-kernel
kernel-ml-tools-libs-devel.x86_64             6.4.1-1.el7.elrepo                      elrepo-kernel
perf.x86_64                                   5.4.249-1.el7.elrepo                    elrepo-kernel
python-perf.x86_64                            5.4.249-1.el7.elrepo                    elrepo-kernel                                                                    


安装指定的 Kernel 版本:

$ yum install -y kernel-lt-5.4.249-1.el7.elrepo --enablerepo=elrepo-kernel


设置指定的 Kernel 版本:

# 查看系统可用的内核
$ cat /boot/grub2/grub.cfg | grep menuentry
if [ x"${feature_menuentry_id}" = xy ]; then
 menuentry_id_option="--id"
 menuentry_id_option=""
export menuentry_id_option
menuentry 'CentOS Linux (5.4.249-1.el7.elrepo.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-514.26.2.el7.x86_64-advanced-59d9ca7b-4f39-4c0c-9334-c56c182076b5' {
menuentry 'CentOS Linux (3.10.0-514.26.2.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-514.26.2.el7.x86_64-advanced-59d9ca7b-4f39-4c0c-9334-c56c182076b5' {
menuentry 'CentOS Linux (3.10.0-514.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-514.el7.x86_64-advanced-59d9ca7b-4f39-4c0c-9334-c56c182076b5' {
menuentry 'CentOS Linux (0-rescue-963c2c41b08343f7b063dddac6b2e486) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-963c2c41b08343f7b063dddac6b2e486-advanced-59d9ca7b-4f39-4c0c-9334-c56c182076b5' {

# 设置开机新内核启动
$ grub2-set-default "CentOS Linux (5.4.249-1.el7.elrepo.x86_64) 7 (Core)"

# 查看当前内核启动项
$ grub2-editenv list
saved_entry=CentOS Linux (5.4.249-1.el7.elrepo.x86_64) 7 (Core)


重启系统并验证 Kernel 版本:

# 重启系统
$ reboot

# 启动完成查看内核版本是否更新
$ uname -rs
Linux 5.4.249-1.el7.elrepo.x86_64


相关文章

oracle adg切换

1 主库转备库注意:原则上至多只能有一个主库,但是备库可以多个,所以需要先进行主库转备库操作。1.1 查看主库角色切换状态SYS@proe>select name,database_role,s...

oracle回收站简介

一、回收站简介1、概念和功能回收站从ORACLE 10g开始引入,全称叫Tablespace Recycle Bin。回收站实际是一个逻辑区域,使用的已经分配的表空间,表被drop时,数据不会实际删除...

ES运维(五)聚合分析流程及精准度

ES运维(五)聚合分析流程及精准度

1、 概述ES是一个近实时的搜索引擎,提供近实时海量数据的聚合分析功能,但这个海量数据聚合分析是会损失一定的精准度来满足实时性能需要的。 2、 分布式系统的近似统计算法如下图,在分布式数据分...

image.png

kvm相关命令

一、管理kvm虚拟机1、创建虚拟机virt-install --name=centos1 –ram 1024 --vcpus=1 –disk path=/root/centos1.img,size...

Hbase热点现象

热点现象:HBase热点现象是指在分布式存储系统HBase中,由于数据访问不均衡而导致部分Region Server负载过重的情况。这种不均衡通常是由于某些特定的数据行或列族频繁地被访问,从而导致某个...

Hue添加Impala数据源

Hue添加Impala数据源

一、前言使用Hue操作impala进行查询。二、修改Hue配置1.在CM页面选择Hue,点击配置,找到Impala服务将服务范围勾选为Impala2.在hue_safety_valve.ini 的Hu...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。