OpenStack Ussuri版安装系列—0制作yum源CentOS8离线源
版本支持概述
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 教程
www.cnblogs.com/Dear-XiaoLe… www.linuxcoming.com/blog/2019/0… www.dwhd.org/20200207_20… www.cnblogs.com/omgasw/p/13…
CentOS-7-x86_64-GenericCloud.qcow2镜像配置实例密码 官方镜像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登录
配置国内源
国内源配置
国内源
# 移除原系统自带的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 复制代码
blog.csdn.net/bo123_/arti…
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
作者:北岸冷若冰霜
链接:https://juejin.cn/post/7025773131562237966