zoukankan      html  css  js  c++  java
  • k8s node update kernel

    本文centos 7.8为例

    1、无公网、无内部yum源更新内核

    1.1 需要访问以下地址,下载elrepo源的kernel rpm包

    http://elrepo.org/linux/kernel
    http://mirrors.tuna.tsinghua.edu.cn/elrepo/kernel/

    1.2 执行以下脚本安装

    cat local-update-kernel-lt-5.4.sh
    #!/bin/bash
    
    # 通常安装以下两个包即可
    yum install -y ./kernel-lt-5.4.104-1.el7.elrepo.x86_64.rpm ./kernel-lt-devel-5.4.104-1.el7.elrepo.x86_64.rpm
    
    echo ""
    grep "menuentry " /boot/grub2/grub.cfg
    
    echo ""
    grub2-set-default 'CentOS Linux (5.4.104-1.el7.elrepo.x86_64) 7 (Core)'
    
    echo ""
    grub2-mkconfig -o /etc/grub2.cfg
    
    echo ""
    grub2-editenv list
    

    1.3 重启server

    2、配置rpm源安装,更新内核

    2.1 elrepo官方源配置

    cat elrepo.reop
    ### Name: ELRepo.org Community Enterprise Linux Repository for el7
    ### URL: https://elrepo.org/
    
    [elrepo]
    name=ELRepo.org Community Enterprise Linux Repository - el7
    baseurl=http://elrepo.org/linux/elrepo/el7/$basearch/
            http://mirrors.coreix.net/elrepo/elrepo/el7/$basearch/
            http://mirror.rackspace.com/elrepo/elrepo/el7/$basearch/
            http://linux-mirrors.fnal.gov/linux/elrepo/elrepo/el7/$basearch/
    mirrorlist=http://mirrors.elrepo.org/mirrors-elrepo.el7
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
    protect=0
    
    [elrepo-testing]
    name=ELRepo.org Community Enterprise Linux Testing Repository - el7
    baseurl=http://elrepo.org/linux/testing/el7/$basearch/
            http://mirrors.coreix.net/elrepo/testing/el7/$basearch/
            http://mirror.rackspace.com/elrepo/testing/el7/$basearch/
            http://linux-mirrors.fnal.gov/linux/elrepo/testing/el7/$basearch/
    mirrorlist=http://mirrors.elrepo.org/mirrors-elrepo-testing.el7
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
    protect=0
    
    [elrepo-kernel]
    name=ELRepo.org Community Enterprise Linux Kernel Repository - el7
    baseurl=http://elrepo.org/linux/kernel/el7/$basearch/
            http://mirrors.coreix.net/elrepo/kernel/el7/$basearch/
            http://mirror.rackspace.com/elrepo/kernel/el7/$basearch/
            http://linux-mirrors.fnal.gov/linux/elrepo/kernel/el7/$basearch/
    mirrorlist=http://mirrors.elrepo.org/mirrors-elrepo-kernel.el7
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
    protect=0
    
    [elrepo-extras]
    name=ELRepo.org Community Enterprise Linux Extras Repository - el7
    baseurl=http://elrepo.org/linux/extras/el7/$basearch/
            http://mirrors.coreix.net/elrepo/extras/el7/$basearch/
            http://mirror.rackspace.com/elrepo/extras/el7/$basearch/
            http://linux-mirrors.fnal.gov/linux/elrepo/extras/el7/$basearch/
    mirrorlist=http://mirrors.elrepo.org/mirrors-elrepo-extras.el7
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
    protect=0
    

    2.2 国内清华源配置

    cat elrepo-tsinghua.repo
    [elrepo]
    name=ELRepo.org Community Enterprise Linux Repository - el7
    baseurl=http://mirrors.tuna.tsinghua.edu.cn/elrepo/elrepo/el7/$basearch/
            http://mirrors.coreix.net/elrepo/elrepo/el7/$basearch/
            http://mirror.rackspace.com/elrepo/elrepo/el7/$basearch/
            http://linux-mirrors.fnal.gov/linux/elrepo/elrepo/el7/$basearch/
    
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
    protect=0
    
    [elrepo-testing]
    name=ELRepo.org Community Enterprise Linux Testing Repository - el7
    baseurl=http://mirrors.tuna.tsinghua.edu.cn/elrepo/testing/el7/$basearch/
            http://mirrors.coreix.net/elrepo/testing/el7/$basearch/
            http://mirror.rackspace.com/elrepo/testing/el7/$basearch/
            http://linux-mirrors.fnal.gov/linux/elrepo/testing/el7/$basearch/
    
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
    protect=0
    
    [elrepo-kernel]
    name=ELRepo.org Community Enterprise Linux Kernel Repository - el7
    baseurl=http://mirrors.tuna.tsinghua.edu.cn/elrepo/kernel/el7/$basearch/
            http://mirrors.coreix.net/elrepo/kernel/el7/$basearch/
            http://mirror.rackspace.com/elrepo/kernel/el7/$basearch/
            http://linux-mirrors.fnal.gov/linux/elrepo/kernel/el7/$basearch/
    
    enabled=1
    gpgcheck=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
    protect=0
    
    [elrepo-extras]
    name=ELRepo.org Community Enterprise Linux Extras Repository - el7
    baseurl=http://mirrors.tuna.tsinghua.edu.cn/elrepo/extras/el7/$basearch/
            http://mirrors.coreix.net/elrepo/extras/el7/$basearch/
            http://mirror.rackspace.com/elrepo/extras/el7/$basearch/
            http://linux-mirrors.fnal.gov/linux/elrepo/extras/el7/$basearch/
    
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
    protect=0
    

    2.3、更新内核

    lt:长期支持

    [root@test elrepo-kernel-update]# cat update-kernel-lt-5.4.sh
    #!/bin/bash
    
    # 为了方便关闭了yum gpgcheck
    cp elrepo-navinfo.repo  /etc/yum.repos.d/
    yum makecache
    
    # 通常安装以下两个包即可
    yum install -y kernel-lt kernel-lt-devel
    
    
    grep "menuentry " /boot/grub2/grub.cfg
    
    # 这里的kernel版本以实际安装为准
    grub2-set-default 'CentOS Linux (5.4.104-1.el7.elrepo.x86_64) 7 (Core)'
    
    grub2-mkconfig -o /etc/grub2.cfg
    
    grub2-editenv list
    

    ml:主线版本,短期支持

    [root@test elrepo-kernel-update]# cat update-kernel-ml-5.11.sh
    #!/bin/bash
    
    yum remove -y kernel-tools-libs kernel-tools kernel-headers
    
    yum install -y kernel-ml kernel-ml-devel kernel-ml-doc kernel-ml-headers kernel-ml-tools kernel-ml-tools-libs kernel-ml-tools-libs-devel
    
    yum install -y glibc-headers  sg3_utils-devel
    
    
    grep "menuentry " /boot/grub2/grub.cfg
    
    # 以下kernel版本以实际安装为准
    grub2-set-default 'CentOS Linux (5.11.5-1.el7.elrepo.x86_64) 7 (Core)'
    grub2-editenv list
    
    grub2-mkconfig -o /etc/grub2.cfg
    
  • 相关阅读:
    Centos7 安装 MySQL5.7
    搭建Harbor企业级docker仓库
    HAProxy安装文档
    mysqlbinlog查看 binlog日志报错mysqlbinlog: unknown variable 'default-character-set=utf8mb4'
    mysql删除数据库报错及解决方法
    服务器流量异常排查步骤(查看进程的流量)
    基于Docker Hub镜像的ProxySQL容器化部署与运行
    ProxySQL环境下,快速处理异常会话的方法(黑名单、KILL)
    DB2 SQL 错误(SQLCODE:-964,SQLSTATE:57011)处理方法
    pg_hba.conf、pool_hba.conf 以及 pool_passwd 三者间的关系
  • 原文地址:https://www.cnblogs.com/nineep/p/14977260.html
Copyright © 2011-2022 走看看