分享

devstack安装和测试

sstutu 发表于 2014-7-18 15:35:05 [显示全部楼层] 只看大图 回帖奖励 阅读模式 关闭右栏 9 58786
问题导读:
1.devstack安装之前需要做哪些准备?
2.如何下载源码?

3.通过什么命令可以运行运行Devstack?




采用豆瓣的pypi进行安装。
目前Devstack脚本已经支持Centos 6.5,那么你可以选择是在Ubuntu 12.04或者CentOS 6.5下来安装,步骤基本都是一样。就是一个git命令安装的区别.
最小化安装CentOS 6.5,我是关闭了selinux,不关闭应该也是可以的。,用root账号登陆。
对于CentOS6.5来说,devstack脚本会添加EPEL和RDO源。
2014年6月6日:文档更新,已经可以支持siwft和trove。不过安装过程,你可能会遇到cliff的bughttps://review.openstack.org/#/c/95916/,如果你遇到horizon无法启动,那么你就去 /etc/httpd/conf.d/ 里把那个配置文件后缀disable去掉就ok。还有就是安装过程,由于启用了heat,会下载一个heat的镜像,会导致安装过程很慢,可以考虑修改stackrc文件,不让下载。另外csdn的git源,也应该没法使用,因为项目太多没有同步了。
修复cilff的bug,估计上游很快就会merge

  1. cd /opt/stack/cliff/
  2. git fetch https://review.openstack.org/openstack/cliff refs/changes/16/95916/4 && git checkout FETCH_HEAD
复制代码





1 准备环境
2 准备Devstack
3 运行Devstack
4 附录



准备环境
设置使用豆瓣pypi源
  1. mkdir $HOME/.pip
  2. vi $HOME/.pip/pip.conf
复制代码
输入下面内容
  1. [global]
  2. index-url = http://pypi.douban.com/simple/
复制代码

简单的做法
  1. mkdir /root/.pip
  2. cat >/root/.pip/pip.conf <<EOF
  3. [global]
  4. index-url = http://pypi.douban.com/simple/
  5. EOF
复制代码

安装git
  1. yum -y install git
复制代码

设置iptables
我发现目前版本,devstack不会去打开iptables的80端口,所以在运行脚本前,我设置一下iptables,编辑 /etc/sysconfig/iptables,添加一行,打开80端口。
准备Devstack
下载代码
  1. cd /home
  2. git clone https://github.com/openstack-dev/devstack.git
复制代码

目前Devstack脚本已经不支持直接使用root身份运行,你需要创建stack用户运行
  1. cd /home/devstack/tools/
  2. ./create-stack-user.sh
复制代码

修改devstack目录权限,让stack用户可以运行
  1. chown -R stack:stack /home/devstack
复制代码

切换的stack用户下
  1. su stack
  2. cd /home/devstack
