当前位置:   article > 正文

国基北盛 openstack 云平台搭建保姆级步骤_国基北盛openstack

国基北盛openstack

需要使用到的软件

VMware-workstation-full-16.1.2

链接:https://pan.baidu.com/s/1oauUyyfQFNAKboUXDu9QQg?pwd=6666

提取码:6666

SecureCRTPortable

链接:https://pan.baidu.com/s/1kXJsYeQuQeClJYNbgkIjRw?pwd=6666

提取码:6666

需要下载以下三种镜像

CentOS-7.5-x86_64-DVD-1804

链接:https://pan.baidu.com/s/1xy8PIGowJZeFQjCGO8mtCA?pwd=6666

提取码:6666

CentOS-7-x86_64-DVD-1804

链接:https://pan.baidu.com/s/17N4zS2emHDDUyfPigT6uAg?pwd=6666

提取码:6666

chinaskills_cloud_iaas

链接:https://pan.baidu.com/s/1zOOXj6JIWrrXykZjbZZQbQ?pwd=6666

提取码:6666

创建虚拟机controller

跟着图片操作

注意:

创建虚拟机 controller

注意更改磁盘位置

建议在 D盘创建两个空文件夹,名字是controller

注意:在这里放CentOS-7.5-x86_64-DVD-1804镜像

创建一个网络适配器2

一直点击确定就完成创建虚拟机controller


创建虚拟机compute

注意:

创建虚拟机 compute

注意更改磁盘位置

建议在 D盘创建两个空文件夹,名字是compute

注意:在这里放CentOS-7.5-x86_64-DVD-1804镜像

创建一个100G的硬盘2

创建一个网络适配器2

一直点击确定就完成创建虚拟机compute


依次打开虚拟机controller、compute

注意!!!

进入这个页面按一下方向键 ↑

然后再按一下 TAB

controller、compute的步骤几乎相同 有几处不同之处会标记

net.ifnames=0 biosdevname=0

语言建议使用简体中文(中国)

点击完成就ok

点击接受更改

点击开始安装

注意:

用户名不同

上面是controller

  1. hostnamectl set-hostname controller
  2. bash
  3. hostname
  4. vi /etc/sysconfig/network-scripts/ifcfg-eth0

下面是compute

  1. hostnamectl set-hostname compute
  2. bash
  3. hostname
  4. vi /etc/sysconfig/network-scripts/ifcfg-eth0

注意:

IPADDR不同

上面是controller

  1. IPADDR=192.168.100.10
  2. GATEWAY=192.168.100.2
  3. DNS1=8.8.8.8

下面是compute

  1. IPADDR=192.168.100.10
  2. GATEWAY=192.168.100.2
  3. DNS1=8.8.8.8

两个都是一样的

注意:

上面是controller

下面是compute

  1. systemctl restast network
  2. 重启网卡
  3. ip a
  4. 查看网卡

注意:

检查一下是否正常

修改内核

vi /etc/default/grub
  1. 在那里添加
  2. biosdevname=0 net.ifnames=0

刷新内核

  1. grub2-mkconfig -o /boot/grub2/grub.cfg
  2. reboot
  3. 重启

打开控制面板(Win+i 打开设置 搜索控制面板)

打开属性

连接软件SecureCRTPortable

正式搭建OpenStack云平台

点击这个上传镜像

controller节点配置:

上传centos7.0镜像和chinaskills_cloud_iaas.iso镜像

直接往右边拖动即可

上传镜像的同时可以关闭controller和compute的防火墙

  1. systemctl stop firewalld #关闭防火墙
  2. 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. setenforce 0 #临时关闭防火墙,0关闭、1开启
  6. getenforce #查看防火墙的状态
  7. Permissive
  8. vi /etc/selinux/config

要修改的如下:

然后检查一下镜像是否上传成功,完成

controller 配置

