BlueXIII's Blog

热爱技术,持续学习

0%

K8S离线部署笔记-2-Yum源配置

服务端配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 在线环境,准备httpd安装包
yum install -y yum-utils
yumdownloader --assumeyes --destdir=/root/pkg/httpd --resolve httpd

# 离线环境,安装httpd
yum install -y --cacheonly --disablerepo=* /root/pkg/httpd/*.rpm
systemctl start httpd
systemctl enable httpd

# 配置httpd端口
vi /etc/httpd/conf/httpd.conf
Listen 8001
systemctl stop httpd & systemctl start httpd

# 挂载镜像
mkdir -p /var/www/html/centos77
mount -o loop /root/iso/CentOS-7-x86_64-DVD-1908.iso /var/www/html/centos77/

# 测试
http://10.10.51.77:8001/centos77

客户端配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
cd /etc/yum.repos.d/

mkdir bak
mv CentOS* bak

cat <<EOF > rhel77.repo
[rhel77]
name=rhel77 repo
baseurl=http://10.10.51.77:8001/centos77
enable=1
gpgcheck=0
priority=1
EOF

yum clean all
yum makecache