复制代码
devstack运行时候,检测到操作系统是CentOS,会额外添加RDO和EPEL源,由于我的os已经配置好,我需要把添加的步骤注释掉,修改一下 stack.sh 脚本就可以。
进入devstack目录下,创建localrc 文件,默认devstack会创建一个stack-volumes,用文件来模拟,我修改成cinder-volumes。
你还需要修改你的host ip. 我的localrc
  1. # Misc
  2. HOST_IP=172.28.1.132
  3. DATABASE_PASSWORD=password
  4. ADMIN_PASSWORD=password
  5. SERVICE_PASSWORD=password
  6. SERVICE_TOKEN=password
  7. RABBIT_PASSWORD=password
  8. #change from github to csdn
  9. #GIT_BASE=https://code.csdn.net
  10. ## vnc
  11. #enable_service n-spice
  12. #enable_service n-novnc
  13. #enable_service n-xvnc
  14. # Reclone each time
  15. #RECLONE=yes
  16. RECLONE=no
  17. ## For Keystone
  18. KEYSTONE_TOKEN_FORMAT=PKI
  19. ## For Swift
  20. SWIFT_REPLICAS=1
  21. SWIFT_HASH=011688b44136573e209e
  22. # Enable Logging
  23. LOGFILE=/opt/stack/logs/stack.sh.log
  24. VERBOSE=True
  25. LOG_COLOR=True
  26. SCREEN_LOGDIR=/opt/stack/logs
  27. # Pre-requisite
  28. ENABLED_SERVICES=rabbit,mysql,key
  29. ## If you want ZeroMQ instead of RabbitMQ (don't forget to un-declare 'rabbit' from the pre-requesite)
  30. #ENABLED_SERVICES+=,-rabbit,-qpid,zeromq
  31. ## If you want Qpid instead of RabbitMQ (don't forget to un-declare 'rabbit' from the pre-requesite)
  32. #ENABLED_SERVICES+=,-rabbit,-zeromq,qpid
  33. # Horizon (Dashboard UI) - (always use the trunk)
  34. ENABLED_SERVICES+=,horizon
  35. HORIZON_REPO=https://github.com/openstack/horizon
  36. HORIZON_BRANCH=master
  37. # Nova - Compute Service
  38. ENABLED_SERVICES+=,n-api,n-crt,n-obj,n-cpu,n-cond,n-sch
  39. ######vnc
  40. ENABLED_SERVICES+=,n-novnc,n-xvnc
  41. IMAGE_URLS+=",https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img"
  42. #IMAGE_URLS+=",http://172.28.0.1/image/cirros-0.3.0-x86_64-disk.img"
  43. # Nova Network - If you don't want to use Neutron and need a simple network setup (old good stuff!)
  44. #ENABLED_SERVICES+=,n-net
  45. ## Nova Cells
  46. ENABLED_SERVICES+=,n-cell
  47. # Glance - Image Service
  48. ENABLED_SERVICES+=,g-api,g-reg
  49. # Swift - Object Storage
  50. ENABLED_SERVICES+=,s-proxy,s-object,s-container,s-account
  51. # Neutron - Networking Service
  52. # If Neutron is not declared the old good nova-network will be used
  53. ENABLED_SERVICES+=,q-svc,q-agt,q-dhcp,q-l3,q-meta,neutron
  54. ## Neutron - Load Balancing
  55. ENABLED_SERVICES+=,q-lbaas
  56. ## Neutron - VPN as a Service
  57. ENABLED_SERVICES+=,q-vpn
  58. ## Neutron - Firewall as a Service
  59. ENABLED_SERVICES+=,q-fwaas
  60. # VLAN configuration
  61. #Q_PLUGIN=ml2
  62. #ENABLE_TENANT_VLANS=True
  63. # GRE tunnel configuration
  64. Q_PLUGIN=ml2
  65. ENABLE_TENANT_TUNNELS=True
  66. # VXLAN tunnel configuration
  67. #Q_PLUGIN=ml2
  68. #Q_ML2_TENANT_NETWORK_TYPE=vxlan   
  69. # Cinder - Block Device Service
  70. VOLUME_GROUP="cinder-volumes"
  71. ENABLED_SERVICES+=,cinder,c-api,c-vol,c-sch,c-bak
  72. # Heat - Orchestration Service
  73. ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-api-cw,h-eng
  74. #IMAGE_URLS+=",http://fedorapeople.org/groups/heat/prebuilt-jeos-images/F17-x86_64-cfntools.qcow2"
  75. # Ceilometer - Metering Service (metering + alarming)
  76. ENABLED_SERVICES+=,ceilometer-acompute,ceilometer-acentral,ceilometer-collector,ceilometer-api
  77. ENABLED_SERVICES+=,ceilometer-alarm-notify,ceilometer-alarm-eval
  78. ENABLED_SERVICES+=,trove,tr-api,tr-tmgr,tr-cond
  79. # Apache fronted for WSGI
  80. APACHE_ENABLED_SERVICES+=keystone,swift
  81. #APACHE_ENABLED_SERVICES+=keystone
复制代码

运行Devstack
记住,我们是使用stack用户运行的。
  1. cd /home/devstack
  2. ./stack.sh
复制代码

默认Devstack创建 admin和demo两个用户,通过设置环境变量可以进行操作
admin
  1. source openrc admin admin
复制代码

demo
  1. source openrc demo demo
复制代码

附录
如果你希望用物理的卷代替文件模拟的volume。Devstack会检测是否存在一个stack-volumes 的卷,如果存在就使用,不存在就用文件模拟。
  1. pvcreate /dev/sdc
  2. vgcreate stack-volumes /dev/sdc
复制代码




欢迎加入about云群425860289432264021 ,云计算爱好者群,关注about云腾讯认证空间

已有(9)人评论

跳转到指定楼层
auferack08 发表于 2014-7-21 14:58:07
说的很不错,支持楼主
回复

使用道具 举报

Tink 发表于 2014-7-23 13:54:30
这篇应该是chenshake陈沙克的文章,写得很好,能注明出处自然更好了。
回复

使用道具 举报

