记录下,希望能帮助到更多的人,两种部署方式,目前走通了第二种,以及部署中遇到的一些问题

环境

1、环境

三台虚拟机,系统 centos7.6, 01 为 controller 节点,02,03为 为compute 节点

2、没有ifconfig命令

1、yum install net-tools.x86_64

3、关掉 NetworkManager 和 防火墙

systemctl status NetworkManager
systemctl stop NetworkManager
systemctl disable NetworkManager

systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld

4、安装git

yum -y install git

5、克隆代码
1、问题
1、Could not resolve host: github.com

		多克隆几次
git clone https://github.com/BillWang139967/openstack_install.git

6、部署 controller 节点

1、安装 vim,个人习惯用vim啦

yum -y install vim

1、Centos8的国内yum源

cd /etc/yum.repos.d/
rm -f CentOS-Base.repo CentOS-AppStream.repo CentOS-PowerTools.repo CentOS-centosplus.repo CentOS-Extras.repo
curl -o CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo

vi /etc/resolv.conf  加上  nameserver 114.114.114.114

dnf clean all	# 清除所有的缓存文件
yum makecache	# 制作元数据缓存

查看当前源支持安装的 openstack 版本
yum list |grep openstack

centos-release-openstack-train.noarch                2-1.el8                                          extras       
centos-release-openstack-ussuri.noarch               1-3.el8

可以看到支持 t 版本和 u 版本,当前代码库支持的是 o 版本 
需要把以下文件内容替换为 train ,control 节点和 compute 节点都需要

scripts/compute/environment.sh:94:		yum -y install centos-release-openstack-ocata
scripts/controller/environment.sh:101:        yum -y install  centos-release-openstack-ocata

2、 修改配置文件

1、openstack_install/etc/main-config.rc
        
    CONTROLLER_NODES="controller"
    CONTROLLER_NODES_IP="139.159.3.12"
    COMPUTE_NODES="compute1 compute2"
    COMPUTE_NODES_IP="139.159.3.13 139.159.3.10"

	# provider 物理网卡名称
	PROVIDER_INTERFACE="ens36"
		
2、修改主机名
    hostnamectl set-hostname  controller

3、执行命令安装环境

执行安装
./main-installer.sh controller install | tee -a /var/log/my_install_log.log		

查看 log
tail -f -n 200 /var/log/my_install_log.log
问题
1、No match for argument: centos-release-openstack-ocata Error: Unable to find

产生这个错误的原因是未配置yum源,所以需要安装 EPEL 源,执行以下命令:

yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm


2、No match for argument: python-openstackclient
	1、client 版本不对应,查找当前源对应的client版本							
	yum list |grep openstackclient
	
	python-openstackclient-doc.noarch                     4.0.1-1.el8                                      centos-openstack-train 
	python-openstackclient-lang.noarch                    4.0.1-1.el8                                      centos-openstack-train 
	python3-openstackclient.noarch                        4.0.1-1.el8                                      centos-openstack-train

2、修改安装代码

grep -nR 'openstackclient' 

scripts/compute/environment.sh:96:	yum -y install python-openstackclient openstack-selinux crudini
scripts/controller/environment.sh:105:    yum -y install python-openstackclient openstack-selinux crudini

把 python-openstackclient 替换为 python3-openstackclient.noarch

再次执行 
	
./main-installer.sh controller install | tee -a /var/log/my_install_log.log

3、No match for argument: python-memcached
	1、安装当前源对应的 版本
	yum list |grep memcached
	
	libmemcached.x86_64                                   1.0.18-15.el8                                    AppStream              
	libmemcached-libs.i686                                1.0.18-15.el8                                    AppStream              
	libmemcached-libs.x86_64                              1.0.18-15.el8                                    AppStream              
	memcached.x86_64                                      1.5.9-3.el8                                      AppStream              
	puppet-memcached.noarch                               3.4.0-1.66d3a66git.el8                           centos-openstack-train 
	python2-memcached.noarch                              1.58-8.el8                                       epel                   
	python3-memcached.noarch                              1.58-11.el8                                      centos-openstack-train 
	python3-memcached.noarch                              1.58-11.el8                                      ceph-nautilus          
	uwsgi-router-memcached.x86_64                         2.0.18-4.el8                                     centos-openstack-train
	
	2、修改安装代码
	grep -nR 'python-memcached'
	
	scripts/controller/environment.sh:155:    yum -y install memcached python-memcached
	 
	把  python-memcached 改成  python3-memcached.noarch
	
	3、到此需要重新清理环境再部署,因为部分数据已写入,安装代码每次都会重新安装
	
	# 清理 mysql 数据
	systemctl stop mariadb.service && cd /var/lib/mysql/ && rm -rf * && cd /root/openstack/openstack_install/

	# 清理 rabbitmq 数据				
	systemctl stop rabbitmq-server.service && cd /var/lib/rabbitmq && rm -rf * && cd /root/openstack/openstack_install/
	

	# 清理控制节点 environment 安装标记
	rm -rf /etc/openstack-control-script-config/environment-installed

		
	./main-installer.sh controller install | tee -a /var/log/my_install_log.log
	