上传完成了 输入ls查看

  1. mount -o loop CentOS-7-x86_64-DVD-1804.iso /mnt/
  2. mount: /dev/loop0 写保护,将以只读方式挂载
  3. mkdir /opt/centos
  4. cp -rf /mnt/* /opt/centos/
  5. umount /mnt/
  6. mount -o loop chinaskills_cloud_iaas.iso /mnt/
  7. mount: /dev/loop0 写保护,将以只读方式挂载
  8. cp -rf /mnt/* /opt/
  9. umount /mnt/

yum源文件处理

移除原yum源

  1. cd /etc/yum.repos.d/
  2. mv * /media/
  3. ls

写yum源文件

  1. vi local.repo
  2. #全部都复制粘贴进去
  3. [centos]
  4. name=centos
  5. baseurl=file:///opt/centos
  6. gpgcheck=0
  7. enabled=1
  8. [iaas]
  9. name=iaas
  10. baseurl=file:///opt/iaas-repo
  11. gpgcheck=0
  12. enabled=1
  13. cat local.repo

清除源缓存,验证源,安装软件包

  1. yum clean all #清除源缓存
  2. 已加载插件:fastestmirror
  3. 正在清理软件源: centos iaas
  4. Cleaning up everything
  5. Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
  6. Cleaning up list of fastest mirrors
  7. yum repolist #列出所有可用的源
  8. 已加载插件:fastestmirror
  9. Determining fastest mirrors
  10. centos | 3.6 kB 00:00:00
  11. iaas | 2.9 kB 00:00:00
  12. (1/3): centos/group_gz | 166 kB 00:00:00
  13. (2/3): centos/primary_db | 3.1 MB 00:00:00
  14. (3/3): iaas/primary_db | 1.4 MB 00:00:00
  15. 源标识 源名称 状态
  16. centos centos 3,971
  17. iaas iaas 3,232
  18. repolist: 7,203
  19. yum install -y vim vsftpd iaas-xiandian #安装软件包

配置vsftpd

  1. echo anon_root=/opt/ >> /etc/vsftpd/vsftpd.conf #设置匿名访问
  2. systemctl restart vsftpd #重启ftp服务
  3. systemctl enable vsftpd #设置ftp服务开机自启
  4. Created symlink from /etc/systemd/system/multi-user.target.wants/vsftpd.service to /usr/lib/systemd/system/vsftpd.service.

修改脚本

vim /etc/xiandian/openrc.sh

注意!!!

在非插入模式下依次按下Ctrl+v——shift+g——D

  1. #--------------------system Config--------------------##
  2. #Controller Server Manager IP. example:x.x.x.x
  3. HOST_IP=192.168.100.10 #controller节点的IP地址
  4. #Controller HOST Password. example:000000
  5. HOST_PASS=000000
  6. #Controller Server hostname. example:controller
  7. HOST_NAME=controller
  8. #Compute Node Manager IP. example:x.x.x.x
  9. HOST_IP_NODE=192.168.100.20 #compute节点的IP地址
  10. #Compute HOST Password. example:000000
  11. HOST_PASS_NODE=000000
  12. #Compute Node hostname. example:compute
  13. HOST_NAME_NODE=compute
  14. #--------------------Chrony Config-------------------##
  15. #Controller network segment IP. example:x.x.0.0/16(x.x.x.0/24)
  16. network_segment_IP=192.168.100.0/24 #controller节点所在的网段
  17. #--------------------Rabbit Config ------------------##
  18. #user for rabbit. example:openstack
  19. RABBIT_USER=openstack
  20. #Password for rabbit user .example:000000
  21. RABBIT_PASS=000000
  22. #--------------------MySQL Config---------------------##
  23. #Password for MySQL root user . exmaple:000000
  24. DB_PASS=000000
  25. #--------------------Keystone Config------------------##
  26. #Password for Keystore admin user. exmaple:000000
  27. DOMAIN_NAME=demo
  28. ADMIN_PASS=000000
  29. DEMO_PASS=000000
  30. #Password for Mysql keystore user. exmaple:000000
  31. KEYSTONE_DBPASS=000000
  32. #--------------------Glance Config--------------------##
  33. #Password for Mysql glance user. exmaple:000000
  34. GLANCE_DBPASS=000000
  35. #Password for Keystore glance user. exmaple:000000
  36. GLANCE_PASS=000000
  37. #--------------------Nova Config----------------------##
  38. #Password for Mysql nova user. exmaple:000000
  39. NOVA_DBPASS=000000
  40. #Password for Keystore nova user. exmaple:000000
  41. NOVA_PASS=000000
  42. #--------------------Neturon Config-------------------##
  43. #Password for Mysql neutron user. exmaple:000000
  44. NEUTRON_DBPASS=000000
  45. #Password for Keystore neutron user. exmaple:000000
  46. NEUTRON_PASS=000000
  47. #metadata secret for neutron. exmaple:000000
  48. METADATA_SECRET=000000
  49. #Tunnel Network Interface. example:x.x.x.x
  50. INTERFACE_IP=192.168.100.10 #本机IP地址
  51. #External Network Interface. example:eth1
  52. INTERFACE_NAME=eth1
  53. #External Network The Physical Adapter. example:provider
  54. Physical_NAME=provider
  55. #First Vlan ID in VLAN RANGE for VLAN Network. exmaple:101
  56. minvlan=101
  57. #Last Vlan ID in VLAN RANGE for VLAN Network. example:200
  58. maxvlan=200
  59. #--------------------Cinder Config--------------------##
  60. #Password for Mysql cinder user. exmaple:000000
  61. CINDER_DBPASS=000000
  62. #Password for Keystore cinder user. exmaple:000000
  63. CINDER_PASS=000000
  64. #Cinder Block Disk. example:md126p3
  65. BLOCK_DISK=sdb1 #compute节点的存储块
  66. #--------------------Swift Config---------------------##
  67. #Password for Keystore swift user. exmaple:000000
  68. SWIFT_PASS=000000
  69. #The NODE Object Disk for Swift. example:md126p4.
  70. OBJECT_DISK=sdb2 #compute节点的存储块
  71. #The NODE IP for Swift Storage Network. example:x.x.x.x.
  72. STORAGE_LOCAL_NET_IP=192.168.100.20 #compute节点的IP地址
  73. #--------------------Heat Config----------------------##
  74. #Password for Mysql heat user. exmaple:000000
  75. HEAT_DBPASS=000000
  76. #Password for Keystore heat user. exmaple:000000
  77. HEAT_PASS=000000
  78. #--------------------Zun Config-----------------------##
  79. #Password for Mysql Zun user. exmaple:000000
  80. ZUN_DBPASS=000000
  81. #Password for Keystore Zun user. exmaple:000000
  82. ZUN_PASS=000000
  83. #Password for Mysql Kuryr user. exmaple:000000
  84. KURYR_DBPASS=000000
  85. #Password for Keystore Kuryr user. exmaple:000000
  86. KURYR_PASS=000000
  87. #--------------------Ceilometer Config----------------##
  88. #Password for Gnocchi ceilometer user. exmaple:000000
  89. CEILOMETER_DBPASS=000000
  90. #Password for Keystore ceilometer user. exmaple:000000
  91. CEILOMETER_PASS=000000
  92. #--------------------AODH Config----------------##
  93. #Password for Mysql AODH user. exmaple:000000
  94. AODH_DBPASS=000000
  95. #Password for Keystore AODH user. exmaple:000000
  96. AODH_PASS=000000
  97. #--------------------Barbican Config----------------##
  98. #Password for Mysql Barbican user. exmaple:000000
  99. BARBICAN_DBPASS=000000
  100. #Password for Keystore Barbican user. exmaple:000000
  101. BARBICAN_PASS=000000

compute配置

硬盘分区

  1. [root@compute ~]# fdisk /dev/sdb
  2. 欢迎使用 fdisk (util-linux 2.23.2)。
  3. 更改将停留在内存中,直到您决定将更改写入磁盘。
  4. 使用写入命令前请三思。
  5. Device does not contain a recognized partition table
  6. 使用磁盘标识符 0x34bc5373 创建新的 DOS 磁盘标签。
  7. 命令(输入 m 获取帮助):n
  8. Partition type:
  9. p primary (0 primary, 0 extended, 4 free)
  10. e extended
  11. Select (default p):
  12. Using default response p
  13. 分区号 (1-4,默认 1):
  14. 起始 扇区 (2048-209715199,默认为 2048):
  15. 将使用默认值 2048
  16. Last 扇区, +扇区 or +size{K,M,G} (2048-209715199,默认为 209715199):+25G
  17. 分区 1 已设置为 Linux 类型,大小设为 25 GiB
  18. 命令(输入 m 获取帮助):n
  19. Partition type:
  20. p primary (1 primary, 0 extended, 3 free)
  21. e extended
  22. Select (default p):
  23. Using default response p
  24. 分区号 (2-4,默认 2):
  25. 起始 扇区 (52430848-209715199,默认为 52430848):
  26. 将使用默认值 52430848
  27. Last 扇区, +扇区 or +size{K,M,G} (52430848-209715199,默认为 209715199):+25G
  28. 分区 2 已设置为 Linux 类型,大小设为 25 GiB
  29. 命令(输入 m 获取帮助):w
  30. The partition table has been altered!
  31. Calling ioctl() to re-read partition table.
  32. 正在同步磁盘。
  33. [root@compute ~]# lsblk
  34. NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
  35. sda 8:0 0 200G 0 disk
  36. ├─sda1 8:1 0 1G 0 part /boot
  37. └─sda2 8:2 0 199G 0 part
  38. ├─centos-root 253:0 0 50G 0 lvm /
  39. ├─centos-swap 253:1 0 2G 0 lvm [SWAP]
  40. └─centos-home 253:2 0 147G 0 lvm /home
  41. sdb 8:16 0 100G 0 disk
  42. ├─sdb1 8:17 0 25G 0 part
  43. └─sdb2 8:18 0 25G 0 part
  44. sr0 11:0 1 4.2G 0 rom
  45. [root@compute ~]#

源文件处理

  1. cd /etc/yum.repos.d/
  2. mv * /media/
  3. ls

写源文件

  1. vi local.repo
  2. #全部都复制粘贴进去
  3. [centos]
  4. name=centos
  5. baseurl=file:///opt/centos
  6. gpgcheck=0
  7. enabled=1
  8. [iaas]
  9. name=iaas
  10. baseurl=file:///opt/iaas-repo
  11. gpgcheck=0
  12. enabled=1
  13. cat local.repo

清除源缓存,验证源,安装软件包

  1. yum clean all #清除源缓存
  2. 已加载插件:fastestmirror
  3. 正在清理软件源: centos iaas
  4. Cleaning up everything
  5. Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
  6. Cleaning up list of fastest mirrors
  7. yum repolist #列出所有可用的源
  8. 已加载插件:fastestmirror
  9. Determining fastest mirrors
  10. centos | 3.6 kB 00:00:00
  11. iaas | 2.9 kB 00:00:00
  12. (1/3): centos/group_gz | 166 kB 00:00:00
  13. (2/3): centos/primary_db | 3.1 MB 00:00:00
  14. (3/3): iaas/primary_db | 1.4 MB 00:00:00
  15. 源标识 源名称 状态
  16. centos centos 3,971
  17. iaas iaas 3,232
  18. repolist: 7,203
  19. yum install -y vim vsftpd iaas-xiandian #安装软件包

修改脚本!!!

将controller的脚本复制至compute

  1. [root@compute ~]# scp 192.168.100.10:/etc/xiandian/openrc.sh /etc/xiandian/openrc.sh
  2. The authenticity of host '192.168.100.10 (192.168.100.10)' can't be established.
  3. ECDSA key fingerprint is SHA256:3fUEo7XuafRBPMtY2rSnpjKOdGSrLnE68O2aZAXEp6o.
  4. ECDSA key fingerprint is MD5:4b:73:20:24:30:ad:6a:31:86:fa:26:55:47:92:99:cc.
  5. Are you sure you want to continue connecting (yes/no)? yes
  6. Warning: Permanently added '192.168.100.10' (ECDSA) to the list of known hosts.
  7. root@192.168.100.10's password:
  8. openrc.sh 100% 3820 1.9MB/s 00:00

需要修改compute的脚本

vim /etc/xiandian/openrc.sh

在非插入模式 输入/INTER

查找到INTERFACE_IP=192.168.100.10

修改成INTERFACE_IP=192.168.100.20

刷脚本

刷脚本过程漫长请慢慢等待

可以controller 和 compute 两个脚本一起刷脚本

controller

  1. cd
  2. iaas-pre-host.sh
  3. reboot #重启
  4. iaas-install-mysql.sh
  5. iaas-install-keystone.sh
  6. source /etc/keystone/admin-openrc.sh
  7. iaas-install-glance.sh
  8. iaas-install-nova-controller.sh
  9. iaas-install-neutron-controller.sh
  10. iaas-install-dashboard.sh

compute

  1. cd
  2. iaas-pre-host.sh
  3. reboot #重启
  4. iaas-install-nova-compute.sh
  5. iaas-install-neutron-compute.sh

刷完脚本再打开一个浏览器并输入 : http://192.168.100.10/dashboard

连接即可


如有雷同,请联系我修改

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

闽ICP备14008679号