Centos8mini

来自ling
跳转至: 导航搜索

init

https://blog.csdn.net/Myuhua/article/details/103589049

https://blog.csdn.net/niufenger/article/details/102059946

https://blog.csdn.net/yds8903/article/details/106099901

1、备份

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo

3、生成缓存

yum makecache

CentOS8现已可使用国内的aliyun阿里云镜像站,方法如下:

用cd命令切换到yum.repos目录,备份原始的3个repo文件:

cd /etc/yum.repos.d/
sudo cp CentOS-AppStream.repo CentOS-AppStream.repo.bak
sudo cp CentOS-Base.repo CentOS-Base.repo.bak
sudo cp CentOS-Extras.repo CentOS-Extras.repo.bak

编辑上面3个repo文件,在mirrorlist前加个#,并把baseurl前的#去掉。 baseurl里的 mirror.centos.org/$contentdir 修改为 mirrors.aliyun.com/centos 即可。 以CentOS-AppStream.repo为例,其他两个文件同理。

sudo nano CentOS-AppStream.repo

修改前:

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra
#baseurl=http://mirror.centos.org/$contentdir/$releasever/AppStream/$basearch/os/

修改后:

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra
baseurl=http://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/
sudo yum update

注意:如果使用的是CentOS8 Stream版本,还需要修改 CentOS-Stream-开头的3个repo文件。

修改完成后运行 sudo yum update 正常更新。


补充:epel-release的源可同理修改:

sudo yum -y install epel-release

sudo nano /etc/yum.repos.d/epel.repo


TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="static"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="ens32"
UUID="d031d9ed-6bf9-40b5-bb5a-e1c81c4d307d"
DEVICE="ens32"
ONBOOT="yes"
IPADDR=192.168.32.10
NETMASK=255.255.255.0
GATEWAY=192.168.32.2
DNS1=114.114.114.114
DNS2=8.8.8.8

nmcli c up ens32
nmcli c reload
nmcli c down ens32


yum install -y wget
yum install -y net-tools

k8s

http://store.lameleg.com:8080/loginless/vip/notify/102010cncger?charset=utf-8&out_trade_no=102010cncger-1605437441&method=alipay.trade.page.pay.return&total_amount=69.00&sign=FdXX6vyh%2FRcNaPlb6vcBkJ7%2BqkWg1h4UUxzRw9fVcdO4r9J6sjzTpj0XX2UZdiNeyHUn9nOeYfcXaSCFscxmv2NBu3wfABh%2FERTU0DNvGCu0abwyLgMTU9Wfn1o0fngueCJeVlRRM6CuE8aU9TemuoQfwZ5b1QHrSNDc8vwoVpBpy42OOVJKnOwgxd9wXVLHosC38u%2B%2BWkZSgWfA%2BurNnowKhJWmtaofizZ16C%2Fk5xhvhgG7w2NpNiSeWW65o1TuSNRabumlO6M8UFGusSl8jNNK4PVBDuf4GV9hXh456xbnqWse5MHqDyTX6eLxs1DShKBDRIwhGyMFp%2Fj6l5uhLQ%3D%3D&trade_no=2020111522001483511429235192&auth_app_id=2018121662557851&version=1.0&app_id=2018121662557851&sign_type=RSA2&seller_id=2088021513395933&timestamp=2020-11-15+18%3A51%3A25


Kubernetes_安装

不要直接在虚拟机安装,在外面安装虚拟机

wget -c https://github.com/fanux/sealos/releases/download/v3.3.8/sealos && chmod +x sealos && mv sealos /usr/bin

sealos init --user root --passwd 222222 \
--master 192.168.32.10 \
--pkg-url /soft/kube1.19.4.tar.gz \
--version v1.19.4

sealos init --user root --passwd 222222 \
--master 192.168.32.11 \
--pkg-url /soft/kube1.19.4.tar.gz \
--version v1.19.4

sealos join --master 192.168.32.12
sealos join --master 192.168.32.13
sealos join --node 192.168.32.21

sealos clean --all

scp /soft/kube1.18.12.tar.gz root@192.168.32.10:/soft/
scp /soft/kube1.19.4.tar.gz root@192.168.32.11:/soft/

scp root@192.168.32.10:/ect/sysconfig/network-scripts/ifcfg-ens32 /soft/


tee /etc/hostname <<-'EOF'
centos8_template
EOF

tee /etc/hosts <<-'EOF'
127.0.0.1   centos8_template
::1         centos8_template
EOF


sealos clean --all

scp /soft/kube1.18.12.tar.gz root@192.168.32.10:/soft/
scp /soft/kube1.19.4.tar.gz root@192.168.32.10:/soft/

scp root@192.168.32.10:/ect/sysconfig/network-scripts/ifcfg-ens32 /soft/

rm -rf /root/.ssh/known_hosts
ssh root@192.168.32.10


kuboard	sealos install --pkg-url https://github.com/sealstore/dashboard/releases/download/v1.0-1/kuboard.tar
dashboard	sealos install --pkg-url https://github.com/sealstore/dashboard/releases/download/v2.0.0-bata5/dashboard.tar
prometheus	sealos install --pkg-url https://github.com/sealstore/prometheus/releases/download/v0.31.1/prometheus.tar
ingress	sealos install --pkg-url https://github.com/sealstore/ingress/releases/download/v0.15.2/contour.tar