OpenStack Ussuri版安装系列—0制作yum源CentOS8离线源

CentOS8离线源制作

OpenStack部署系列文章
OpenStack Victoria版 安装部署系列教程
OpenStack Ussuri版 离线安装部署系列教程(全)
OpenStack Train版 离线安装部署系列教程(全)
欢迎留言沟通,共同进步。

持续参考
https://blog.csdn.net/u013469753/article/details/106274126



版本支持概述

Centos7

源中包含以下版本的openstack,不排除之后会支持,新版本的OpenStack
openstack-queens
openstack-rocky
openstack-stein
openstack-train

centos 8

openstack-train
openstack-ussuri
openstack-victoria
如果安装OpenStack Victoria,需要在CentOS 8上

VMware 虚拟机安装CentOS8 教程

https://www.cnblogs.com/Dear-XiaoLe/articles/12201099.html
http://www.linuxcoming.com/blog/2019/09/03/linux_basic_tools_virt_install_os_variant.html
https://www.dwhd.org/20200207_205434.html
https://www.cnblogs.com/omgasw/p/13555477.html

CentOS-7-x86_64-GenericCloud.qcow2镜像配置实例密码
官方镜像http://cloud.centos.org/centos/

openstack环境中,使用官方镜像CentOS-7-x86_64-GenericCloud.qcow2,不知道默认密码,可以在创建实例时候配置脚本写入root密码

#!/bin/bash
passwd root<<EOF
root
root
EOF

CentOS8配置的基础配置

基本安装与配置ssh登录

 1  dnf install openssh openssh-server -y
 2  dnf install openssh openssh-server vim git wget net-tools bash-completion -y
 3  ifconfig
 4  vim /etc/ssh/sshd_config
 5  systemctl enable sshd
 6  systemctl restart sshd
 7  systemctl status sshd
 10  #q退出
 11  exit
 12  history

原生镜像安装ssh ,允许root的ssh登录

配置国内源

https://www.cnblogs.com/hackyo/p/11650188.html
国内源配置

# 移除原系统自带的repo文件,避免和新建的配置文件内容冲突
mkdir ori_repo-config
mv /etc/yum.repos.d/* ./ori_repo-config/
touch /etc/yum.repos.d/CentOS-PrivateLocal.repo
vim /etc/yum.repos.d/CentOS-PrivateLocal.repo
#下载阿里云源文件
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo

#替换 阿里云镜像地址
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo

#建立缓存
yum makecache

yum源制作

yum clean all
yum makecache
yum -y install vim createrepo yum-utils httpd net-tools 
# yum -y install reposync
yum install -y centos-release-openstack-victoria
ls -1 /etc/yum.repos.d/
yum repolist

同步至本地

mkdir -p /var/www/html/yumrepository
systemctl restart httpd.service
netstat -lntp
reposync -p /var/www/html/yumrepository/
    1  dnf install openssh openssh-server wget git vim net-tools bash-completion -y
    2  ifconfig
    3  systemctl enable sshd
    4  systemctl restart sshd
    5  vim /etc/ssh/sshd_config
    6  systemctl restart sshd
    7  systemctl status sshd
    8  ifconfig
    9  exit
   10  ls
   11  mkdir ori_repo-config
   12  mv /etc/yum.repos.d/* ./ori_repo-config/
   13  wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo
   14  sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
   15  yum makecache
   16  yum -y install vim createrepo yum-utils httpd net-tools
   17  yum install -y centos-release-openstack-victoria
   18  ls -1 /etc/yum.repos.d/
   19  yum repolist
   20  mkdir -p /var/www/html/yumrepository
   21  systemctl restart httpd.service
   22  reposync -p /var/www/html/yumrepository/
   23  exit
   24  reposync -p /var/www/html/yumrepository/
   25  reposync -p /var/www/html/yumrepository/
   26  exit
   27  history

本地制作

创建yum仓库

# 利用createrepo工具制作yum源,如果没有createrepo工具则利用yum安装
yum install createrepo -y
#进入每一个文件夹
cd /var/www/html/yumrepository
cd ./base
ls
createrepo .
ls

注意,在同步下来的每一个yum仓库目录都需要执行,上述操作

配置服务httpd

#启动服务
systemctl restart httpd
# 设置开机自动启动
systemctl enable httpd
systemctl status httpd
q

修改配置文件 /etc/selinux/config

# vim /etc/selinux/config
SELINUX=disabled
yum install firewalld systemd -y
systemctl start firewalld.service
systemctl stop firewalld.service
systemctl enable firewalld.service
systemctl disable firewalld.service
netstat -anp

https://blog.csdn.net/bo123_/article/details/101484987

   55  systemctl stop firewalld NetworkManager.service
   56  systemctl stop NetworkManager.service
   57  yum install iptables-services
   58  systemctl stop firewalld NetworkManager.service
   59  systemctl stop firewalld
   60  systemctl status firewalld
   61  systemctl start firewalld
   62  yum install firewalld systemd -y
   63  systemctl start firewalld.service
   64  systemctl stop firewalld.service
   65  systemctl status firewalld
   66  netstat -anp
   67  systemctl disable firewalld NetworkManager.service
   68  systemctl status firewalld NetworkManager.service
   69  setenforce 0
   70  ifconfig
   71  yum repolist
   72  ls ../

关闭防火墙,selinux,NetworkManager

systemctl stop firewalld NetworkManager.service
systemctl disable firewalld NetworkManager.service
systemctl status firewalld NetworkManager.service
setenforce 0

验证

在另一台机器,新建一个repo文件

# 移除原系统自带的repo文件,避免和新建的配置文件内容冲突
mkdir ori_repo-config
mv /etc/yum.repos.d/* ./ori_repo-config/
touch /etc/yum.repos.d/CentOS-PrivateLocal.repo
vim /etc/yum.repos.d/CentOS-PrivateLocal.repo

注意:
①IP地址更换为yumrepository所在主机的地址。
②为避免安装冲突,[centos-openstack-stein]和[centos-openstack-train]只保留一个。

[AppStream]
name=CentOS-$releasever - AppStream - mirrors.aliyun.com
baseurl=http://192.168.2.104/yumrepository/AppStream/
gpgcheck=0
enabled=1

[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
baseurl=http://192.168.2.104/yumrepository/base/
gpgcheck=0
enabled=1

[centos-advanced-virtualization]
name=CentOS-$releasever - Advanced Virtualization
baseurl=http://192.168.2.104/yumrepository/centos-advanced-virtualization/
gpgcheck=0
enabled=1

[centos-ceph-nautilus]
name=CentOS-$releasever - Ceph Nautilus
baseurl=http://192.168.2.104/yumrepository/centos-ceph-nautilus/
gpgcheck=0
enabled=1

[centos-nfv-openvswitch]
name=CentOS-$releasever - NFV OpenvSwitch
baseurl=http://192.168.2.104/yumrepository/centos-nfv-openvswitch/
gpgcheck=0
enabled=1

[centos-openstack-victoria]
name=CentOS-$releasever - OpenStack victoria
baseurl=http://192.168.2.104/yumrepository/centos-openstack-victoria/
gpgcheck=0
enabled=1

[centos-rabbitmq-38]
name=CentOS-$releasever - RabbitMQ 38
baseurl=http://192.168.2.104/yumrepository/centos-rabbitmq-38/
gpgcheck=0
enabled=1

[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
baseurl=http://192.168.2.104/yumrepository/extras/
gpgcheck=0
enabled=1

配置完成后,通常需要清除yum中原有的cache,并重新生成cache。清除yum陈旧cache的命令如下:

yum clean all
yum makecache
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

北观止

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值