写在前面的话,在网上看了一个国外的一键安装视频,我也照着做,结果出现很多错误,现在把坑解决了,照着做肯定能安装成功的

环境

  virtualhost 下的centos7

配置

  双网卡 一个10网段,nat通信用 一个192网段 和宿主机通信使用

  2c 这个测试部署的话,不是强要求,我部署后CPU也就占20%

  5.4G内存 我的宿主机也就8G内存 配到这个数据已经很卡了 再次PS

  安装完成要占用约5G左右的内存

部署

  由于我的是nat 网络,所以先配置双网卡,否则部署后,不能正常访问openstack的管理网页,因为需要修改到这个参数,这个到后面再说

  双网卡配置略过,自己在网上查吧很多的。实在找不到就留言

正式开始

  1-设置yum源01_setyum.sh(非常重要,虽然出了openstack 专用的yum源,但那不是咱们能用的),我做成了脚本样子的,直接拷贝拿去用,镜像源用的是清华源,因为阿里源有的包跳转到404的链接还在上面,后面一键安装的时候就会坑哭你,亲测。。都是泪。脚本正文如下

  1. #创建备份路径
  2. mkdir -p /etc/yum.repos.d/bak_tmp/
  3. #移走当前的所有源,为什么?因为一键安装会乱跳,跳到不能用的就报错,然后你就安装失败
  4. mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak_tmp/
  5. #创建yum 文件
  6. touch /etc/yum.repos.d/centos-tuna.repo
  7. #导入镜像内容到yum文件中
  8. cat >>/etc/yum.repos.d/centos-tuna.repo << EOF
  9. #CentOS-Base.repo
  10. #
  11. # The mirror system uses the connecting IP address of the client and the
  12. # update status of each mirror to pick mirrors that are updated to and
  13. # geographically close to the client. You should use this for CentOS updates
  14. # unless you are manually picking other mirrors.
  15. #
  16. # If the mirrorlist= does not work for you, as a fall back you can try the
  17. # remarked out baseurl= line instead.
  18. #
  19. #
  20.  
  21. [base]
  22. name=CentOS-\$releasever - Base
  23. baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/\$releasever/os/\$basearch/
  24. #mirrorlist=http://mirrorlist.centos.org/?release=\$releasever&arch=\$basearch&repo=os
  25. gpgcheck=1
  26. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
  27.  
  28. #released updates
  29. [updates]
  30. name=CentOS-\$releasever - Updates
  31. baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/\$releasever/updates/\$basearch/
  32. #mirrorlist=http://mirrorlist.centos.org/?release=\$releasever&arch=\$basearch&repo=updates
  33. gpgcheck=1
  34. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
  35.  
  36. #additional packages that may be useful
  37.  
  38. [centosplus]
  39. name=CentOS-\$releasever - Plus
  40. baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/\$releasever/centosplus/\$basearch/
  41. #mirrorlist=http://mirrorlist.centos.org/?release=\$releasever&arch=\$basearch&repo=centosplus
  42. gpgcheck=1
  43. enabled=0
  44. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
  45. [cloud]
  46. name=CentOS-\$releasever - Cloud
  47. baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/\$releasever/cloud/\$basearch/openstack-ocata/
  48. enabled=1
  49. gpgcheck=0
  50. [paas]
  51. name=CentOS-\$releasever - paas
  52. baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/\$releasever/paas/\$basearch/openshift-origin13/
  53. enabled=1
  54. gpgcheck=0
  55. [kvm]
  56. name=CentOS-\$releasever - kvm
  57. baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/\$releasever/virt/\$basearch/kvm-common/
  58. enabled=1
  59. gpgcheck=0
  60.  
  61. EOF
  62. #清除yum缓存
  63. yum clean all
  64. #重新做yum 缓存
  65. yum makecache

  2-配置环境 02_setenv.sh

  1. cat >/etc/environment <<EOF
  2. LANG=en_US.utf-
  3. LC_ALL=en_US.utf-
  4. EOF
  5.  
  6. systemctl disable firewalld
  7. systemctl stop firewalld
  8. systemctl disable NetworkManager
  9. systemctl stop NetworkManager
  10. systemctl enable network
  11. systemctl restart network

  3-安装一键部署包 03_set_openstack-packstack.sh

  1. yum -y update
  2. yum install -y openstack-packstack
  3. #报错无法安装openstack-selinux 没有相关依赖包,通过增加paas 镜像源解决
  4. yum install -y openstack-selinux
  5. yum -y install wget
  6. #--提示缺少libLibev.so.()(64bit)
  7. wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
  8. yum -y install libev
    #有可能yum源混乱了,所以重新执行yibian
  9. mkdir -p /etc/yum.repos.d/bak_tmp_1
  10. mv /etc/yum.repos.d/*.repo /etc/yum.repo.d/bak_tmp_1/
  11. mv /etc/yum.repos.d/bak_tmp_1/centos-tuna.repo /etc/yum.repos.d/
  12. yum clean all
    yum makecache
  13. #解决python-werkzeug 不在cloud源,在virt里面,所以找不到此包
  14. wget -O /root/python-werkzeug-0.9.1-1.el7.noarch.rpm https://mirrors.tuna.tsinghua.edu.cn/centos/7/virt/x86_64/ovirt-4.3/common/python-werkzeug-0.9.1-1.el7.noarch.rpm
  15. rpm -ivh /root/python-werkzeug-0.9.1-1.el7.noarch.rpm

  执行到这里才完成一点点,为了保险。重新进入到yum文件夹

  1. cd /etc/yum.repos.d/
  2. ll
  3. #确认当前只有一个centos-tuna.repo

  确认完成执行最后一步安装操作,也就是出错最多的操作

  1. #-d 表示debug 日志级别
  2. packstack --allinone -d

  安装成功的样例如下

  比较长,就不展开了 

  1. [root@openstack-allinone yum.repos.d]# packstack --allinone -d
  2. Welcome to the Packstack setup utility
  3.  
  4. The installation log file is available at: /var/tmp/packstack/--CWIVyN/openstack-setup.log
  5.  
  6. Installing:
  7. Clean Up [ DONE ]
  8. Discovering ip protocol version [ DONE ]
  9. Setting up ssh keys [ DONE ]
  10. Preparing servers [ DONE ]
  11. Pre installing Puppet and discovering hosts' details [ DONE ]
  12. Preparing pre-install entries [ DONE ]
  13. Setting up CACERT [ DONE ]
  14. Preparing AMQP entries [ DONE ]
  15. Preparing MariaDB entries [ DONE ]
  16. Fixing Keystone LDAP config parameters to be undef if empty[ DONE ]
  17. Preparing Keystone entries [ DONE ]
  18. Preparing Glance entries [ DONE ]
  19. Checking if the Cinder server has a cinder-volumes vg[ DONE ]
  20. Preparing Cinder entries [ DONE ]
  21. Preparing Nova API entries [ DONE ]
  22. Creating ssh keys for Nova migration [ DONE ]
  23. Gathering ssh host keys for Nova migration [ DONE ]
  24. Preparing Nova Compute entries [ DONE ]
  25. Preparing Nova Scheduler entries [ DONE ]
  26. Preparing Nova VNC Proxy entries [ DONE ]
  27. Preparing OpenStack Network-related Nova entries [ DONE ]
  28. Preparing Nova Common entries [ DONE ]
  29. Preparing Neutron LBaaS Agent entries [ DONE ]
  30. Preparing Neutron API entries [ DONE ]
  31. Preparing Neutron L3 entries [ DONE ]
  32. Preparing Neutron L2 Agent entries [ DONE ]
  33. Preparing Neutron DHCP Agent entries [ DONE ]
  34. Preparing Neutron Metering Agent entries [ DONE ]
  35. Checking if NetworkManager is enabled and running [ DONE ]
  36. Preparing OpenStack Client entries [ DONE ]
  37. Preparing Horizon entries [ DONE ]
  38. Preparing Swift builder entries [ DONE ]
  39. Preparing Swift proxy entries [ DONE ]
  40. Preparing Swift storage entries [ DONE ]
  41. Preparing Gnocchi entries [ DONE ]
  42. Preparing MongoDB entries [ DONE ]
  43. Preparing Redis entries [ DONE ]
  44. Preparing Ceilometer entries [ DONE ]
  45. Preparing Aodh entries [ DONE ]
  46. Preparing Puppet manifests [ DONE ]
  47. Copying Puppet modules and manifests [ DONE ]
  48. Applying 10.0..28_controller.pp
  49. 10.0..28_controller.pp: [ DONE ]
  50. Applying 10.0..28_network.pp
  51. 10.0..28_network.pp: [ DONE ]
  52. Applying 10.0..28_compute.pp
  53. 10.0..28_compute.pp: [ DONE ]
  54. Applying Puppet manifests [ DONE ]
  55. Finalizing [ DONE ]
  56.  
  57. **** Installation completed successfully ******
  58.  
  59. Additional information:
  60. * A new answerfile was created in: /root/packstack-answers--.txt
  61. * Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
  62. * File /root/keystonerc_admin has been created on OpenStack client host 10.0.2.28. To use the command line tools you need to source the file.
  63. * To access the OpenStack Dashboard browse to http://10.0.2.28/dashboard .
  64. Please, find your login credentials stored in the keystonerc_admin in your home directory.
  65. * Because of the kernel update the host 10.0.2.28 requires reboot.
  66. * The installation log file is available at: /var/tmp/packstack/--CWIVyN/openstack-setup.log
  67. * The generated manifests are available at: /var/tmp/packstack/--CWIVyN/manifests
  68. * Note temporary directory /var/tmp/packstack/503a14fac81b4a29937e3fc3f14381f5 on host 10.0.2.28 was not deleted for debugging purposes.
  69. You have new mail in /var/spool/mail/root

  失败的案例如下

  1. Preparing Redis entries [ DONE ]
  2. Preparing Ceilometer entries [ DONE ]
  3. Preparing Aodh entries [ DONE ]
  4. Preparing Puppet manifests [ DONE ]
  5. Copying Puppet modules and manifests [ DONE ]
  6. Applying 10.0..28_controller.pp
  7. 10.0..28_controller.pp: [ ERROR ]
  8. Applying Puppet manifests [ ERROR ]
  9.  
  10. ERROR : Error appeared during Puppet run: 10.0..28_controller.pp
  11. Error: Execution of '/usr/bin/yum -d 0 -e 0 -y install openstack-aodh-notifier' returned : Error downloading packages:
  12. You will find full trace in log /var/tmp/packstack/--TbxiNW/manifests/10.0..28_controller.pp.log
  13. Please check log file /var/tmp/packstack/--TbxiNW/openstack-setup.log for more information
  14. Additional information:
  15. * A new answerfile was created in: /root/packstack-answers--.txt
  16. * Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
  17. * File /root/keystonerc_admin has been created on OpenStack client host 10.0.2.28. To use the command line tools you need to source the file.
  18. * To access the OpenStack Dashboard browse to http://10.0.2.28/dashboard .
  19. Please, find your login credentials stored in the keystonerc_admin in your home directory.
  20. * Note temporary directory /var/tmp/packstack/ff08df80e03e49f49e802dd352ea13e0 on host 10.0.2.28 was not deleted for debugging purposes.
  21. 不要慌,检查你的文件夹下的yum 源,全部移除到备份文件夹
  22. yum makecache
  23. 重新开始执行

  部署成功后验证登陆,ip 为你自己虚拟机的ip,主要看

  1. more /etc/httpd/-hrion*.conf #记不清全拼了,找到这个文件
  2. 增加一个serveralias 192.168.xx #宿主机和虚拟机能正常通信的IP
  3. #重启
  4. systemctl restart httpd

  千辛万苦就是要看到这么一个图。爬坑也是花时间的,现在总结在这里。祝你们测试部署成功

    登陆的账号密码在

  1. --密码文件在root用户目录下
  2. cat /root/keystonerc_admin
  3. 复制OS_USERNAME=admin
  4. OS_PASSWORD=XXXX

  结束语

  这次的部署获益良多,要感谢阿里云yum源的一个功能,就是在页面可以支持搜索包,这样我就知道这个包在哪个文件夹下,也是感谢清华yum源的给力,通过在阿里yum搜索到的包,去清华yum源找到对应的页面 ,一步步配置到第一步设置的yum中。才能正常的安装这个一键安装包。否则在vpn的龟速下是很难正常完成一键部署的安装,这个一键部署的openstack 主要还是用来体会一下openstack是一个怎么样使用的。自己装一次,比看10次文档还印象深刻。

如何一步步使用国内yum源一键安装openstack-ocata版本基于centos7的更多相关文章

  1. (转)国内yum源的安装(163,阿里云,epel)

    国内yum源的安装(163,阿里云,epel) ----阿里云镜像源 1.备份 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS ...

  2. 国内yum源的安装(163,阿里云,epel)

    ----阿里云镜像源 1.备份 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 2.下载新的 ...

  3. CentOS7配置更新国内yum源

    备份本地yum源文件 cd /etc/yum.repo.d/ mv CentOS-Base.repo CentOS-Base.repo.bakeup 下载国内yum源 阿里云yum源 wget htt ...

  4. CentOS7修改为国内yum源

    备份源yum源 如果是国内下载的CentOS很可能国内YUM源已经设置好了. 备份/etc/yum.repos.d/下的*.repo文件. 在CentOS中配置使用网易和阿里的开源镜像 wget ht ...

  5. contos 配置国内yum源

    contos配置国内yum源 前言 rpm管理软件包的命令,很难用,需要手动解决以来关系,所以最好用 yum 的理念是使用一个中心仓库(repository)管理一部分甚至一个distribution ...

  6. contos配置国内yum源

    contos配置国内yum源 前言 rpm管理软件包的命令,很难用,需要手动解决以来关系,所以最好用 yum 的理念是使用一个中心仓库(repository)管理一部分甚至一个distribution ...

  7. 替换国内yum源以及pip源

    因为一些原因,不论是网络还是啥啥啥的原因,国外的源访问时不时的很慢,这时候我们就可以将国外的源替换为国内源,提高下载速度. yum源替换 环境:centos7(如果你的发行版本不是这个,此方法不保证能 ...

  8. redhat centos yum源的安装

    redhat centos yum源的安装 1.除旧 #cd /etc/yum.repos.d #mv rhel-debuginfo.repo rhel-debuginfo.repo.bak 此处将其 ...

  9. redhat更改yum源及安装PHP环境

    redhat更新yum源 删除同RHEL一同安装的yum源 rpm -qa|grep yum #查看本地yum yum list | wc -l #看个数 yum install pip #看现象 r ...

随机推荐

  1. Redis 消息中间件 ServiceStack.Redis 轻量级

    问题: 公司开了个新项目,算上我一共3个人.车间里机台通过流水线连通联动的玩意.一个管理控制系统连接各个机台和硬件.专机类型就有5种,个数差不多20个左右. 软件规划的时候采用总分的结构,管理控制系统 ...

  2. Hyperledger Fabric——balance transfer(四)安装和实例化chaincode

    详细解析blance transfer示例的安装(install)和实例化(Instantiate)链码(chaincode)的过程.安装chaincode会根据本地的链码文件生成chaincode镜 ...

  3. PHP非常用函数汇总

    1) ARRAY_FILTER — 用回调函数过滤数组中的单元 function  odd ( $var ) {      // returns whether the input integer i ...

  4. Centos7 安装完以后安全配置

    1.更新系统和补丁 我们的互联网是很不安全的,每天都有新的漏洞出现和修复,所以一定要更新.更新.更新, yum -y update 上面的命令是检查更新并安装,包括内核和软件,建议刚安装完就更新一次, ...

  5. C#判断网址的可访问性

    /// <summary> /// 判断网址是否可以访问 /// </summary> /// <param name="Url"></p ...

  6. cp: 无法创建普通文件 : 文件已存在

    背景 碰到一个偶现的编译出错问题,如图 报错的信息是 cp: 无法创建普通文件"xxx": 文件已存在 排查原因 看了下 Makefile,这句非常简单,就是 cp ./xxx . ...

  7. pytest常用命令参数

    pytest 参数 1.参数:-s 运行过程中执行print打印函数:pytest -s,以下两个输出 上边带参数,下边不带 2.参数: --collect-only 收集将要执行的用例,但不会执行用 ...

  8. python 比较常见的工具方法

    下面是一些工作过程中比较常见的工具方法,但不代表最终答案.希望能对你有所帮助,如果您有更好更多的方法工具,欢迎推荐! 1. 按行读取带json字符串的文件 # -*- coding:utf-8 -*- ...

  9. golang内置类型和内置函数

    golang内置类型和内置函数是不需要引入包直接可用的 golang内置类型: 数值类型 string int,unint float32,float64 bool array 有长度的 comple ...

  10. Linux (八)服务

    个人博客网:https://wushaopei.github.io/    (你想要这里多有) 1.服务的概念 操作系统中在后台持续运行的程序,本身并没有操作界面,需要通过端口号访问和操作.CentO ...