说明:如下操作均为再安装的本地虚拟机中执行,生产操作慎行!!!
一、升级内核
查看当前内核版本:
[root@localhost ~]# uname -r
3.10.0-1160.el7.x86_64
[root@localhost ~]#
升级系统:yum update -y 等待结束
安装 ELRepo
[root@localhost ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
[root@localhost ~]# rpm -Uvh https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
获取https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
准备中... ################################# [100%]
正在升级/安装...
1:elrepo-release-7.0-3.el7.elrepo ################################# [100%]
[root@localhost ~]#
安装新内核
[root@localhost ~]# yum remove -y kernel-headers kernel-tools kernel-tools-libs
已加载插件:fastestmirror
参数 kernel-headers 没有匹配
正在解决依赖关系
--> 正在检查事务
---> 软件包 kernel-tools.x86_64.0.3.10.0-1160.24.1.el7 将被 删除
---> 软件包 kernel-tools-libs.x86_64.0.3.10.0-1160.24.1.el7 将被 删除
--> 解决依赖关系完成
...
[root@localhost ~]# yum --enablerepo=elrepo-kernel install -y kernel-ml kernel-ml-devel kernel-ml-headers
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* elrepo: mirror-hk.koddos.net
* elrepo-kernel: mirror-hk.koddos.net
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
elrepo-kernel
...
更新 Grub :
[root@localhost ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.11.16-1.el7.elrepo.x86_64
Found initrd image: /boot/initramfs-5.11.16-1.el7.elrepo.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-1160.24.1.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-1160.24.1.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-1160.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-1160.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-938d6e3e5c734cc4bafc19638fdae2da
Found initrd image: /boot/initramfs-0-rescue-938d6e3e5c734cc4bafc19638fdae2da.img
done
[root@localhost ~]# grub2-set-default 0
[root@localhost ~]#
重启
[root@localhost ~]# reboot
确认内核是否升级成功
[root@localhost ~]# uname -r
5.11.16-1.el7.elrepo.x86_64
[root@localhost ~]#
二、安装bcc-tools
安装
[root@localhost ~]# yum install -y bcc-tools
配置路径
[root@localhost ~]# export PATH=$PATH:/usr/share/bcc/tools
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/share/bcc/tools
[root@localhost ~]#
众多工具在/usr/share/bcc/tools 路径下