先电云计算更新了新的版本2.4, 这个版本PaaS的变动比较大, iaas方面也新增了一些东西, 刚刚弄明白, 来记录一下iaas的搭建
(本文中使用的是VMware workstation进行搭建, 真实的比赛环境为服务器搭建, 部分步骤的不同我会进行说明)
根据比赛文件中给定的云计算平台架构首先配置VMware的网络环境
那么根据架构, 首先设置VMware的网络
设置之后进行保存, 进行创建两个节点的操作
一共有两个物理节点, 分别为controller与compute
使用的系统为centos, 版本号为1804
*注意一点, 创建虚拟机第二步的时候, 要选择我会稍后自行选择镜像, 两个节点的硬盘大小给分到200GB-1TB就可以
可以酌情提高配置, 因为博主受限于笔记本的性能, 所以给的东西低一些
内存推荐每台机器8GB, 内核每个4核起步
添加一个网络适配器, 自带的网络适配器也要选择那个自己定义的网络适配器, 带有(host-only)字样
然后直接开机就行了, 进行系统安装
controller和compute的安装步骤
极其简单, 直接点选INSTALLATION DESTINATION
然后左上角Done就OK, 然后begin installation, 设置root密码为6个0, 点两下Done
controller的网络配置
使用root/000000进行登录
执行以下命令设置主机名
hostnamectl set-hostname controller
然后进行配置网络
vi /etc/sysconfig/network-scripts/ifcfg-ens33
vi /etc/sysconfig/network-scripts/ifcfg-ens34
将两个文件中的BOOTPROTO字段的DHCP改成static
ONBOOT的no改成yes
并在ens33最下面添加
PREFIX=24
NM_CONTROLLED=no
PREFIX=24
IPADDR=192.168.100.10
GATEWAY=192.168.100.1
ens34下添加
PREFIX=24
NM_CONTROLLED=no
IPADDR=192.168.200.10
注意这里不需要配置网关
compute主机的配置基本相同
首先进行设置主机名
hostnamectl set-hostname compute
网络配置的不同之处就是在于将ens33的IPADDR值改为192.168.100.20
ens34的IPADDR值改为192.168.200.20
两个机器的网卡配置好之后分别使用systemctl restart network.service
重启网络服务
之后就可以在xshell上进行操作了
xshell上分别连接controller与compute两个节点
两台机器分别在hosts后添加如下字段
[root@controller ~]# vi /etc/hosts
[root@controller ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.100.10 controller
192.168.100.20 compute
controller:
[root@controller ~]# cd /etc/yum.repos.d/
[root@controller yum.repos.d]# ls
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo
[root@controller yum.repos.d]# rm -rf *
[root@controller yum.repos.d]# vi local.repo
[root@controller yum.repos.d]# cat local.repo
[centos]
name=centos
gpgcheck=0
enabled=1
baseurl=file:///opt/centos
[iaas]
name=iaas
gpgcheck=0
enabled=1
baseurl=file:///opt/iaas/iaas-repo
[root@controller yum.repos.d]# setenforce 0
[root@controller yum.repos.d]# getenforce
Permissive
[root@controller yum.repos.d]# cd
[root@controller ~]# systemctl stop firewalld
[root@controller ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@controller ~]#
compute:
[root@compute ~]# vi /etc/hosts
[root@compute ~]# cd /etc/yum.repos.d/
[root@compute yum.repos.d]# ls
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo
[root@compute yum.repos.d]# rm -rf *
[root@compute yum.repos.d]# vi ftp.repo
[root@compute yum.repos.d]# cat ftp.repo
[centos]
name=centos
gpgcheck=0
enabled=1
baseurl=ftp://192.168.100.10/centos
[iaas]
name=iaas
gpgcheck=0
enabled=1
baseurl=ftp://192.168.100.10/iaas/iaas-repo
[root@compute yum.repos.d]# cd
[root@compute ~]# systemctl stop firewalld
[root@compute ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@compute ~]# setenforce 0
[root@compute ~]# getenforce
Permissive
[root@compute ~]#
将CentOS-7-x86_64-DVD-1804.iso和XianDian-IaaS-V2.4.iso上传到controller节点
然后在controller节点:
[root@controller ~]# mkdir /opt/{centos,iaas}
[root@controller ~]# ll
total 8075368
-rw-------. 1 root root 1397 Nov 9 17:08 anaconda-ks.cfg
-rw-r--r--. 1 root root 4470079488 Nov 9 17:28 CentOS-7-x86_64-DVD-1804.iso
-rw-r--r--. 1 root root 3799093248 Nov 9 17:28 chinaskills_cloud_iaas.iso
[root@controller ~]# mount -o loop CentOS-7-x86_64-DVD-1804.iso /opt/centos/
mount: /dev/loop0 is write-protected, mounting read-only
[root@controller ~]# mount -o loop chinaskills_cloud_iaas.iso /opt/iaas/
mount: /dev/loop1 is write-protected, mounting read-only
原创的版权均归本人所有,任何人或团体、机构全部转载或者部分转载、摘录,请保留本博客链接或标注来源。