openstack奠基篇:devstack (liberty)于centos 7安装
openstack是什么,能做什么,我就不说了,他的优势和伟大,可以想想AWS的云服务平台。学习和研究openstack(IaaS),个人的习惯是有一个可以操作的平台,然后结合代码看看详细逻辑,这个过程,最好的选择就是devstack了,一个单机安装openstack的最佳选择,简化了我们的入门难度。
第一步,下载源码(注意版本不要忘记了哦,否则下载的可能就是master分支的东西了,这个可能会遇到奇奇怪怪的问题的,我自然遇到过,因为这个不是stable的,就不说了。。。):
git clone https://git.openstack.org/openstack-dev/devstack -b stable/liberty
然后将devstack/samples下面的local.conf拷贝到devstack目录下,修改一下里面的内容,根据自己的需要吧,初次安装,还是简单点,默认应该也行。或者直接在devstack目录下新建一个localrc的文件。 我修改的local.conf主要内容如下:
# Misc
ADMIN_PASSWORD=shihuc
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
SERVICE_TOKEN=$ADMIN_PASSWORD # Target Path
DEST=/opt/stack # Enable Logging
LOGFILE=$DEST/logs/stack.sh.log
VERBOSE=True
LOG_COLOR=True
SCREEN_LOGDIR=$DEST/logs KEYSTONE_TOKEN_FORMAT=UUID # Nova
enable_service n-novnc n-cauth # Neutron
disable_service n-net
ENABLED_SERVICES+=,q-svc,q-agt,q-dhcp,q-l3,q-meta,neutron
ENABLED_SERVICES+=,q-lbaas,q-vpn,q-fwaas # Swift
#enable_service s-proxy s-object s-container s-accounts
#SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5 # Cinder
VOLUME_GROUP="cinder-volumes"
ENABLED_SERVICES+=,cinder,c-api,c-vol,c-sch,c-bak # Ceilometer
#enable_service ceilometer-acompute ceilometer-acentral ceilometer-anotification ceilometer-collector ceilometer-api
#enable_service ceilometer-alarm-notifier ceilometer-alarm-evaluator # Heat
enable_service heat h-api h-api-cfn h-api-cw h-eng
enable_service tempest # Trove
enable_service trove tr-api tr-tmgr tr-cond # Sahara
enable_service sahara HOST_IP=10.121.2.117
FIXED_RANGE=10.121.2.0/
NETWORK_GATEWAY=10.121.2.1
#FLOATING_RANGE=10.0.0.0/
#PUBLIC_NETWORK_GATEWAY=10.0.0.2
#Q_FLOATING_ALLOCATION_POOL=start=10.0.0.100,end=10.0.0.150
liberty版本的devstack安装需求是Centos要求版本要至少是7,我这里安装用的是7.2,由于自己工作用的Linux OS是centos6.4,我尝试将devstack的local.conf里面添加FORCE=True,最终安装还是不成功,第一个错误如下:
[root@CloudGame tools]# ./create-stack-user.sh
/mnt/workwps/OpenCloud/devstack/functions-common: line : conditional binary operator expected
这个问题,非常诡异,应该是shell版本的问题吧,上面的错误所在的源代码如下:
$xtrace
}
function isset {
[[ -v "$1" ]]
}
# Control Functions
# =================
起初,我依据函数名isset猜测这个函数是判断参数是否赋值了,所以我将其改为下面:
function isset {
#[[ -v "$1" ]]
[[ ! -z "$1" ]]
}
这个问题是解决了,可以往下面继续执行,但是后面有遇到了其他的问题,pip安装的问题,我本地安装的pip是1.5.5的老版本,可以看下面的错误日志,算是比较容易解决的问题:
-- ::27.802 | + sudo -H -E python /mnt/workwps/OpenCloud/devstack/files/get-pip.py
-- ::28.959 | /usr/local/lib/python2./site-packages/distribute-0.6.-py2..egg/setuptools/command/install_scripts.py:: UserWarning: Module pip was already imported from /tmp/tmpIgbaRF/pip.zip/pip/__init__.py, but /usr/local/lib/python2./site-packages/pip-1.5.-py2..egg is being added to sys.path
-- ::28.959 | from pkg_resources import Distribution, PathMetadata, ensure_directory
-- ::29.449 | Collecting pip
-- ::29.523 | Using cached pip-7.1.-py2.py3-none-any.whl
-- ::29.578 | Installing collected packages: pip
-- ::29.578 | Found existing installation: pip 1.5.
-- ::29.579 | Uninstalling pip-1.5.:
-- ::29.584 | Successfully uninstalled pip-1.5.
-- ::30.250 | Successfully installed pip-7.1.
-- ::30.668 | + [[ -n '' ]]
-- ::30.668 | + pip_install -U setuptools
-- ::30.877 | + sudo -H http_proxy= https_proxy= no_proxy= PIP_FIND_LINKS= /usr/bin/pip install -c /opt/stack/requirements/upper-constraints.txt --upgrade -U setuptools
-- ::30.917 | Traceback (most recent call last):
-- ::30.917 | File "/usr/bin/pip", line , in <module>
-- ::30.917 | from pkg_resources import load_entry_point
-- ::30.917 | File "/usr/local/lib/python2.7/site-packages/distribute-0.6.27-py2.7.egg/pkg_resources.py", line , in <module>
-- ::30.917 | working_set.require(__requires__)
-- ::30.917 | File "/usr/local/lib/python2.7/site-packages/distribute-0.6.27-py2.7.egg/pkg_resources.py", line , in require
-- ::30.917 | needed = self.resolve(parse_requirements(requirements))
-- ::30.917 | File "/usr/local/lib/python2.7/site-packages/distribute-0.6.27-py2.7.egg/pkg_resources.py", line , in resolve
-- ::30.917 | raise DistributionNotFound(req)
-- ::30.918 | pkg_resources.DistributionNotFound: pip==1.5.
后来,为了让脚本不去对我的本地的pip版本进行检查,我手动安装了7.1.2的版本:
[root@CloudGame devstack]# easy_install-2.7 pip==7.1.
Searching for pip==7.1.
Reading http://pypi.python.org/simple/pip/
Best match: pip 7.1.
Downloading https://pypi.python.org/packages/source/p/pip/pip-7.1.2.tar.gz#md5=3823d2343d9f3aaab21cf9c917710196
Processing pip-7.1..tar.gz
Writing /tmp/easy_install-_3i7r6/pip-7.1./setup.cfg
Running pip-7.1./setup.py -q bdist_egg --dist-dir /tmp/easy_install-_3i7r6/pip-7.1./egg-dist-tmp-a6bKaB
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.mailmap'
warning: no previously-included files found matching '.travis.yml'
warning: no previously-included files found matching 'pip/_vendor/Makefile'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files found matching 'dev-requirements.txt'
no previously-included directories found matching '.travis'
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'contrib'
no previously-included directories found matching 'tasks'
no previously-included directories found matching 'tests'
Removing pip 1.5. from easy-install.pth file
Adding pip 7.1. to easy-install.pth file
Installing pip script to /usr/local/bin
Installing pip2. script to /usr/local/bin
Installing pip2 script to /usr/local/bin Installed /usr/local/lib/python2./site-packages/pip-7.1.-py2..egg
Processing dependencies for pip==7.1.
Finished processing dependencies for pip==7.1.
注意咯,这个安装的路径是在/usr/local/bin下面,而stack.sh脚本中显示的是在/usr/bin下面哟,这个也简单,创建一个软链接就可以了:
[root@CloudGame bin]# ln -s /usr/local/bin/pip pip
接下来,继续在本地的非官方建议的版本上(人家说了,centos要求7以上)折腾,发现还有问题,首先是yum_install epel-release这个操作总失败,其次还有df: `/root/.gvfs': Permission denied,算了,不折腾了,也许这个就是一个走不下去的死路。
最后,我选择了在AWS上创建一个VM,选择了一个platform是CentOS7.2的PV AMI创建了一个机器。2个cpu,8G RAM,估计是没有什么问题的,就一个devstack的安装过程而已!的确,在这个上面确实比较顺利。VM建好后,SSH登录上去,我是在/opt下面进行的所有的操作。下面简单列一下正常的顺序(注意,保证本地git能用):
Step 1:
git clone https://git.openstack.org/openstack-dev/devstack -b stable/liberty
Step 2:
如前面所述的local.conf进行配置local.conf。
Step 3:
devstack运行在非root用户下,下面进行创建和配置stack用户,并且修改属组:
[root@ip---- tools]# ./create-stack-user.sh
Creating a group called stack
Creating a user called stack
Giving stack user passwordless sudo privileges ----------------------------------------------------------------------
[root@ip---- devstack]# chown -R stack:stack /opt/devstack/ ----------------------------------------------------------------------
10 [root@ip-10-121-5-244 devstack]# su stack
Step 4:
下面开始执行安装过程的脚本:
[root@ip---- devstack]# ./stack.sh
这个过程会花一段时间哟,耐心等等吧。最终执行完毕后,你会看到下面的congratulation的信息:
This is your host IP address: 10.121.5.244
This is your host IPv6 address: ::
Horizon is now available at http://10.121.5.244/dashboard
Keystone is serving at http://10.121.5.244:5000/
The default users are: admin and demo
The password: shihuc
其实,这个过程中的日志信息很有价值,但是不知如何上传日志,就算了。自己安装应该也可以看到自己的日志,个人觉得比较有信息含量。
最后,打开上面恭喜信息中的dashboard,看看是什么模样呗。这里,主要截取的是有点内容的图,多数的页面都是空的,因为是新启动的devstack。

这个是登录的界面,可以用demo或者admin用户登录,密码是自己配置的密码哟,就在local.conf里面。

这个是登录后的第一个页面,是个资源的统计信息展示页面。

这个是默认的镜像文件列表,可以用来创建instance的哟。

访问与安全信息页面。

这个是能够创建的instance的类型列表,以及对应的资源分配信息。是不是和AWS的EC2的类型有些不同???没关系的,不同的产品嘛!

元数据定义列表,可以作为参考。了解openstack的内部定义。

这个是用户列表。
最后展示一下,创建实例的图片,有个感性的认识吧:

说明下,我这里没有创建instance,只是看看这个创建实例的配置页面是什么样子,对比与AWS EC2的配置页面,还是有很大的不同哟。。。
好了,奠基篇到此为止。
openstack奠基篇:devstack (liberty)于centos 7安装的更多相关文章
- Ubuntu16手动安装OpenStack——glance篇--转
全文转自https://www.voidking.com/dev-ubuntu16-manual-openstack-glance/ 目标 紧接着<Ubuntu16手动安装OpenStack—— ...
- 在CentOS下安装配置MySQL(转)
今天刚把项目做完,需要马上部署到新到的测试服务器上,于是乎,要在服务器上安装环境,由于好久在linux上部署了,手有些生,比较费劲装完,现在把重要步骤贴出,供自己以后参照.1.首先要看看有没有已经安装 ...
- openstack外篇之认识mysql授权及一些操作
openstack外篇之认识mysql授权及一些操作 http://www.aboutyun.com/thread-11405-1-1.html
- 分布式文件系统 FastDFS 5.0.5 & Linux CentOS 7 安装配置(单点安装)——第一篇
分布式文件系统 FastDFS 5.0.5 & Linux CentOS 7 安装配置(单点安装)--第一篇 简介 首先简单了解一下基础概念,FastDFS是一个开源的轻量级分布式文件系统,由 ...
- Openstack入门篇(十五)之如何创建生产使用的openstack镜像
在linux-node1节点上: [root@linux-node1 ~]# yum install -y openstack-nova-compute [root@linux-node1 ~]# y ...
- Setting up multi nodes live migration in Openstack Juno with devstack
Setting up multi nodes live migration in Openstack Juno with devstack Summary Live migration overvie ...
- mysql 开发进阶篇系列 28 数据库二进制包安装(centos系统准备)
1. centos 7安装工作 对于mysql二进制安装,我这里在使用一台新的centos系统.准备好VMware,Xftp-6.0, Xshell-6.0.在VMware中网络使用桥接模式,分配20 ...
- Linux从入门到放弃、零基础入门Linux(第二篇):在虚拟机vmware中安装linux(一)超详细手把手教你安装centos分步图解
一.Vmware vmware介绍:VMware,Inc. (Virtual Machine ware)是一个“虚拟PC”软件公司,提供服务器.桌面虚拟化的解决方案.其虚拟化平台的产品包括播放器:它能 ...
- [第三篇]——CentOS Docker 安装之Spring Cloud直播商城 b2b2c电子商务技术总结
CentOS Docker 安装 Docker 支持以下的 64 位 CentOS 版本: CentOS 7 CentOS 8 更高版本... 使用官方安装脚本自动安装 安装命令如下: curl -f ...
随机推荐
- js实现分页列表添加样式
<script> var dUrl=window.location.href; var cUrl=(dUrl.substring(0, dUrl.indexOf('list_'))); v ...
- R6010 -abort() has been called
版权所有,转载请注明出处. R6010 -abort() has been called 环境: Windows7 旗舰版 64Bit Visual studio 2012 编译32Bit运行程序 E ...
- setSelection()和requestFocusFromTouch()
昨天我遇到一个问题,点击返回的时候要在onResume()中用setSelection()定位到刚才点击的item,因为点击item进入后,我又一直点击“下一个”按钮,但是返回的时候listview不 ...
- (实用篇)PHPExcel读取Excel文件的实现代码
用PHPExcel读取Excel 2007 或者Excel2003文件,需要的朋友,可以参考下. 涉及知识点: php对excel文件进行循环读取 php对字符进行ascii编码转化,将字符转为十进 ...
- Apache搭建多个站点方法详解
www.111cn.net 编辑:Bolshevik 来源:转载 Apache的虚拟主机是一种允许在同一台机器上配置多个不同站点的web服务器环境的,就是iis一样可以创建多站点了,但是apache需 ...
- ZOJ 1188 DNA Sorting
原题链接 题目大意:给定一串字符串,查找字符串里字母逆序排列的对数,按照由少到多的顺序把所有字符串进行排列. 解法:用C++字符串string类的iterator,从每个字符串的起始开始,查找逆序字符 ...
- ZOJ 1107 FatMouse and Cheese
原题链接 题目大意:FM在一个街道n*n街道的(0,0)点,在每个网格里放着cheese,他要尽可能多的吃这些cheese.有两个规则:1)他跑的总距离不能超过k步:2)下一个节点的cheese的块数 ...
- Codeforces 106 C 多重背包
题目链接:http://codeforces.com/problemset/problem/106/C 根据题意列出式子,设每种蛋糕做了xi个,则对于每种材料bi*xi<=ai. 对于dough ...
- UVa 839 天平
原题链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem ...
- java的nio之:java的nio系列教程之channel的概念
一:java的nio的channel Java NIO的通道类似流,但又有些不同: ==>既可以从通道中读取数据,又可以写数据到通道.但流的读写通常是单向的. ==>通道可以异步地读写. ...