使用openshit在ubuntu14.04下一键部署openstack(juno版本)

一、基本介绍

本实验是在vmware workstation上虚拟机ubuntu14.04(64bit,desktop)上部署openstack(Juno版本)。采用的工具是openshit。
openshit是github上的一个项目,具体见网址:
https://github.com/windworst/openshit。
注意事项:
1.环境最好是新的ubuntu系统,如果之前用devstack等其他方法在该系统中安装过openstack的话,本次实验可能不成功。
2.ubuntu的源不要改,即/etc/apt/sources.list文件用系统默认的就好。
3.安装openstack之前先更新源。要不然openstack安装过程中会出现一些关于python包无法下载的错误。
4.ubuntu虚拟机的内存最好设置的大一些,我的电脑是8G内存,于是我分给ubuntu4G内存。如果内存较小的话,openstack的安装过程以及安装成功后在web界面上查看时都会比较卡。
5.openshit对ubuntu14.04服务器版和桌面版都支持,本实验选择的是桌面版。
6.如果在执行过程中出错,可以运行下面命令清除已安装的openstack相关配置和组件,并删除openshit文件夹,重新获取openshit,安装即可。

$./openshit.sh --all clean && ./openshit.sh --all uninstall
$cd ..
$sudo rm -rf openshit


二、安装过程详细记录
1.首先更新ubuntu源

$sudo apt-get update
$sudo apt-get upgrade

2.重启,让更新生效

$sudo reboot

3.安装git

$sudo apt-get install git

4.获取openshit

$cd /home
$git clone https://github.com/windworst/openshit.git

5.编辑配置文件setting.conf

openshit下载完后在当前目录下会有一个openshit的文件夹,进入该文件夹,修改setting.conf的权限,使得用户可以对其进行读,写操作。

$cd openshit
$sudo chmod 777 setting.conf
$sudo gedit setting.conf

此时,可以用Ctrl+Alt+T再打开一个终端,输入命令ifconfig查看本主机的ip地址

$ifconfig

由上图可知,本主机的ip地址为192.168.58.141,
在setting.conf文件中,将SET_CONTROLLER_IP,SET_COMPUTE_IP均设为本主机的Ip地址。即:
SET_CONTROLLER_IP=192.168.58.141
SET_COMPUTE_IP=192.168.58.141
此外修改所有的密码,在此,我将所有的密码设置为123456.
最后,附上我修改好的setting.conf文件,供参考(不要直接复制哦)

# This is OpenShit configure file
# All of settings in this file
# Update to Openstack component configure file

# node ip
SET_CONTROLLER_IP=192.168.58.141
SET_COMPUTE_IP=192.168.58.141
SET_INTERFACE_NAME=eth0

#vnc
SET_VNC_IP=$SET_CONTROLLER_IP
SET_VNC_CONNECT_IP=$SET_CONTROLLER_IP

# mysql configure
SET_MYSQL_IP=$SET_CONTROLLER_IP
SET_MYSQL_USER=root
SET_MYSQL_PASS=123456
SET_MYSQL_PORT=3306

# rabbit password
SET_RABBITMQ_IP=$SET_CONTROLLER_IP
SET_RABBITMQ_PASS=123456

# keystone service configure
SET_KEYSTONE_IP=$SET_COMPUTE_IP
SET_KEYSTONE_AUTH_URL=http://$SET_KEYSTONE_IP:35357/v2.0
SET_KEYSTONE_AUTH_URL_PUBLIC=http://$SET_KEYSTONE_IP:5000/v2.0

SET_OS_SERVICE_TOKEN=admin
SET_KEYSTONE_ADMIN_TENANT=admin
SET_KEYSTONE_ADMIN_ROLE=admin
SET_KEYSTONE_ADMIN=admin

SET_KEYSTONE_DBPASS=123456
SET_KEYSTONE_ADMIN_PASS=123456

# glance service configure
SET_GLANCE_IP=$SET_CONTROLLER_IP
SET_GLANCE_DBPASS=123456
SET_GLANCE_PASS=123456

# nova service configure
SET_NOVA_IP=$SET_CONTROLLER_IP
SET_NOVA_DBPASS=123456
SET_NOVA_PASS=123456

# dashboard service configure
SET_DASH_DBPASS=dashboard888

# cinder service configure
SET_CINDER_IP=$SET_CONTROLLER_IP
SET_CINDER_DBPASS=123456
SET_CINDER_PASS=123456

# neutron service configure
SET_NEUTRON_IP=$SET_CONTROLLER_IP
SET_NEUTRON_DBPASS=123456
SET_NEUTRON_PASS=123456
SET_NEUTRON_METADATA_SECRET=123456

# heat service configure
#SET_HEAT_DBPASS=
#SET_HEAT_PASS=

# ceilometer service configure
#SET_CEILOMETER_DBPASS=
#SET_CEILOMETER_PASS=

# trove service configure
#SET_TROVE_DBPASS=
#SET_TROVE_PASS=

6.安装openstack

$echo y | ./openshit.sh --all install

在这个过程中会出现一个紫色的对话框让你输入数据库的密码,该密码跟上文中配置setting.conf文件时输入的密码一样,本实验用的密码是123456。
7.配置

$./openshit.sh --all config


三、安装结果

$source admin-env.sh
$nova service-list

成功的结果应该如下图:

打开浏览器,输入http://host-ip/horizon,
注意:将host-ip替换成你主机的ip,例如本实验应该输入http://192.168.58.141/horizon
浏览器界面:

用户名:admin
密码:123456(根据setting.conf的设置)
进入后界面如下:

至此,用openshit一键安装openstack的过程基本完成。
注意,此时在web界面上的项目一栏中只有计算(compute)而没有网络(network),所以网络部分(neutron)需要再单独安装。

$./openshit.sh neutron install
$./openshit.sh neutron config

现在项目中就有网络(network)了


四、openshit命令补充

基本用法:
进入到openshit文件夹下,可以通过./openshit.sh等命令来对openstack各个组件进行操作。

$./openshit.sh <SERVICE_Name> [aciton]

例如:

$./openshit.sh --all install/uninstall
#注释:安装或卸载所有组件

$./openshit.sh cinder install/uninstall
#注释:安装或卸载cinder [块存储]

$./openshit.sh dashboard install/uninstall
#注释:安装或卸载  [图形界面管理]

$./openshit.sh glance install/uninstall
#注释:安装或卸载 [镜像管理]

$./openshit.sh keystone install/uninstall
#注释:安装或卸载  [身份认证]

$./openshit.sh mysql install/uninstall
#注释:安装或卸载 [数据库]

$./openshit.sh neutron install/uninstall
#注释:安装或卸载 [网络服务]

$./openshit.sh nova install/uninstall
#注释:安装或卸载 [计算]

$./openshit.sh nova-network linstall/uninstall
#注释:安装或卸载 [nova-network]

$./openshit.sh rabbitmq install/uninstall
#注释:安装或卸载 [消息队列]

配置命令

$./openshit.sh --all config

清除

$./openshit.sh --all clean


五、参考文献

1.https://github.com/windworst/openshit
2.http://www.aboutyun.com/thread-11706-1-1.html

猜你喜欢

转载自www.cnblogs.com/xingyunfashi/p/9242686.html