0%

云计算-私有云

云计算赛项第一场-私有云

云计算-私有云-基础运维任务

某企业拟使用OpenStack 搭建一个企业云平台,以实现资源池化弹性管理、企业应用集
中管理、统一安全认证和授权等管理。

设备名称 主机名 接口 IP 地址 说明
云服务器1 Controller eth0
eth1
172.129.x.0/24
自定义
Vlan x
自行创建
云服务器2 Compute eth0
eth1
172.129.x.0/24
自定义
Vlan x
自行创建
云服务器3

云服务器n
自定义 eth0 172.129.x.0/24 用于实操题
PC-1 本地连接 172.24.16.0/24 PC 使用

说明:
1.竞赛使用集群模式进行,比赛时给每个参赛队提供独立的租户与用户,各用户的资源配额相同,选手通过用户名与密码登录竞赛用私有云平台,创建云主机进行相应答题;
2.表中的x 为工位号;在进行OpenStack 搭建时的第二块网卡地址根据题意自行创建;
3.根据图表给出的信息,检查硬件连线及网络设备配置,确保网络连接正常;
4.考试所需要的账号资源、竞赛资源包与附件均会在考位信息表与设备确认单中给出;
5.竞赛过程中,为确保服务器的安全,请自行修改服务器密码;在考试系统提交信息时,请确认自己的IP 地址,用户名和密码。

基础运维任务[5 分]

【适用平台】私有云

【题目1】基础环境配置[1.5 分]

使用提供的用户名密码,登录提供的OpenStack 私有云平台,自行使用CentOS7.5 镜像创建两台云主机,控制节点 flavor 使用 4v_12G_100G 的配置,计算节点 flavor 使用4v_8G_100G_50G 的配置。第一张网卡使用提供的网络,第二张网卡使用的网络自行创(网段为10.10.X.0/24,X 为工位号)。创建完云主机后确保网络正常通信,然后按以下要求配置服务器:
(1)设置控制节点主机名为controller,设置计算节点主机名为compute;

hostnamesctl set-hostname controller

hostnamesctl set-hostname compute

(2)修改hosts 文件将IP 地址映射为主机名;

controller/compute

vi /etc/hosts

1
2
3
192.168.20.123	controller

192.168.20.110 compute

完成后提交控制节点的用户名、密码和IP 地址到答题框。
1.使用hostnamectl 命令查看主机名为controller 计0.5 分

hostnamectl

2.查看hosts 文件中有正确的主机名和IP 映射计0.5 分

cat /etc/hosts

3.控制节点正确使用两块网卡计0.5 分

cat /etc/sysconfig/network-scripts/ifcfg-enp*

【题目2】Yum 源配置[1 分]

使用提供的http 服务地址,在http 服务下,存在centos7.5 和iaas 的网络yum 源,使用该http 源作为安装iaas 平台的网络源。分别设置controller 节点和compute 节点的yum 源文件http.repo。完成后提交控制节点的用户名、密码和IP 地址到答题框。

controller/compute

mv /etc/yum.repos.d/* /tmp/

vi /etc/yum.repos.d/http.repo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[centos]

name=centos

baseurl=http://172.19.25.11/centos

gpgcheck=0

enabled=1

[iaas]

name=iaas

baseurl=http://172.19.25.11/iaas/iaas/iaas-repo

gpgcheck=0

enabled=1

1.查看/etc/yum.repos.d/http.repo 文件,有正确的baseurl 路径,计1 分

cat /etc/yum.repos.d/http.repo

清除缓存

yum clean

检验yum是否配置正确

``yum list`

【题目3】时间同步配置[1.5 分]

在controller 节点上部署chrony 服务器,允许其他节点同步时间,启动服务并设置为开机启动;在compute 节点上指定controller 节点为上游NTP 服务器,重启服务并设为开机启动。完成后提交控制节点的用户名、密码和IP 地址到答题框。

yum install -y chrony

配置controller节点

vi /etc/chrony.conf

删除默认规则(在默认规则前加上#号)

添加以下规则

1
2
3
4
5
server controller iburst

allow 192.168.20.0/24

local stratum 10

配置compute节点

vi /etc/chrony.conf

删除默认规则(在默认规则前加上#号)

添加以下规则

1
server controller iburst

启动服务并设置为开机启动

systemctl restart chronyd

systemctl enable chronyd

1.查看/etc/chrony.conf 配置文件,有正确的配置文件计1 分

cat /etc/chrony.conf

2.查看时间同步服务的状态,正常计0.5 分

systemctl status chronyd

【题目4】计算节点分区[1 分]

在compute 节点上利用空白分区划分2 个20G 分区。完成后提交计算节点的用户名、密码和IP 地址到答题框。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
[root@compute ~]# umount /dev/vdb

[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): p
Using default response p
Partition number (1-4, default 1): 1
First sector (2048-125829119, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-125829119, default 125829119): +20G
Partition 1 of type Linux and of size 20 GiB is set

Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): p
Partition number (2-4, default 2): 2
First sector (41945088-125829119, default 41945088):
Using default value 41945088
Last sector, +sectors or +size{K,M,G} (41945088-125829119, default 125829119): +20G
Partition 2 of type Linux and of size 20 GiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

1.使用lsblk 命令查看分区,有两个20G 分区计1 分,每个0.5 分

lsblk

云计算-私有云-基础运维任务结束