4、No match for argument: mod_wsgi  
   
   
    1、和之前一样,把 mod_wsgi 和 openstack-utils  找到代码位置,更换为当前源支持的包
   
   				
	2、到此需要重新清理环境再部署,因为部分数据已写入,安装代码每次都会重新安装
	
	# 清理 mysql 数据 # 清理 rabbitmq 数据	# 清理控制节点 environment 安装标记
	systemctl stop mariadb.service && cd /var/lib/mysql/ && rm -rf * && systemctl stop rabbitmq-server.service && cd /var/lib/rabbitmq && rm -rf * && cd /root/openstack/openstack_install/ && rm -rf /etc/openstack-control-script-config/environment-installed

		
	./main-installer.sh controller install | tee -a /var/log/my_install_log.log
   
   
	5、No match for argument: openstack-utils  openstack命令行配置工具
	暂时删掉 openstack-utils 看看:
		scripts/controller/install_keystone.sh:54:    yum -y install openstack-keystone httpd python3-mod_wsgi.x86_64 openstack-utils
	
	6、can't connect to mysql server on 'controller'  keystone.log报错
             https://blog.csdn.net/u012336923/article/details/50056721
             
             确认下 /etc/hosts 里面 是否有以下内容
                 139.159.3.12  controller
                 139.159.3.13   compute1
                 139.159.3.10   compute2

    7、Missing value auth-url required for auth plugin password
        
        export OS_USERNAME=admin
        export OS_PASSWORD=itnihao
        export OS_PROJECT_NAME=admin
        export OS_USER_DOMAIN_NAME=Default
        export OS_PROJECT_DOMAIN_NAME=Default
        export OS_AUTH_URL=http://controller:35357/v3
        export OS_IDENTITY_API_VERSION=3
        
              
	8、重启服务
	
systemctl stop mariadb.service && cd /var/lib/mysql/ && rm -rf * && systemctl stop rabbitmq-server.service && cd /var/lib/rabbitmq && rm -rf * && cd /root/openstack/openstack_install/ && rm -rf /etc/openstack-control-script-config/environment-installed && ./main-installer.sh controller install | tee -a /var/log/my_install_log.log                
				
				

更换方式

1、使用 rdo 单节点部署,参考链接

https://github.com/meetbill/openstack_install/wiki/openstack_rdo

https://blog.csdn.net/weixin_49994404/article/details/109550129

2、安装 train
环境:centos7.6 单节点部署

1、安装 源
cd /etc/yum.repos.d/
rm -f CentOS-Base.repo CentOS-AppStream.repo CentOS-PowerTools.repo CentOS-centosplus.repo CentOS-Extras.repo
curl -o CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

vi /etc/resolv.conf  加上  nameserver 114.114.114.114

yum clean all		
yum makecache

yum install -y https://rdoproject.org/repos/rdo-release.rpm

yum list |grep centos-release-openstack-train

yum install -y centos-release-openstack-train

yum install -y openstack-packstack
2、生成 RDO 配置文件
packstack --gen-answer-file my_answers.txt
			
3、修改配置文件
< CONFIG_CINDER_INSTALL=y
< CONFIG_SWIFT_INSTALL=n

    CONFIG_PROVISION_DEMO=n   演示功能
< CONFIG_CEILOMETER_INSTALL=n  计费模块不需要安装
< CONFIG_AODH_INSTALL=n			计费模块不需要安装
4、执行安装			
packstack --answer-file my_answers.txt
等大概 20 分钟
5、安装结果
 **** Installation completed successfully ******

	Additional information:
	 * Parameter CONFIG_NEUTRON_L2_AGENT: You have chosen OVN Neutron backend. Note that this backend does not support the VPNaaS or FWaaS services. Geneve will be used as the encapsulation method for tenant networks
	 * Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
	 * File /root/keystonerc_admin has been created on OpenStack client host 139.159.3.13. To use the command line tools you need to source the file.
	 * To access the OpenStack Dashboard browse to http://139.159.3.13/dashboard .
	Please, find your login credentials stored in the keystonerc_admin in your home directory.
	 * The installation log file is available at: /var/tmp/packstack/20201109-220907-wOXQhB/openstack-setup.log
	 * The generated manifests are available at: /var/tmp/packstack/20201109-220907-wOXQhB/manifests
如果中间出错,修改好后使用以下命令重新执行
systemctl stop mariadb.service && cd /var/lib/mysql/ && rm -rf * && systemctl stop rabbitmq-server.service && cd /var/lib/rabbitmq && rm -rf * && rm -rf /root/.my.cnf 

packstack --answer-file=my_answers.txt
 
6、数据库密码
home目录下 .my.cnf
7、使用
后台ip :  172.2.3.4  用户名  root/  aaa
执行命令前先 source keystonerc_admin   

数据库密码:675874fc55bc478d

8、查看消息队列

   rabbitmq-service start 开始服务

   Rabbitmq-service stop  停止服务
   
   systemctl restart rabbitmq-server

   rabbitmqctl list_queues

9、 服务:

systemctl restart openstack-nova-scheduler
                
service neutron-server restart

systemctl status neutron-server                               
       

systemctl restart openstack-nova-compute.service 


echo >/var/log/cinder/volume.log && service openstack-cinder-volume restart && service openstack-cinder-api restart

10、后台更新镜像

openstack image create "CentOS8" --file CentOS-8-GenericCloud-8.1.1911-20200113.3.x86_64.qcow2 --disk-format qcow2 --container-format bare --public
    
openstack image list    
    

11、查看是否支持kvm

cat /proc/cpuinfo | egrep 'vmx|svm'
1
 
如果此命令返回值不是0,则计算节点支持硬件加速,不需要加入下面的配置。
如果此命令返回值是0,则计算节点不支持硬件加速,并且必须配置libvirt为使用QEMU而不是KVM,需要编辑/etc/nova/nova.conf 文件中的[libvirt]部分:
[libvirt]
virt_type = qemu

12、镜像下载

axel -n 30 http://mirrors.aliyun.com/centos/7.9.2009/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