目录
登陆网页,测试http://192.168.100.100/dashboard/
OpenStack 环境配置
虚拟机资源信息
控制节点ct
CPU:双核双线程-CPU虚拟化开启
内存:8G 硬盘:300G+1024G(CEPH块存储)
双网卡:VM2-(局域网) NAT-192.168.100.100
操作系统:Centos 7.6(1810)-最小化安装
PS:最小内存8G
创建虚拟机节点
控制节点配置:
[root@localhost /]# hostnamectl set-hostname ct
配置节点上的/etc/hosts文件:
cat <<EOF>>/etc/hosts
192.168.100.100 ct
EOF
关闭防火墙网络服务
sed -ri '/^[^#]*SELINUX=/s#=.+$#=disabled#' /etc/selinux/config
systemctl stop firewalld
systemctl disable firewalld
systemctl stop NetworkManager
systemctl disable NetworkManager
下载阿里yum源包
[root@ct ~]# cd /etc/yum.repos.d/
[root@ct yum.repos.d]# curl -o /etc/yum.repos.d/CentOS.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[root@ct yum.repos.d]# mv C* bak/
安装openstack-rocky 源包
[root@ct yum.repos.d]# cat <<EOF > /etc/yum.repos.d/openstack.repo
[openstack-rocky]
name=openstack-rocky
baseurl=https://mirrors.aliyun.com/centos/7/cloud/x86_64/openstack-rocky/
enabled=1
gpgcheck=0
[qume-kvm]
name=qemu-kvm
baseurl= https://mirrors.aliyun.com/centos/7/virt/x86_64/kvm-common/
enabled=1
gpgcheck=0
EOF
清理缓存
yum clean all&&yum makecache
重启系统reboot 检查刚才的开局配置是否生效
安装依赖包
yum -y install net-tools bash-completion vim gcc gcc-c++ make pcre pcre-devel expat-devel cmake bzip2
控制节点Openstack一键环境部署
安装一键部署工具
[root@ct ~]# yum -y install openstack-packstack
生成应答文件
[root@ct ~]# packstack --gen-answer-file=openstack.txt
更改应答文件内容
[root@ct ~]# vim openstack.txt
41 CONFIG_SWIFT_INSTALL=n '//第41行SWIFT是OpenStack的对象存储组件,默认是Y,在生产环境中一般是不装,所以改n'
50 CONFIG_AODH_INSTALL=n '//第50行,默认是Y 需要改n'
782 CONFIG_LBAAS_INSTALL=y '//第782行 LBAAS负载均衡组件。必选要装 选y'
790 CONFIG_NEUTRON_FWAAS=y '//第790行 FWAAS是防火墙组件。必选要装 选y'
794 CONFIG_NEUTRON_VPNAAS=y '//第794行 VPNAAS是VPN组件。必选要装 选y'
817 CONFIG_NEUTRON_ML2_FLAT_NETWORKS=physnet1 '//第817行,FLAT网络这边要设置物理网卡名字'
862 CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=physnet1:br-ex '//第862行,这边要设置物理网卡的名字'
873 CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-ex:eth1 '//第873行,这边br-ex:eth1是网络节点的nat网卡'
将节点变成192.168.100.100
[root@ct ~]# sed -i -r 's/192.168.233.100/192.168.100.100/g' openstack.txt
备份文件
[root@ct ~]# grep -vE "^#|^$" openstack.txt >openstackbak.txt
开始部署
[root@ct ~]# packstack --allinone
Welcome to the Packstack setup utility
The installation log file is available at: /var/tmp/packstack/20220722-112246-ExbCwB/openstack-setup.log
Installing:
Clean Up [ DONE ]
Discovering ip protocol version [ DONE ]
Setting up ssh keys [ DONE ]
Preparing servers [ DONE ]
Pre installing Puppet and discovering hosts' details [ DONE ]
Preparing pre-install entries [ DONE ]
Setting up CACERT [ DONE ]
Preparing AMQP entries [ DONE ]
Preparing MariaDB entries [ DONE ]
Fixing Keystone LDAP config parameters to be undef if empty[ DONE ]
Preparing Keystone entries [ DONE ]
Preparing Glance entries [ DONE ]
Checking if the Cinder server has a cinder-volumes vg[ DONE ]
Preparing Cinder entries [ DONE ]
Preparing Nova API entries [ DONE ]
Creating ssh keys for Nova migration [ DONE ]
Gathering ssh host keys for Nova migration [ DONE ]
Preparing Nova Compute entries [ DONE ]
Preparing Nova Scheduler entries [ DONE ]
Preparing Nova VNC Proxy entries [ DONE ]
Preparing OpenStack Network-related Nova entries [ DONE ]
Preparing Nova Common entries [ DONE ]
Preparing Neutron LBaaS Agent entries [ DONE ]
Preparing Neutron API entries [ DONE ]
Preparing Neutron L3 entries [ DONE ]
Preparing Neutron L2 Agent entries [ DONE ]
Preparing Neutron DHCP Agent entries [ DONE ]
Preparing Neutron Metering Agent entries [ DONE ]
Checking if NetworkManager is enabled and running [ DONE ]
Preparing OpenStack Client entries [ DONE ]
Preparing Horizon entries [ DONE ]
Preparing Swift builder entries [ DONE ]
Preparing Swift proxy entries [ DONE ]
Preparing Swift storage entries [ DONE ]
Preparing Gnocchi entries [ DONE ]
Preparing Redis entries [ DONE ]
Preparing Ceilometer entries [ DONE ]
Preparing Aodh entries [ DONE ]
Preparing Puppet manifests [ DONE ]
Copying Puppet modules and manifests [ DONE ]
Applying 192.168.100.100_controller.pp
192.168.100.100_controller.pp: [ DONE ]
Applying 192.168.100.100_network.pp
192.168.100.100_network.pp: [ DONE ]
Applying 192.168.100.100_compute.pp
192.168.100.100_compute.pp: [ DONE ]
Applying Puppet manifests [ DONE ]
Finalizing [ DONE ]
**** Installation completed successfully ******
Additional information:
* A new answerfile was created in: /root/packstack-answers-20220722-112247.txt
* 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 192.168.100.100. To use the command line tools you need to source the file.
* To access the OpenStack Dashboard browse to http://192.168.100.100/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/20220722-112246-ExbCwB/openstack-setup.log
* The generated manifests are available at: /var/tmp/packstack/20220722-112246-ExbCwB/manifests
[root@ct ~]#
[root@ct ~]#
出现 **** Installation completed successfully ****** 说明部署成功
如果出现leatherman_curl.so.1.3.0报错
yum list | grep leatherman
leatherman.x86_64 1.10.0-1.el7 @epel
leatherman-devel.x86_64 1.10.0-1.el7 epel
回退leatherman版本
[root@ct ~]# yum downgrade leatherman
查看登录账号密码
[root@ct ~]# cat keystonerc_admin
unset OS_SERVICE_TOKEN
export OS_USERNAME=admin
export OS_PASSWORD='bd57de59636b4c5e' ##初始密码
export OS_REGION_NAME=RegionOne
export OS_AUTH_URL=http://192.168.100.100:5000/v3
export PS1='[\u@\h \W(keystone_admin)]\$ '
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_NAME=Default
export OS_IDENTITY_API_VERSION=3
登陆网页,测试
http://192.168.100.100/dashboard/
修改初始密码
此时openstack搭建完成