1. 机器部署说明
(1)Master
IP 地址: 192.168.56.111
域名:master.example.com
功能:Master、DNS Server
(2)Registry
IP 地址: 192.168.56.112
域名:registry.example.com、git.example.com、yum.example.com、nfs.example.com
功能:GIT Server、YUM Server、DNS Server、本地 Docker Registry
(3)Node1
IP 地址: 192.168.56.113
域名:node1.example.com
功能:Node、Router、内部 Docker Registry
(4)Node2
IP 地址: 192.168.56.114
域名:node2.example.com
功能:Node
(5)CloudForm
IP 地址: 192.168.56.115
域名:cf.example.com
功能:混合云监控
2. 操作系统
所有机器均安装 Red Hat Enterprise Linux 7.3(选择 Minimal 模式)
3. 网络
所有机器均使用静态 IP 地址。
以 registry.example.com 机器为例,其它机器以此类推:
vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
#PEERDNS=yes
#PEERROUTES=yes
IPV4_FAILURE_FATAL=no
#IPV6INIT=yes
#IPV6_AUTOCONF=yes
#IPV6_DEFROUTE=yes
#IPV6_PEERDNS=yes
#IPV6_PEERROUTES=yes
#IPV6_FAILURE_FATAL=no
#IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s3
UUID=625caf3e-78d3-4075-9256-8c5924bedda4
DEVICE=enp0s3
ONBOOT=yes
IPADDR=192.168.56.112
PREFIX=24
GATEWAY=192.168.56.1
4. 创建本地 YUM 源
在 registry.example.com 上执行
mkdir /opt/ose
4.1 将预先下载好的 OpenShift Repo 拷贝至 Registry (在 MAC 上操作)
scp -r rhel-7-server-extras-rpms root@192.168.56.112:/opt/ose/
scp -r rhel-7-server-ose-3.4-rpms root@192.168.56.112:/opt/ose/
scp -r rhel-7-server-rpms root@192.168.56.112:/opt/ose/
4.2. 安装 createrepo工具(在 registry.example.com 上操作)
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
4.3. 更新 repodata(在 registry.example.com 上操作)
createrepo --worker=5 /opt/ose;
4.4. 停止并禁用防火墙(在所有机器上操作)
systemctl stop firewalld;
systemctl disable firewalld;
4.5 安装配置 httpd (在 registry.example.com 上操作)
cat << EOF > /etc/yum.repos.d/local.repo
[local]
name = local
baseurl = file:///opt/ose
gpgcheck = 0
enabled = 1
EOF
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;
4.6 测试所有节点的YUM 配置,确保能正确连接到内部YUM服务器。(在所有机器上操作)
cat << EOF > /etc/yum.repos.d/ose.repo
[OpenShift]
baseurl = http://192.168.56.112/repo/
gpgcheck = 0
enabled = 1
EOF
yum list | grep -i atomic-openshift;
输出如下:
源 'OpenShift' 在配置文件中未指定名字,使用标识代替
atomic-openshift.x86_64 3.4.0.39-1.git.0.5f32f06.el7
atomic-openshift-clients.x86_64 3.4.0.39-1.git.0.5f32f06.el7
atomic-openshift-clients-redistributable.x86_64
atomic-openshift-docker-excluder.noarch 3.4.0.39-1.git.0.5f32f06.el7
atomic-openshift-dockerregistry.x86_64 3.4.0.39-1.git.0.5f32f06.el7
atomic-openshift-excluder.noarch 3.4.0.39-1.git.0.5f32f06.el7
atomic-openshift-master.x86_64 3.4.0.39-1.git.0.5f32f06.el7
atomic-openshift-node.x86_64 3.4.0.39-1.git.0.5f32f06.el7
atomic-openshift-pod.x86_64 3.4.0.39-1.git.0.5f32f06.el7
atomic-openshift-sdn-ovs.x86_64 3.4.0.39-1.git.0.5f32f06.el7
atomic-openshift-tests.x86_64 3.4.0.39-1.git.0.5f32f06.el7
atomic-openshift-utils.noarch 3.4.44-1.git.0.efa61c6.el7 OpenShift
tuned-profiles-atomic-openshift-node.x86_64
(1)Master
IP 地址: 192.168.56.111
域名:master.example.com
功能:Master、DNS Server
(2)Registry
IP 地址: 192.168.56.112
域名:registry.example.com、git.example.com、yum.example.com、nfs.example.com
功能:GIT Server、YUM Server、DNS Server、本地 Docker Registry
(3)Node1
IP 地址: 192.168.56.113
域名:node1.example.com
功能:Node、Router、内部 Docker Registry
(4)Node2
IP 地址: 192.168.56.114
域名:node2.example.com
功能:Node
(5)CloudForm
IP 地址: 192.168.56.115
域名:cf.example.com
功能:混合云监控
2. 操作系统
所有机器均安装 Red Hat Enterprise Linux 7.3(选择 Minimal 模式)
3. 网络
所有机器均使用静态 IP 地址。
以 registry.example.com 机器为例,其它机器以此类推:
vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
#PEERDNS=yes
#PEERROUTES=yes
IPV4_FAILURE_FATAL=no
#IPV6INIT=yes
#IPV6_AUTOCONF=yes
#IPV6_DEFROUTE=yes
#IPV6_PEERDNS=yes
#IPV6_PEERROUTES=yes
#IPV6_FAILURE_FATAL=no
#IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s3
UUID=625caf3e-78d3-4075-9256-8c5924bedda4
DEVICE=enp0s3
ONBOOT=yes
IPADDR=192.168.56.112
PREFIX=24
GATEWAY=192.168.56.1
4. 创建本地 YUM 源
在 registry.example.com 上执行
mkdir /opt/ose
4.1 将预先下载好的 OpenShift Repo 拷贝至 Registry (在 MAC 上操作)
scp -r rhel-7-server-extras-rpms root@192.168.56.112:/opt/ose/
scp -r rhel-7-server-ose-3.4-rpms root@192.168.56.112:/opt/ose/
scp -r rhel-7-server-rpms root@192.168.56.112:/opt/ose/
4.2. 安装 createrepo工具(在 registry.example.com 上操作)
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
4.3. 更新 repodata(在 registry.example.com 上操作)
createrepo --worker=5 /opt/ose;
4.4. 停止并禁用防火墙(在所有机器上操作)
systemctl stop firewalld;
systemctl disable firewalld;
4.5 安装配置 httpd (在 registry.example.com 上操作)
cat << EOF > /etc/yum.repos.d/local.repo
[local]
name = local
baseurl = file:///opt/ose
gpgcheck = 0
enabled = 1
EOF
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;
4.6 测试所有节点的YUM 配置,确保能正确连接到内部YUM服务器。(在所有机器上操作)
cat << EOF > /etc/yum.repos.d/ose.repo
[OpenShift]
baseurl = http://192.168.56.112/repo/
gpgcheck = 0
enabled = 1
EOF
yum list | grep -i atomic-openshift;
输出如下:
源 'OpenShift' 在配置文件中未指定名字,使用标识代替
atomic-openshift.x86_64 3.4.0.39-1.git.0.5f32f06.el7
atomic-openshift-clients.x86_64 3.4.0.39-1.git.0.5f32f06.el7
atomic-openshift-clients-redistributable.x86_64
atomic-openshift-docker-excluder.noarch 3.4.0.39-1.git.0.5f32f06.el7
atomic-openshift-dockerregistry.x86_64 3.4.0.39-1.git.0.5f32f06.el7
atomic-openshift-excluder.noarch 3.4.0.39-1.git.0.5f32f06.el7
atomic-openshift-master.x86_64 3.4.0.39-1.git.0.5f32f06.el7
atomic-openshift-node.x86_64 3.4.0.39-1.git.0.5f32f06.el7
atomic-openshift-pod.x86_64 3.4.0.39-1.git.0.5f32f06.el7
atomic-openshift-sdn-ovs.x86_64 3.4.0.39-1.git.0.5f32f06.el7
atomic-openshift-tests.x86_64 3.4.0.39-1.git.0.5f32f06.el7
atomic-openshift-utils.noarch 3.4.44-1.git.0.efa61c6.el7 OpenShift
tuned-profiles-atomic-openshift-node.x86_64
没有评论:
发表评论