二进制装置Kubernetes(k8s)v1.31.1
二进制装置Kubernetes(k8s)v1.31.1
介绍
https://github.com/cby-chen/Kubernetes 开源不易,帮助点个star,谢谢了
kubernetes(k8s)二进制高可用装置布置,支撑IPv4+IPv6双栈。
强烈建议在Github上检查文档 !!!
Github出问题会更新文档,而且后续尽可能第一时刻更新新版本文档 !!!
手动项目地址:https://github.com/cby-chen/Kubernetes
1.环境
主机称号 | IP地址 | 阐明 | 软件 |
---|---|---|---|
192.168.1.60 | 外网节点 | 下载各种所需装置包 | |
Master01 | 192.168.1.31 | master节点 | kube-apiserver、kube-controller-manager、kube-scheduler、etcd、 kubelet、kube-proxy、nfs-client、haproxy、keepalived、nginx |
Master02 | 192.168.1.32 | master节点 | kube-apiserver、kube-controller-manager、kube-scheduler、etcd、 kubelet、kube-proxy、nfs-client、haproxy、keepalived、nginx |
Master03 | 192.168.1.33 | master节点 | kube-apiserver、kube-controller-manager、kube-scheduler、etcd、 kubelet、kube-proxy、nfs-client、haproxy、keepalived、nginx |
Node01 | 192.168.1.34 | node节点 | kubelet、kube-proxy、nfs-client、nginx |
Node02 | 192.168.1.35 | node节点 | kubelet、kube-proxy、nfs-client、nginx |
192.168.1.36 | VIP |
网段
物理主机:192.168.1.0/24
service:10.96.0.0/12
pod:172.16.0.0/12
装置包现已整理好:https://mirrors.chenby.cn/https://github.com/cby-chen/Kubernetes/releases/download/v1.31.1/kubernetes-v1.31.1.tar
1.1.k8s根底体系环境装备
1.2.装备IP
# 留意!
# 若虚拟机是进行克隆的那么网卡的UUID和MachineID会重复
# 需求从头生成新的UUIDUUID和MachineID
# UUID和MachineID重复无法DHCP获取到IPV6地址
ssh [email protected] "rm -rf /etc/machine-id; systemd-machine-id-setup;reboot"
ssh [email protected] "rm -rf /etc/machine-id; systemd-machine-id-setup;reboot"
ssh [email protected] "rm -rf /etc/machine-id; systemd-machine-id-setup;reboot"
ssh [email protected] "rm -rf /etc/machine-id; systemd-machine-id-setup;reboot"
ssh [email protected] "rm -rf /etc/machine-id; systemd-machine-id-setup;reboot"
#
# 检查当时的网卡列表和 UUID:
# nmcli con show
# 删去要更改 UUID 的网络衔接:
# nmcli con delete uuid <原 UUID>
# 从头生成 UUID:
# nmcli con add type ethernet ifname <接口称号> con-name <新称号>
# 从头启用网络衔接:
# nmcli con up <新称号>
# 更改网卡的UUID
# 先装备静态IP之后运用ssh办法装备不断连
ssh [email protected] "nmcli con delete uuid 628b03ed-3c1e-32ea-b001-eb5b8ac73285;nmcli con add type ethernet ifname ens18 con-name ens18;nmcli con up ens18"
ssh [email protected] "nmcli con delete uuid 628b03ed-3c1e-32ea-b001-eb5b8ac73285;nmcli con add type ethernet ifname ens18 con-name ens18;nmcli con up ens18"
ssh [email protected] "nmcli con delete uuid 628b03ed-3c1e-32ea-b001-eb5b8ac73285;nmcli con add type ethernet ifname ens18 con-name ens18;nmcli con up ens18"
ssh [email protected] "nmcli con delete uuid 628b03ed-3c1e-32ea-b001-eb5b8ac73285;nmcli con add type ethernet ifname ens18 con-name ens18;nmcli con up ens18"
ssh [email protected] "nmcli con delete uuid 628b03ed-3c1e-32ea-b001-eb5b8ac73285;nmcli con add type ethernet ifname ens18 con-name ens18;nmcli con up ens18"
# 参数解说
#
# ssh ssh [email protected]
# 运用SSH登录到IP为192.168.1.31的主机,运用root用户身份。
#
# nmcli con delete uuid 708a1497-2192-43a5-9f03-2ab936fb3c44
# 删去 UUID 为 708a1497-2192-43a5-9f03-2ab936fb3c44 的网络衔接,这是 NetworkManager 中一种特定网络装备的仅有标识符。
#
# nmcli con add type ethernet ifname ens18 con-name ens18
# 增加一种以太网衔接类型,并指定接口名为 ens18,衔接称号也为 ens18。
#
# nmcli con up ens18
# 敞开 ens18 这个网络衔接。
#
# 简略来说,这个指令的作用是删去一个特定的网络衔接装备,并增加一个名为 ens18 的以太网衔接,然后启用这个新的衔接。
# 修正静态的IPv4地址
ssh [email protected] "nmcli con mod ens18 ipv4.addresses 192.168.1.31/24; nmcli con mod ens18 ipv4.gateway 192.168.1.1; nmcli con mod ens18 ipv4.method manual; nmcli con mod ens18 ipv4.dns "8.8.8.8"; nmcli con up ens18"
ssh [email protected] "nmcli con mod ens18 ipv4.addresses 192.168.1.32/24; nmcli con mod ens18 ipv4.gateway 192.168.1.1; nmcli con mod ens18 ipv4.method manual; nmcli con mod ens18 ipv4.dns "8.8.8.8"; nmcli con up ens18"
ssh [email protected] "nmcli con mod ens18 ipv4.addresses 192.168.1.33/24; nmcli con mod ens18 ipv4.gateway 192.168.1.1; nmcli con mod ens18 ipv4.method manual; nmcli con mod ens18 ipv4.dns "8.8.8.8"; nmcli con up ens18"
ssh [email protected] "nmcli con mod ens18 ipv4.addresses 192.168.1.34/24; nmcli con mod ens18 ipv4.gateway 192.168.1.1; nmcli con mod ens18 ipv4.method manual; nmcli con mod ens18 ipv4.dns "8.8.8.8"; nmcli con up ens18"
ssh [email protected] "nmcli con mod ens18 ipv4.addresses 192.168.1.35/24; nmcli con mod ens18 ipv4.gateway 192.168.1.1; nmcli con mod ens18 ipv4.method manual; nmcli con mod ens18 ipv4.dns "8.8.8.8"; nmcli con up ens18"
# 参数解说
#
# ssh [email protected]
# 运用SSH登录到IP为192.168.1.154的主机,运用root用户身份。
#
# "nmcli con mod ens18 ipv4.addresses 192.168.1.31/24"
# 修正ens18网络衔接的IPv4地址为192.168.1.31,子网掩码为 24。
#
# "nmcli con mod ens18 ipv4.gateway 192.168.1.1"
# 修正ens18网络衔接的IPv4网关为192.168.1.1。
#
# "nmcli con mod ens18 ipv4.method manual"
# 将ens18网络衔接的IPv4装备办法设置为手动。
#
# "nmcli con mod ens18 ipv4.dns "8.8.8.8"
# 将ens18网络衔接的IPv4 DNS服务器设置为 8.8.8.8。
#
# "nmcli con up ens18"
# 发动ens18网络衔接。
#
# 整体来说,这条指令是经过SSH长途登录到指定的主机,并运用网络办理指令 (nmcli) 修正ens18网络衔接的装备,包含IP地址、网关、装备办法和DNS服务器,并发动该网络衔接。
# 没有固定IPv6挑选不装备即可
ssh [email protected] "nmcli con mod ens18 ipv6.addresses fc00:43f4:1eea:1::10; nmcli con mod ens18 ipv6.gateway fc00:43f4:1eea:1::1; nmcli con mod ens18 ipv6.method manual; nmcli con mod ens18 ipv6.dns "2400:3200::1"; nmcli con up ens18"
ssh [email protected] "nmcli con mod ens18 ipv6.addresses fc00:43f4:1eea:1::20; nmcli con mod ens18 ipv6.gateway fc00:43f4:1eea:1::1; nmcli con mod ens18 ipv6.method manual; nmcli con mod ens18 ipv6.dns "2400:3200::1"; nmcli con up ens18"
ssh [email protected] "nmcli con mod ens18 ipv6.addresses fc00:43f4:1eea:1::30; nmcli con mod ens18 ipv6.gateway fc00:43f4:1eea:1::1; nmcli con mod ens18 ipv6.method manual; nmcli con mod ens18 ipv6.dns "2400:3200::1"; nmcli con up ens18"
ssh [email protected] "nmcli con mod ens18 ipv6.addresses fc00:43f4:1eea:1::40; nmcli con mod ens18 ipv6.gateway fc00:43f4:1eea:1::1; nmcli con mod ens18 ipv6.method manual; nmcli con mod ens18 ipv6.dns "2400:3200::1"; nmcli con up ens18"
ssh [email protected] "nmcli con mod ens18 ipv6.addresses fc00:43f4:1eea:1::50; nmcli con mod ens18 ipv6.gateway fc00:43f4:1eea:1::1; nmcli con mod ens18 ipv6.method manual; nmcli con mod ens18 ipv6.dns "2400:3200::1"; nmcli con up ens18"
# 参数解说
#
# ssh [email protected]
# 经过SSH衔接到IP地址为192.168.1.31的长途主机,运用root用户进行登录。
#
# "nmcli con mod ens18 ipv6.addresses fc00:43f4:1eea:1::10"
# 运用nmcli指令修正ens18接口的IPv6地址为fc00:43f4:1eea:1::10。
#
# "nmcli con mod ens18 ipv6.gateway fc00:43f4:1eea:1::1"
# 运用nmcli指令修正ens18接口的IPv6网关为fc00:43f4:1eea:1::1。
#
# "nmcli con mod ens18 ipv6.method manual"
# 运用nmcli指令将ens18接口的IPv6装备办法修正为手动装备。
#
# "nmcli con mod ens18 ipv6.dns "2400:3200::1"
# 运用nmcli指令设置ens18接口的IPv6 DNS服务器为2400:3200::1。
#
# "nmcli con up ens18"
# 运用nmcli指令发动ens18接口。
#
# 这个指令的意图是在长途主机上装备ens18接口的IPv6地址、网关、装备办法和DNS服务器,并发动ens18接口。
# 检查网卡装备
# nmcli device show ens18
# nmcli con show ens18
[root@localhost ~]# cat /etc/NetworkManager/system-connections/ens18.nmconnection
[connection]
id=ens18
uuid=97445eea-70e8-47a7-8be4-a707de271f5e
type=ethernet
interface-name=ens18
timestamp=1716705021
[ethernet]
[ipv4]
address1=192.168.1.31/24,192.168.1.1
dns=8.8.8.8;
method=manual
[ipv6]
addr-gen-mode=default
method=auto
[proxy]
[root@localhost ~]#
# 参数解说
# 1. `[connection]`:
# - `id`: 衔接的仅有标识符,用于内部引证。
# - `uuid`: 衔接的通用仅有标识符(UUID),保证在体系中的仅有性。
# - `type`: 指定衔接的类型,本例中为以太网。
# - `interface-name`: 网络接口的称号(`ens18`),表明与此衔接相关的物理或逻辑网络接口。
# - `timestamp`: 时刻戳,指示衔接装备前次修正的时刻。
# 2. `[ethernet]`:
# - 一般包含以太网特定的装备设置,如MAC地址或链路速度。
# 3. `[ipv4]`:
# - `address1`: 以CIDR表明法指定IPv4地址和子网掩码(`192.168.1.31/24`)。还包含网关IP(`192.168.1.1`)。
# - `dns`: 指定要运用的DNS服务器(本例中为`8.8.8.8`),供给将域名转换为IP地址的手法。
# - `method`: 指定获取IPv4地址的办法。在本例中,设置为手动,表明IP地址是静态装备的。
# 4. `[ipv6]`:
# - `addr-gen-mode`: 指定IPv6地址生成形式。设置为默许,一般意味着地址是依据接口的MAC地址生成的。
# - `method`: 指定获取IPv6地址的办法。在本例中,设置为主动,表明运用DHCPv6或SLAAC等协议进行主动装备。
# 5. `[proxy]`:
# - 一般用于装备署理设置,如HTTP或SOCKS署理。
1.3.设置主机名
hostnamectl set-hostname k8s-master01
hostnamectl set-hostname k8s-master02
hostnamectl set-hostname k8s-master03
hostnamectl set-hostname k8s-node01
hostnamectl set-hostname k8s-node02
# 参数解说
#
# 参数: set-hostname
# 解说: 这是hostnamectl指令的一个参数,用于设置体系的主机名。
#
# 参数: k8s-master01
# 解说: 这是要设置的主机名,将体系的主机名设置为"k8s-master01"。
1.4.装备yum源
# 其他体系的源地址
# https://help.mirrors.cernet.edu.cn/
# 关于私有库房
sed -e 's|^mirrorlist=|#mirrorlist=|g' -e 's|^#baseurl=http://mirror.centos.org/\$contentdir|baseurl=http://192.168.1.123/centos|g' -i.bak /etc/yum.repos.d/CentOS-*.repo
# 关于 Ubuntu
sed -i 's/cn.archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
# epel扩展源
sudo yum install -y epel-release
sudo sed -e 's!^metalink=!#metalink=!g' \
-e 's!^#baseurl=!baseurl=!g' \
-e 's!https\?://download\.fedoraproject\.org/pub/epel!https://mirror.nju.edu.cn/epel!g' \
-e 's!https\?://download\.example/pub/epel!https://mirror.nju.edu.cn/epel!g' \
-i /etc/yum.repos.d/epel{,-testing}.repo
# 关于 CentOS 7
sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \
-e 's|^#baseurl=http://mirror.centos.org/centos|baseurl=https://mirror.nju.edu.cn/centos|g' \
-i.bak \
/etc/yum.repos.d/CentOS-*.repo
# 关于 CentOS 8
sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \
-e 's|^#baseurl=http://mirror.centos.org/$contentdir|baseurl=https://mirror.nju.edu.cn/centos|g' \
-i.bak \
/etc/yum.repos.d/CentOS-*.repo
# 关于CentOS 9
cat <<'EOF' > /etc/yum.repos.d/centos.repo
[baseos]
name=CentOS Stream $releasever - BaseOS
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/BaseOS/$basearch/os
# metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=1
[baseos-debuginfo]
name=CentOS Stream $releasever - BaseOS - Debug
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/BaseOS/$basearch/debug/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-debug-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0
[baseos-source]
name=CentOS Stream $releasever - BaseOS - Source
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/BaseOS/source/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-source-$stream&arch=source&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0
[appstream]
name=CentOS Stream $releasever - AppStream
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/AppStream/$basearch/os
# metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=1
[appstream-debuginfo]
name=CentOS Stream $releasever - AppStream - Debug
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/AppStream/$basearch/debug/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-debug-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0
[appstream-source]
name=CentOS Stream $releasever - AppStream - Source
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/AppStream/source/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-source-$stream&arch=source&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0
[crb]
name=CentOS Stream $releasever - CRB
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/CRB/$basearch/os
# metalink=https://mirrors.centos.org/metalink?repo=centos-crb-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=1
[crb-debuginfo]
name=CentOS Stream $releasever - CRB - Debug
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/CRB/$basearch/debug/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-crb-debug-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0
[crb-source]
name=CentOS Stream $releasever - CRB - Source
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/CRB/source/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-crb-source-$stream&arch=source&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0
EOF
cat <<'EOF' > /etc/yum.repos.d/centos-addons.repo
[highavailability]
name=CentOS Stream $releasever - HighAvailability
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/HighAvailability/$basearch/os
# metalink=https://mirrors.centos.org/metalink?repo=centos-highavailability-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=0
[highavailability-debuginfo]
name=CentOS Stream $releasever - HighAvailability - Debug
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/HighAvailability/$basearch/debug/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-highavailability-debug-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0
[highavailability-source]
name=CentOS Stream $releasever - HighAvailability - Source
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/HighAvailability/source/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-highavailability-source-$stream&arch=source&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0
[nfv]
name=CentOS Stream $releasever - NFV
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/NFV/$basearch/os
# metalink=https://mirrors.centos.org/metalink?repo=centos-nfv-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=0
[nfv-debuginfo]
name=CentOS Stream $releasever - NFV - Debug
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/NFV/$basearch/debug/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-nfv-debug-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0
[nfv-source]
name=CentOS Stream $releasever - NFV - Source
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/NFV/source/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-nfv-source-$stream&arch=source&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0
[rt]
name=CentOS Stream $releasever - RT
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/RT/$basearch/os
# metalink=https://mirrors.centos.org/metalink?repo=centos-rt-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=0
[rt-debuginfo]
name=CentOS Stream $releasever - RT - Debug
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/RT/$basearch/debug/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-rt-debug-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0
[rt-source]
name=CentOS Stream $releasever - RT - Source
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/RT/source/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-rt-source-$stream&arch=source&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0
[resilientstorage]
name=CentOS Stream $releasever - ResilientStorage
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/ResilientStorage/$basearch/os
# metalink=https://mirrors.centos.org/metalink?repo=centos-resilientstorage-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=0
[resilientstorage-debuginfo]
name=CentOS Stream $releasever - ResilientStorage - Debug
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/ResilientStorage/$basearch/debug/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-resilientstorage-debug-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0
[resilientstorage-source]
name=CentOS Stream $releasever - ResilientStorage - Source
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/ResilientStorage/source/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-resilientstorage-source-$stream&arch=source&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0
[extras-common]
name=CentOS Stream $releasever - Extras packages
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/SIGs/$releasever-stream/extras/$basearch/extras-common
# metalink=https://mirrors.centos.org/metalink?repo=centos-extras-sig-extras-common-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras-SHA512
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=1
[extras-common-source]
name=CentOS Stream $releasever - Extras packages - Source
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/SIGs/$releasever-stream/extras/source/extras-common
# metalink=https://mirrors.centos.org/metalink?repo=centos-extras-sig-extras-common-source-$stream&arch=source&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras-SHA512
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0
EOF
1.5.装置一些必备东西
# 关于 Ubuntu
apt update && apt upgrade -y && apt install -y wget psmisc vim net-tools nfs-kernel-server telnet lvm2 git tar curl
# 关于 CentOS 7
yum update -y && yum -y install wget psmisc vim net