通过packstack快速安装openstack

一 实践说明
操作系统版本:Centos7
openstack版本:ocata

二实践步骤
1 准备虚拟机
内存:6G
处理器:2核
硬盘:64G
网络环境:
[root@localhost network-scripts]# cat ifcfg-enp0s3
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s3
UUID=4d03487c-46c4-49e9-bf44-4258044135cc
DEVICE=enp0s3
ONBOOT=yes
IPADDR=192.168.0.120
PREFIX=24
GATEWAY=192.168.0.1
DNS1=223.5.5.5
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_PRIVACY=no
2 配置centos为阿里源
cd /etc/yum.repos.d/
mv CentOS-Base.repo CentOS-Base.repo_bak
wget http://mirrors.aliyun.com/repo/Centos-7.repo
mv Centos-7.repo CentOS-Base.repo
yum clean all
yum makecache
yum update
/etc/environment文件中添加下面两行:
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
4 安装步骤
systemctl disable firewalld
systemctl stop firewalld
systemctl disable NetworkManager
systemctl stop NetworkManager
systemctl enable network
systemctl start network
yum install -y centos-release-openstack-ocata
yum update -y
yum install -y openstack-packstack
packstack --allinone
5 第一次安装时,报了如下错误
Applying 192.168.0.120_controller.pp
Testing if puppet apply is finished: 192.168.0.120_controller.pp  [ \ ]
192.168.0.120_controller.pp:                      [ ERROR ]            
Applying Puppet manifests                         [ ERROR ]
ERROR : Error appeared during Puppet run: 192.168.0.120_controller.pp
Error: Execution of '/usr/bin/yum -d 0 -e 0 -y install python-openstackclient' returned 1: Error downloading packages:
You will find full trace in log /var/tmp/packstack/20180317-203645-GewzfU/manifests/192.168.0.120_controller.pp.log
Please check log file /var/tmp/packstack/20180317-203645-GewzfU/openstack-setup.log for more information
Additional information:
* A new answerfile was created in: /root/packstack-answers-20180317-203646.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.0.120. To use the command line tools you need to source the file.
* To access the OpenStack Dashboard browse to http://192.168.0.120/dashboard .
Please, find your login credentials stored in the keystonerc_admin in your home directory.
You have mail in /var/spool/mail/root
6 第二次安装成功,安装使用如下脚本 packstack --answer-file packstack-answers-20180317-203646.txt 进行安装,第二次安装的过程如下:
[root@localhost ~]# packstack --answer-file packstack-answers-20180317-203646.txt
Welcome to the Packstack setup utility
The installation log file is available at: /var/tmp/packstack/20180318-091906-r_BX4u/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 MongoDB 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.0.120_controller.pp
192.168.0.120_controller.pp:                         [ DONE ]          
Applying 192.168.0.120_network.pp
192.168.0.120_network.pp:                            [ DONE ]       
Applying 192.168.0.120_compute.pp
192.168.0.120_compute.pp:                            [ DONE ]       
Applying Puppet manifests                            [ DONE ]
Finalizing                                           [ DONE ]
**** Installation completed successfully ******
Additional information:
* 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.0.120. To use the command line tools you need to source the file.
* To access the OpenStack Dashboard browse to http://192.168.0.120/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/20180318-091906-r_BX4u/openstack-setup.log
* The generated manifests are available at: /var/tmp/packstack/20180318-091906-r_BX4u/manifests
You have new mail in /var/spool/mail/root
三 安装验证
1 两种找密码的方法

admin密码为:b3ebd382f8c248dc

demo的密码为:2e1e215ea9054cda

[root@localhost ~]# cat packstack-answers-20180317-203646.txt
# Password to use for the Identity service 'admin' user.
CONFIG_KEYSTONE_ADMIN_PW=b3ebd382f8c248dc

# Password to use for the Identity service 'demo' user.
CONFIG_KEYSTONE_DEMO_PW=2e1e215ea9054cda
[root@localhost ~]# cat keystonerc_admin
unset OS_SERVICE_TOKEN
    export OS_USERNAME=admin
    export OS_PASSWORD=b3ebd382f8c248dc
    export OS_AUTH_URL=http://192.168.0.120: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
2 登录验证 
用户名:admin
密码:b3ebd382f8c248dc

四 实践参考
1官方安装packstack-pike版本
2 centos7 packstack-mitaka版本安装
3 http://mirrors.aliyun.com/repo/ 目录下有CentOS源和EPEL源repo文件以及设置方法,配置为阿里源,是用mitaka安装。
4 centos7 packstack-ocata版本安装方法
5 centos7 packstack-pike版本安装
6配置pike版本openstack源,配置的是阿里云源
7 centos6,配置openstack源和centos源的方法,使用的是grizzly版本
8 centos6,centos采用网易的源,使用的grizzly
9 非常详细的openstack安装过程

五 openstack安装涉及的三个源,可选择使用
1 CentOS源:CentOS基本安装源,设置CentOS7的Centos源为阿里的源的设置方法参考下面文章。
2 EPEL源:EPEL 是yum的一个软件源,里面包含了许多基本源里没有的软件
设置EPEL源为阿里的源的方法参考下面文章。
centos用户可以直接通过yum install epel-release 安装并启用EPEL。CentOS Extra默认包含该包,参考下面文章。
3 openstack源:涉及Openstack各版本的安装文件
阿里云的镜像地址如下
设置openstack源为阿里源的方法。

六 国内镜像源

  • 6
    点赞
  • 41
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值