• 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
    
  • 相关阅读:
    Mysql:Changes in MySQL 5.6.6 (2012-08-07, Milestone 9):Group-Commit等等:重大变化版本!
    Mysql:Changes in MySQL 5.6.9 (2012-12-11, Release Candidate):GTID-based variables have been 【renamed】
    Mysql:Changes in MySQL 5.6.13 (2013-07-31, General Availability):不再支持可能引起混乱的【选项缩略】写法!
    Mysql:Changes in MySQL 5.6.22 (2014-12-01, General Availability):【sql-log-bin】
    Mysql:Changes in MySQL 5.6.30 (2016-04-11, General Availability):--ssl-mode:
    Mysql:Changes in MySQL 5.6.34 (2016-10-12, General Availability):secure-file-priv
    Windows Linux子系统Windows 10安装指南
    WSL2-参考的对象类型不支持尝试的操作。
    Win10开启Hyper-V后无法运行VMware虚拟机的解决方法
    Kubernetes---高可用的 K8S 集群构建
  • 原文地址:https://www.cnblogs.com/nineep/p/14977260.html
Copyright © 2020-2023  润新知