分享

OpenStack安装教程汇总

问题导读
1、OpenStack安装方式大概有哪些?

2、哪些方式适用于生产环境和个人环境?

3、部署发展趋势如何?




(一)Centos7 - devstack快速安装openstack

准备环境
  1. selinux、iptables关闭
  2. mkdir -p ~/.pip          # 使用豆瓣pip源
  3. vim ~/.pip/pip.conf
  4. [global]
  5. index-url = http://pypi.douban.com/simple/
  6. yum install -y git  # 安装git
  7. cd /home
  8. git clone https://github.com/openstack-dev/devstack.git
  9. cd /home/devstack/tools/    # devstack默认不能以root身份运行
  10. ./create-stack-user.sh      # 会创建一个stack用户
  11. chown -R stack. /home/devstack
复制代码



准备local.conf
  1. su stack             # 切换为stack用户
  2. cd /home/devstack/   # 切换到devstack目录下
  3. cp samples/local.conf ./ # 拷贝一个local.conf到本地来
  4. vim local.conf   # 编辑local.conf配置文件,填上你需要安装的组件
  5. [[local|localrc]]
  6. # Define the devstack install directory
  7. DEST=/opt/ice/code/openstack/
  8. #Data directory
  9. DATA_DIR=/opt/ice/data
  10. #Service dirctory
  11. SERVICE_DIR=/opt/ice/data/service
  12. #yum command
  13. YUM=yum
  14. # no internet
  15. #OFFLINE=True
  16. #Reclone
  17. RECLONE=True
  18. #all package for lib
  19. LIBS_FROM_GIT=True
  20. # Minimal Contents
  21. # ----------------
  22. # While ``stack.sh`` is happy to run without ``localrc``, devlife is better when
  23. # there are a few minimal variables set:
  24. # If the ``SERVICE_TOKEN`` and ``*_PASSWORD`` variables are not set
  25. # here you will be prompted to enter values for them by ``stack.sh``
  26. # and they will be added to ``local.conf``.
  27. SERVICE_TOKEN=ice_token
  28. ADMIN_PASSWORD=admin
  29. MYSQL_PASSWORD=stackdb
  30. RABBIT_PASSWORD=stackmq
  31. SERVICE_PASSWORD=$ADMIN_PASSWORD
  32. # ``HOST_IP`` should be set manually for best results if the NIC configuration
  33. # of the host is unusual, i.e. ``eth1`` has the default route but ``eth0`` is the
  34. # public interface.  It is auto-detected in ``stack.sh`` but often is indeterminate
  35. # on later runs due to the IP moving from an Ethernet interface to a bridge on
  36. # the host. Setting it here also makes it available for ``openrc`` to include
  37. # when setting ``OS_AUTH_URL``.
  38. # ``HOST_IP`` is not set by default.
  39. #HOST_IP=w.x.y.z
  40. # Logging
  41. # -------
  42. # By default ``stack.sh`` output only goes to the terminal where it runs.  It can
  43. # be configured to additionally log to a file by setting ``LOGFILE`` to the full
  44. # path of the destination log file.  A timestamp will be appended to the given name.
  45. LOGFILE=$DATA_DIR/logs/stack.sh.log
  46. # Old log files are automatically removed after 7 days to keep things neat.  Change
  47. # the number of days by setting ``LOGDAYS``.
  48. LOGDAYS=2
  49. # Nova logs will be colorized if ``SYSLOG`` is not set; turn this off by setting
  50. # ``LOG_COLOR`` false.
  51. #LOG_COLOR=False
  52. # Using milestone-proposed branches
  53. # ---------------------------------
  54. # Uncomment these to grab the milestone-proposed branches from the repos:
  55. CINDER_BRANCH=stable/juno
  56. GLANCE_BRANCH=stable/juno
  57. KEYSTONE_BRANCH=stable/juno
  58. NOVA_BRANCH=stable/juno
  59. NEUTRON_BRANCH=stable/juno
  60. CEILOMETER_BRANCH=stable/juno
  61. HORIZON_BRANCH=stable/juno
  62. REQUIREMENTS_BRANCH=stable/juno
  63. # -------Service
  64. #
  65. #
  66. ENABLED_SERVICES=g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-cond,n-sch,n-xvnc,n-cauth,mysql,rabbit
  67. ENABLED_SERVICES+=,c-sch,c-api,c-vol
  68. ENABLED_SERVICES+=,ceilometer
  69. # Horizon config
  70. enable_service horzion
  71. # Install the tempest test suite
  72. enable_service tempest
  73. # Neutron
  74. disable_service n-net
  75. enable_service q-svc
  76. enable_service q-agt
  77. enable_service q-dhcp
  78. enable_service q-l3
  79. enable_service q-meta
  80. enable_service q-metering
  81. enable_service neutron
  82. # VXLAN tunnel configuration
  83. Q_PLUGIN=ml2
  84. Q_ML2_TENANT_NETWORK_TYPE=vxlan