四叶草 发表于 2015-6-9 18:18:44
执行./stack.sh时报错[mw_shl_code=bash,true]Package python-routes-1.13-2.el6.noarch already installed and latest version
Package python-sqlalchemy-0.8.4-1.el6.x86_64 already installed and latest version
Package python-suds-0.4.1-3.el6.noarch already installed and latest version
Package python-tempita-0.4-2.el6.noarch already installed and latest version
Package sqlite-3.6.20-1.el6.x86_64 already installed and latest version
Package sudo-1.8.6p3-15.el6.x86_64 already installed and latest version
Package iscsi-initiator-utils-6.2.0.873-13.el6.x86_64 already installed and latest version
Package lvm2-2.02.111-2.el6_6.3.x86_64 already installed and latest version
Package genisoimage-1.1.9-12.el6.x86_64 already installed and latest version
Package sysfsutils-2.1.0-7.el6.x86_64 already installed and latest version
Package sg3_utils-1.28-6.el6.x86_64 already installed and latest version
Package numpy-1.4.1-9.el6.x86_64 already installed and latest version
Package lvm2-2.02.111-2.el6_6.3.x86_64 already installed and latest version
Package scsi-target-utils-1.0.24-16.el6.x86_64 already installed and latest version
Package 2:qemu-img-0.12.1.2-2.448.el6_6.3.x86_64 already installed and latest version
Package postgresql-devel-8.4.20-2.el6_6.x86_64 already installed and latest version
Package iscsi-initiator-utils-6.2.0.873-13.el6.x86_64 already installed and latest version
Package Django14-1.4.20-1.el6.noarch already installed and latest version
Package python-anyjson-0.3.3-1.el6.noarch already installed and latest version
Package 1:python-BeautifulSoup-3.0.8.1-1.el6.noarch already installed and latest version
Package python-coverage-3.0.1-2.el6.x86_64 already installed and latest version
Package python-dateutil-1.4.1-6.el6.noarch already installed and latest version
Package python-eventlet-0.15.2-1.el6.noarch already installed and latest version
Package python-greenlet-0.4.2-1.el6.x86_64 already installed and latest version
Package python-httplib2-0.7.7-1.el6.noarch already installed and latest version
Package python-migrate-0.8.2-1.el6.noarch already installed and latest version
No package python-mox available.
Package python-routes-1.13-2.el6.noarch already installed and latest version
Package python-sphinx-1.1.3-8.el6.noarch already installed and latest version
Package python-sqlalchemy-0.8.4-1.el6.x86_64 already installed and latest version
Package python-webob-1.2.3-8.el6.noarch already installed and latest version
Package pyxattr-0.5.0-1.el6.x86_64 already installed and latest version
Package libxslt-devel-1.1.26-2.el6_3.1.x86_64 already installed and latest version
Nothing to do
++ die 1155 'Missing packages detected'
++ local exitcode=1
++ set +o xtrace
[Call Trace]
./stack.sh:704:source
/home/devstack/tools/install_prereqs.sh:64:install_package
/home/devstack/functions-common:1099:real_install_package
/home/devstack/functions-common:1087:yum_install
/home/devstack/functions-common:1155:die
[ERROR] /home/devstack/functions-common:1155 Missing packages detected
Error on exit
World dumping... see ./worlddump-2015-06-09-101107.txt for details
[/mw_shl_code]就是这句No package python-mox available.报错
我的操作系统是Centos6.5
在执行stack.sh时已经安装了epel和rdo源了
python-mox这个包应该在哪获取
回复

使用道具 举报

yuwenge 发表于 2015-6-9 18:25:22
四叶草 发表于 2015-6-9 18:18
执行./stack.sh时报错[mw_shl_code=bash,true]Package python-routes-1.13-2.el6.noarch already installed ...


可能下载不了,原因你懂的
[mw_shl_code=bash,true]yum install -y python-mox.noarch[/mw_shl_code]

pymox是一套用于python代码unit test的框架. 官方链接如下:
  https://code.google.com/p/pymox/


这是清单
[mw_shl_code=bash,true]/usr/lib/python2.7/dist-packages/mox-0.5.3.egg-info
/usr/lib/python2.7/dist-packages/mox.py
/usr/lib/python2.7/dist-packages/stubout.py
/usr/share/doc/python-mox/README
/usr/share/doc/python-mox/changelog.Debian.gz
/usr/share/doc/python-mox/copyright
/usr/share/pyshared/mox-0.5.3.egg-info
/usr/share/pyshared/mox.py
/usr/share/pyshared/stubout.py[/mw_shl_code]
回复

使用道具 举报

四叶草 发表于 2015-6-11 15:00:02
yuwenge 发表于 2015-6-9 18:25
可能下载不了,原因你懂的

...

果然是被Firewall了,多谢。。。
回复

使用道具 举报

mxj9945 发表于 2015-7-21 18:13:06
四叶草 发表于 2015-6-11 15:00
果然是被Firewall了,多谢。。。

那怎么解决的呢
回复

使用道具 举报

doscho 发表于 2015-8-5 10:33:18
如何访问dashboard?我的访问IP,显示的是Apache2 Ubuntu Default Page。
回复

使用道具 举报

doscho 发表于 2015-10-7 15:08:13
运行后,报如下错误:
df: '/run/user/1000/gvfs': Permission denied
回复

使用道具 举报

TJJTDS 发表于 2015-11-8 12:31:06
我在执行 ./create-stack-user.sh 时候遇到如下错误,请大拿帮忙看看,谢谢!

无标题.png
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条