环境说明及配置 YUM 源

环境说明

名称 IP 地址 域名 功能

Registry

10.66.192.79

registry.example.com

GIT Server、YUM Server、DNS Server、本地 Docker Registry

Master

10.66.192.101

master.example.com

管理节点

Node1

10.66.192.102

node1.example.com

计算节点

Node2

10.66.192.103

node2.example.com

计算节点

在 Registry 创建本地 YUM 源

在 Registry 创建目录 /opt/ose/

mkdir /opt/ose

将预先下载好的 Packages 拷贝至 Registry

scp -r rhel-7-server-extras-rpms root@10.66.192.79:/opt/ose/
scp -r rhel-7-server-ose-3.5-rpms root@10.66.192.79:/opt/ose/
scp -r rhel-7-server-rpms root@10.66.192.79:/opt/ose/
scp -r rhel-7-fast-datapath-rpms root@10.66.192.79:/opt/ose/

安装 createrepo工具

cd /opt/ose/rhel-7-server-rpms/Packages
rpm -Uvh createrepo-0.9.9-26.el7.noarch.rpm deltarpm-3.6-3.el7.x86_64.rpm python-deltarpm-3.6-3.el7.x86_64.rpm

更新 repodata

createrepo --workers=5 /opt/ose/

配置本地 YUM 源

创建 /etc/yum.repos.d/local.repo 文件, 添加如下内容

[local]
name = local
baseurl = file:///opt/ose
gpgcheck = 0
enabled = 1

安装配置 httpd

yum clean all
yum -y install httpd

创建 httpd 配置文件,以发布 YUM 源。

cat << EOF > /etc/httpd/conf.d/yum.conf
Alias /repo "/opt/ose"
<Directory "/opt/ose">
  Options +Indexes +FollowSymLinks
  Require all granted
</Directory>
<Location /repo>
  SetHandler None
</Location>
EOF

重启 httpd,使修改生效

systemctl enable httpd
systemctl restart httpd

测试 YUM 源配置

在 Master,Node1,Node1 上添加如下配置

cat << EOF > /etc/yum.repos.d/ose.repo
[OpenShift]
baseurl = http://10.66.192.79/repo/
gpgcheck = 0
enabled = 1
EOF

执行输出如下命令测试 YUM 源配置

# yum list | grep -i atomic-openshift
Repository 'OpenShift' is missing name in configuration, using id
atomic-openshift.x86_64                3.5.5.31-1.git.0.b6f55a2.el7
atomic-openshift-clients.x86_64        3.5.5.31-1.git.0.b6f55a2.el7
atomic-openshift-clients-redistributable.x86_64
atomic-openshift-docker-excluder.noarch
atomic-openshift-dockerregistry.x86_64 3.5.5.31-1.git.0.b6f55a2.el7
atomic-openshift-excluder.noarch       3.5.5.31-1.git.0.b6f55a2.el7
atomic-openshift-master.x86_64         3.5.5.31-1.git.0.b6f55a2.el7
atomic-openshift-node.x86_64           3.5.5.31-1.git.0.b6f55a2.el7
atomic-openshift-pod.x86_64            3.5.5.31-1.git.0.b6f55a2.el7
atomic-openshift-sdn-ovs.x86_64        3.5.5.31-1.git.0.b6f55a2.el7
atomic-openshift-tests.x86_64          3.5.5.31-1.git.0.b6f55a2.el7
atomic-openshift-utils.noarch          3.5.101-1.git.0.0107544.el7 OpenShift
tuned-profiles-atomic-openshift-node.x86_64

results matching ""

    No results matching ""