当前位置:   article > 正文

Openstack——allinone搭建(该文档基于Openstack Stein版本的All in One)_openstack allinone

openstack allinone

目录

(一)安装前的准备

1、初始化

2、修改yum仓库

3、linux必要软件包安装

(二)安装过程

1、安装openstack软件库

2、安装Packstack工具

3、一键部署openstack(需要等待一段时间)

(三)安装后的调整

1、生成虚拟网桥

2、查看登陆密码

3、登陆访问

4、登陆成功

(四)安装备注

1、可能碰到的问题及解决方法

2、安装完成后家目录下生成文件的作用


(一)安装前的准备

主机名IP地址网卡网关DNS虚拟网卡操作系统
openstack10.0.15.100VM net810.0.15.2114.114.114.114br-excentos7.4

1、初始化

  1. [root@localhost ~]# hostnamectl set-hostname openstack
  2. [root@localhost ~]# systemctl disable firewalld
  3. Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
  4. Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
  5. [root@localhost ~]# systemctl disable NetworkManager
  6. Removed symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service.
  7. Removed symlink /etc/systemd/system/dbus-org.freedesktop.NetworkManager.service.
  8. Removed symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.
  9. [root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
  10. TYPE=Ethernet
  11. PROXY_METHOD=none
  12. BROWSER_ONLY=no
  13. BOOTPROTO=none
  14. DEFROUTE=yes
  15. IPV4_FAILURE_FATAL=no
  16. IPADDR=10.0.15.200
  17. NETMASK=255.255.255.0
  18. DNS1=114.114.114.114
  19. GATEWAY=10.0.15.2
  20. NAME=eth0
  21. UUID=9626c5da-56c5-4750-8ee8-53513b8d4833
  22. DEVICE=eth0
  23. ONBOOT=yes
  24. [root@localhost ~]# vi /etc/selinux/config
  25. # This file controls the state of SELinux on the system.
  26. # SELINUX= can take one of these three values:
  27. #     enforcing - SELinux security policy is enforced.
  28. #     permissive - SELinux prints warnings instead of enforcing.
  29. #     disabled - No SELinux policy is loaded.
  30. SELINUX=disabled
  31. # SELINUXTYPE= can take one of three two values:
  32. #     targeted - Targeted processes are protected,
  33. #     minimum - Modification of targeted policy. Only selected processes are protected.
  34. #     mls - Multi Level Security protection.
  35. SELINUXTYPE=targeted
  36. [root@openstack ~]# vi /etc/hosts
  37. 127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
  38. ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
  39. 10.0.15.200     openstack
  40. [root@localhost ~]# reboot

2、修改yum仓库

  1. [root@openstack ~]# rm -rfv /etc/yum.repos.d/*
  2. removed ‘/etc/yum.repos.d/CentOS-Base.repo’
  3. removed ‘/etc/yum.repos.d/CentOS-CR.repo’
  4. removed ‘/etc/yum.repos.d/CentOS-Debuginfo.repo’
  5. removed ‘/etc/yum.repos.d/CentOS-Media.repo’
  6. removed ‘/etc/yum.repos.d/CentOS-Sources.repo’
  7. removed ‘/etc/yum.repos.d/CentOS-Vault.repo’
  8. removed ‘/etc/yum.repos.d/CentOS-fasttrack.repo’
  9. [root@openstack ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
  10. % Total   % Received % Xferd Average Speed   Time   Time     Time Current
  11.                                 Dload Upload   Total   Spent   Left Speed
  12. 100  2523  100  2523    0     0  23227      0 --:--:-- --:--:-- --:--:-- 23361
  13. [root@openstack ~]# sed -i /aliyuncs/d /etc/yum.repos.d/*.repo
  14. [root@openstack ~]# yum clean all;yum repolist all

3、linux必要软件包安装

[root@openstack ~]# yum install vim bash-completion tree net-tools wget lrzsz zip unzip -y

(二)安装过程

1、安装openstack软件库

[root@openstack ~]# yum install centos-release-openstack-stein  -y

2、安装Packstack工具

[root@openstack ~]# yum install  openstack-packstack -y

3、一键部署openstack(需要等待一段时间)

[root@openstack ~]# packstack --allinone

(三)安装后的调整

1、生成虚拟网桥

  1. [root@openstack ~]# cd /etc/sysconfig/network-scripts/
  2. [root@openstack network-scripts]# cp ifcfg-eth0 ifcfg-br-ex
  3. [root@openstack network-scripts]# vi ifcfg-eth0
  4. DEVICE=eth0
  5. ONBOOT=yes
  6. DEVICETYPE=ovs
  7. TYPE=OVSPort
  8. OVS_BRIDGE=br-ex
  9. [root@openstack network-scripts]# vi ifcfg-br-ex
  10. IPADDR=10.0.15.200
  11. NETMASK=255.255.255.0
  12. GATEWAY=10.0.15.2
  13. DNS1=114.114.114.114
  14. OTPROTO=none
  15. DEFROUTE=yes
  16. NAME=br-ex
  17. DEVICE=br-ex
  18. ONBOOT=yes
  19. PEERDNS=no
  20. NM_CONTROLLED=no
  21. [root@openstack network-scripts]# ovs-vsctl add-port br-ex eth0   (命令执行后远程连接会断开,在虚拟机里执行systemctl restart network)

2、查看登陆密码

  1. [root@openstack ~]# cat keystonerc_admin
  2. unset OS_SERVICE_TOKEN
  3.    export OS_USERNAME=admin
  4.    export OS_PASSWORD='09012425534d4139'
  5.    export OS_REGION_NAME=RegionOne
  6.    export OS_AUTH_URL=http://10.0.15.200:5000/v3
  7.    export PS1='[\u@\h \W(keystone_admin)]\$ '
  8.    
  9. export OS_PROJECT_NAME=admin
  10. export OS_USER_DOMAIN_NAME=Default
  11. export OS_PROJECT_DOMAIN_NAME=Default
  12. export OS_IDENTITY_API_VERSION=3

3、登陆访问

 

4、登陆成功

 

(四)安装备注

1、可能碰到的问题及解决方法



使用了epel源,将leatherman更新。

不使用epel源,将不会碰到这个问题 leatherman 版本过高

[root@openstack ~]# yum downgrade leatherman -y

卸载后执行(file为root家目录下的一个以时间和日期命名的.txt文化)

[root@openstack ~]# packstack --answer-file=

 

未安装python2-qpid-proton

[root@openstack ~]# yum install python2-qpid-proton -y

2、安装完成后家目录下生成文件的作用

###安装完成后家目录下生成了以下三个文件

packstack-answers-20220307-042836.txt ###allinone自动应答文件,里面包含了openstack创建时需要的配置信息,例如admin用户的登陆密码,各组件的数据库密码,物理网络名称等等

keystonerc_admin ###admin用户的环境变量,管理openstack前必须使用,使用方法 . keystonerc_admin 或者 source keystonerc_admin

keystonerc_demo ###demo用户的环境变量


                
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/721934
推荐阅读
相关标签
  

闽ICP备14008679号