这种方式使用自己制作的yum源安装openstack(allinone),基本一装一个准,不会出差错,适合初学者安装。
一、使用vmware安装redhat7操作系统 百度盘地址https://pan.baidu.com/s/1qXC6duW(硬盘20G足够),并在安装过程中选择自定义分区,分区如下:
分区 | 分区大小 | 备注 |
---|---|---|
/boot | 200m | 引导 |
/swap | 1024m | 虚拟内存 |
/ | 10g | 根分区 |
剩余空间留给后续cinder-volumes
安装完成之后可以新建分区,并指定名字cinder-volumnes
fdisk -l /dev/sda
fdisk /dev/sda
n
p
w
partprobe
pvcreate /dev/sda3
vgcreate cinder-volumes /dev/sda3
最后可以使用命令查看:vgs
设置host
vi /etc/hosts
192.168.56.145 openstack
二、上传创建虚拟机的镜像到下载目录,并挂载到/media/cdrom,使用该镜像做本地源
root@openstack# mount -o loop -t iso9660 /home/hadoop/Downloads/rhel-server-7.0-x86_64-dvd.iso /media/cdrom/
root@openstack#vi /etc/yum.repo.do/redhat-base.repo
[redhat-base]
name = redhat-base
baseurl=file:///media/cdrom
enable=1
gpgcheck=0
三、下载所需的epel和juno源的压缩文件(百度盘地址:https://pan.baidu.com/s/1bp3dxJh),解压到指定目录/var/pub/,然后配置epel源和openstack-juno源
cd /etc/yum.repo.d
vi epel.repo
--------------------------------------
[epel]
name=local epel
baseurl=file:///var/pub/EPEL
enable=1
gpgcheck=0
vi openstack-juno.repo
--------------------------------------
[openstack-juno]
name=openstack-juno
baseurl=file:///var/pub/openstack-juno
enable=1
gpgcheck=0
以上源安装完成之后,做如下操作,清空yum缓存,然后更新
root@openstack# yum clean all
root@openstack# yum repolist
root@openstack# yum makecache
四、直接命令安装(allinone的方式)
root@openstack# yum install openstack-packstack
root@openstack# packstack --allinone --nagios-install=n --provision-demo=n
等待安装完成会打印如下信息表示安装成功
Applying 192.168.56.145_postscript.pp
192.168.56.145_postscript.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.
* Did not create a cinder volume group, one already existed
* File /root/keystonerc_admin has been created on OpenStack client host 192.168.56.145. To use the command line tools you need to source the file.
* To access the OpenStack Dashboard browse to http://192.168.56.145/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/20160325-204412-22bD8F/openstack-setup.log
* The generated manifests are available at: /var/tmp/packstack/20160325-204412-22bD8F/manifests
六、配置网络信息并重启网络
本地网络配置和网桥配置ifcfg-br-ex
vi ifcfg-br-ex
DEVICE=br-ex
BOOTPROTO=static
IPADDR=192.168.56.145
NETMASK=255.255.255.0
DNS1=192.168.56.2
GATEWAY=192.168.56.2
NM_CONTROLLED=no
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
ONBOOT=yes
TYPE=OVSIntPort
OVS_BRIDGE=br-ex
DEVICETYPE=ovs
vi ifcfg-eno16777728(有的是eno16777736)
DEVICE=eno16777728
ONBOOT=yes
TYPE=OVSPort
DEVICETYPE=ovs
OVS_BRIDGE=br-ex
NM_CONTROLLED=no
IPV6INIT=no
使用root权限重启网络服务,不用重启虚拟机
root@openstack# service network restart
根据安装成功的提示访问dashboard
http://192.168.56.145/dashboard
用户名admin 密码 通过查看 keystone_admin得到,登入之后可修改