当前位置: 首页 > news >正文

部署OpenStack

部署

1. 环境配置

配置主机名

使用CRT软件连接controller节点和compute节点,用户名默认为root,密码默认为000000。连接上之后,使用linux命令修改节点主机名。

[root@controller ~]# hostnamectl set-hostname controller
[root@controller ~]# hostname
controller
[root@compute ~]# hostnamectl set-hostname compute
[root@compute ~]# hostname
compute

修改完成后,使用CRT软件断开重新连接controller节点和compute节点,以生效新主机名。

配置域名解析

使用vi命令在controller节点与compute节点的/etc/hosts文件添加如下内容,添加完成后输入:wq保存文件内容退出。

[root@controller ~]# vi /etc/hosts192.168.200.12 controller
192.168.200.21 compute[root@compute ~]# vi /etc/hosts192.168.200.12 controller
192.168.200.21 compute

对应的IP地址根据申请的云主机实际IP地址填写。

配置yum环境

将OpenStack云平台部署的iso文件通过SecureCRT上传到controller节点的/root目录下。在/opt目录生成centos7-2009和iaas-train目录,将安装镜像文件内容复制到centos7-2009和iaas目录中。

[root@controller ~]# mkdir /opt/{centos7-2009,iaas}
[root@controller ~]# mount /root/CentOS-7-x86_64-DVD-2009.iso /mnt/
mount: /dev/loop0 is write-protected, mounting read-only
[root@controller ~]# cp -r /mnt/* /opt/centos7-2009/
[root@controller ~]# umount /mnt/
[root@controller ~]# mount /root/chinaskills_cloud_iaas_v2.0.iso /mnt/  
mount: /dev/loop0 is write-protected, mounting read-only
[root@controller ~]# cp -r /mnt/* /opt/iaas/
[root@controller ~]# umount /mnt/

安装源文件

配置controller节点yum安装源文件yum.repo,指向本地文件目录路径。

[root@controller ~]# mv /etc/yum.repos.d/* /media/
[root@controller ~]# cat  /etc/yum.repos.d/yum.repo
[centos]
name=centos7-2009
baseurl=file:///opt/centos7-2009
gpgcheck=0
enabled=1
[openstack]
name=openstack-train
baseurl=file:///opt/iaas/iaas-repo
gpgcheck=0
enabled=1
EOF
[root@controller ~]# yum clean all && yum repolist
…
repo id            repo name                        status
centos            centos7-2009                      4,070
openstack         openstack-train                     953
repolist: 5,023

在controller节点使用yum安装vsftpd服务,并将/opt目录下的文件共享出去。

安装vsftpd

[root@controller ~]# yum install -y vsftpd
…
Installed:vsftpd.x86_64 0:3.0.2-28.el7                                                               
Complete!
[root@controller ~]# echo "anon_root=/opt" >> /etc/vsftpd/vsftpd.conf 
[root@controller ~]# systemctl start vsftpd
[root@controller ~]# systemctl enable vsftpd

【compute】

配置compute节点yum安装源文件yum.repo,指向controller节点的共享文件目录路径。

[root@compute ~]# mv /etc/yum.repos.d/* /media/
[root@compute ~]# cat  /etc/yum.repos.d/yum.repo
[centos]	
name=centos7-2009
baseurl=ftp://controller/centos7-2009
gpgcheck=0
enabled=1
[openstack]
name=openstack-train
baseurl=ftp://controller/iaas/iaas-repo
gpgcheck=0
enabled=1
EOF
[root@compute ~]# yum clean all && yum repolist
…
repo id            repo name                        status
centos            centos7-2009                      4,070
openstack         openstack-train                     953
repolist: 5,023

划分分区

在compute节点上的临时磁盘vdb中划分两个20G的分区。