复制代码



安装
  1. cd /home/devstack
  2. ./stack.sh  # 开始安装
复制代码



运行Devstack
admin用户
  1. source /home/devstack/openrc admin admin # 加载环境变量进行操作
复制代码


demo用户
  1. source /home/devstack/openrc demo demo # 加载环境变量进行操作
复制代码


############################################
参考链接
http://www.chenshake.com/devstack-installation-and-testing/



(二)RDO快速部署openstack J版
最近在准备redhat openstack认证考试,必须要用到packstack来构建openstack考试平台。在这里做个笔记,方便下次使用。

1 制作本地源
  1. [rdo]
  2. name=rdo
  3. baseurl=http://192.168.1.136/rdo/Packages
  4. gpgcheck=0
复制代码

  1. yum clean all
  2. yum list            # 没有本地源,rdo从网上下载很慢
复制代码



2 安装packstack
  1. yum install -y openstack-packstack   # 安装packstack包
  2. packstack --gen-answer-file /root/answer.txt   # 生成一个answer-file文件
复制代码


3 编辑answer-file
  1. vim /root/answer.txt             # 编辑answer.txt,修改相应内容
  2. CONFIG_CEILOMETER_INSTALL=n
  3. CONFIG_NTP_SERVERS=1.cn.pool.ntp.org         # ntp server地址
  4. CONFIG_COMPUTE_HOSTS=192.168.234.20      
  5. CONFIG_REPO=http://192.168.1.136/rdo/Packages            #  可以配置本地源
  6. CONFIG_KEYSTONE_ADMIN_PW=redhat
  7. CONFIG_HORIZON_SSL=y
  8. CONFIG_PROVISION_DEMO=n
  9. CONFIG_NEUTRON_L2_PLUGIN=ml2
  10. CONFIG_NEUTRON_ML2_TYPE_DRIVERS=vlan
  11. CONFIG_NEUTRON_ML2_TENANT_NETWORK_TYPES=vlan
  12. CONFIG_NEUTRON_ML2_MECHANISM_DRIVERS=openvswitch
  13. CONFIG_NEUTRON_ML2_VLAN_RANGES=physnet1:1000:2000
  14. CONFIG_NEUTRON_OVS_TENANT_NETWORK_TYPE=vlan
  15. CONFIG_NEUTRON_OVS_VLAN_RANGES=physnet1:1000:2000
  16. CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=physnet1:br-eth0
  17. CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-eth0:eth0   #   这里好像是个bug,不填我执行packstack是成功的,然后手动ovs-vsctl add-port
复制代码



还有一个注意的是:selinux不能是disabled的
  1. packstack --answer-file /root/answer.txt  # 等着装完就好了
复制代码


安装完成后,br-ex也要自己手动add-port的
dashboard上创建网络的时候,有个provider默认是default,如果按上面配置就是physnet1。如下图所示:
11.jpg


########################
本文转载自:http://iceyao.blog.51cto.com/9426658/1588071


(三)Openstack一键安装

系统:Centos6.5x64
单节点 CentOS yum 快速安装;
  1. [root@host ~]# vi /etc/yum.repos.d/opentstack.repo
  2. # vi /etc/yum.repos.d/opentstack.repo
  3. [openstack]
  4. name=OpenStack
  5. baseurl=https://repos.fedorapeople.org/repos/openstack/EOL/openstack-grizzly/epel-6/
  6. enabled=1
  7. gpgcheck=0
  8. priority=1
复制代码


  1. [root@host ~]# yum clean all
  2. [root@host ~]# yum install -y openstack-packstack
  3. [root@host ~]# packstack --allinone
复制代码

11.jpg

会有提示输入密码;
访问: http://ip//dashboard/


11.jpg

11.jpg


22.jpg


##################
本文转载自:http://51log.blog.51cto.com/6076767/1597903



(四)OpenStack之Fuel安装
使用Fuel安装OpenStack juno安装OpenStack

(五)OpenStack之手动安装
《OpenStack Juno for RHEL、CentOS、Fedora安装指南》


(六)其他



已有(3)人评论

跳转到指定楼层
nxu_jsjx 发表于 2016-7-10 06:39:04
来徐诶,谢过
回复

使用道具 举报

nxu_jsjx 发表于 2016-7-10 10:13:34
谢谢楼主分享
回复

使用道具 举报

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

本版积分规则

关闭

推荐上一条 /2 下一条