[root@compute ~]# lsblk 
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
vda    253:0    0  100G  0 disk 
└─vda1 253:1    0  100G  0 part /
vdb    253:16   0   50G  0 disk /mnt
[root@compute ~]# umount /mnt/
[root@compute ~]# fdisk /dev/vdb
Welcome to fdisk (util-linux 2.23.2).Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.Command (m for help): n
Partition type:p   primary (0 primary, 0 extended, 4 free)e   extended
Select (default p): 
Using default response p
Partition number (1-4, default 1): 
First sector (2048-104857599, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-104857599, default 104857599): +20G
Partition 1 of type Linux and of size 20 GiB is setCommand (m for help): n
Partition type:p   primary (1 primary, 0 extended, 3 free)e   extended
Select (default p): 
Using default response p
Partition number (2-4, default 2): 
First sector (41945088-104857599, default 41945088): 
Using default value 41945088
Last sector, +sectors or +size{K,M,G} (41945088-104857599, default 104857599): +20G
Partition 2 of type Linux and of size 20 GiB is setCommand (m for help): wq
The partition table has been altered!Calling ioctl() to re-read partition table.
Syncing disks.
[root@compute ~]# lsblk 
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
vda    253:0    0  100G  0 disk 
└─vda1 253:1    0  100G  0 part /
vdb    253:16   0   50G  0 disk 
├─vdb1 253:17   0   20G  0 part 
└─vdb2 253:18   0   20G  0 partOpenStack云平台部署

安装OpenStack

完成基础环境部署后,就可以开始部署安装OpenStack云平台。

yum -y install iaas-xiandian

编辑文件

vi /etc/xiandian/openrc.sh

将文件openrc.sh更改IP地址后直接导入

将配置文件拷贝到计算节点

scp /etc/xiandian/openrc.sh compute:/etc/xiandian/openrc.sh

开始部署

iaas-install-mysql.sh

iaas-install-keystone.sh

iaas-install-glance.sh

iaas-install-nova-controller.sh

iaas-install-neutron-controller.sh

iaas-install-dashboard.sh

iaas-install-cinder-controller.sh

iaas-install-swift-controller.sh

在计算节点进行部署

iaas-pre-host.sh

iaas-install-nova-compute.sh

iaas-install-neutron-compute.sh

iaas-install-cinder-compute.sh

iaas-install-swift-compute.sh

http://www.lryc.cn/news/27233.html

相关文章:

  • Java 运算符与类型转化
  • 《C++ Primer Plus》第18章:探讨 C++ 新标准(2)
  • QML定时器
  • 第三章 opengl之纹理
  • 【Flink】FlinkSQL中执行计划以及如何用代码看执行计划
  • 从业者必读,一篇文章轻松掌握DevOps核心概念和最佳技能实践!
  • 2023爱分析·一体化HR SaaS市场厂商评估报告:北森
  • JAVA练习67-二叉树的中序遍历
  • 【JeecgBoot-Vue3】第1节 源码下载和环境安装与启动
  • WebAPI
  • Shell命令——date的用法
  • XSS跨站脚本
  • 【强烈建议收藏:MySQL面试必问系列之慢SQL优化专题】
  • windows,liunx,java实现apk解压,去签名、重新签名,重新打包apk
  • 【Linux】进程信号
  • SpringBoot 集成Junit单元测试
  • Android开发之简单控件
  • 树状数组讲解
  • 每个Android开发都应需知的性能指标~
  • MSYS2安装
  • 3/3考试总结
  • Spark Streaming DStream转换
  • 水果商城,可运行
  • LiveGBS国标GB/T28181国标视频流媒体平台-功能报警订阅配置报警预案告警截图及录像
  • 软件测试---测试分类
  • 剑指 Offer II 015. 字符串中的所有变位词
  • 【SpringCloud】SpringCloud详细教程之微服务比较
  • 二.项目使用vue-router,引入ant-design-vue的UI框架,引入less
  • 网络安全怎么学?20年白帽子老江湖告诉你
  • 药房管理系统;药库管理系统