网络管理(70.0分)
1. 在eNSP中使用S5700交换机进行配置,通过一条命令划分vlan 2、vlan 3、vlan 1004,通过端口组的方式配置端口1-5为access模式,并添加至vlan2中。配置端口10为trunk模式,并放行vlan3。创建三层vlan 2,配置IP地址为:172.16.2.1/24,创建三层vlan1004,配置IP地址为:192.168.4.2/30。通过命令添加默认路由,下一跳为192.168.4.1。(使用完整命令)
参考答案:
[Huawei]vlan batch 2 3 1004
[Huawei]port-group 1
[Huawei-port-group-1]group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/5
[Huawei-port-group-1]port link-type access
[Huawei-port-group-1]port default vlan 2
[Huawei]interface GigabitEthernet 0/0/10
[Huawei-GigabitEthernet0/0/10]port link-type trunk
[Huawei-GigabitEthernet0/0/10]port trunk allow-pass vlan 3
[Huawei]interface Vlanif 2
[Huawei-Vlanif2]ip address 172.16.2.1 24
[Huawei]interface Vlanif 1004
[Huawei-Vlanif1004]ip address 192.168.4.2 30
[Huawei]ip route-static 0.0.0.0 0 192.168.4.1
网络管理(20分)
2. 通过一条命令在S1交换机(交换机使用S5700)上创建vlan100、vlan101,配置vlan100网关为:172.16.100.254/24。配置vlan101网关为:172.16.101.254/24。配置g0/0/1端口为trunk模式,放行vlan100。配置g0/0/2端口为access模式,所属vlan101。将以上所有操作命令和返回结果以文本形式提交大答题框。
参考答案:
[SW1]vlan batch 100 101
[SW1]interface Vlanif 100
[SW1-Vlanif100]ip address 172.16.100.254 24
[SW1]interface Vlanif 101
[SW1-Vlanif101]ip address 172.16.101.254 24
[SW1]interface GigabitEthernet 0/0/1
[SW1-GigabitEthernet0/0/1]port link-type trunk
[SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan 100
[SW1-GigabitEthernet0/0/1]quit
[SW1]interface GigabitEthernet 0/0/2
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-GigabitEthernet0/0/2]port default vlan 101
[SW1-GigabitEthernet0/0/2]quit
网络管理(30分)
3. 配置路由器R1(路由器使用AR2220)端口g0/0/1地址为192.168.101.1/30,配置g0/0/2端口地址为12.12.12.2/30。添加静态路由去往192.168.1.0/24网段,下一跳地址为192.168.101.2,添加静态路由去往192.168.2.0/24,下一跳地址为12.12.12.1。将以上所有操作命令和返回结果以文本形式提交到答题框。
参考答案:
[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.101.1 30
[R1-GigabitEthernet0/0/1]quit
[R1]interface GigabitEthernet 0/0/2
[R1-GigabitEthernet0/0/2]ip address 12.12.12.2
[R1-GigabitEthernet0/0/2]quit
[R1]ip route-static 192.168.1.0 24 192.168.101.2
[R1]ip route-static 192.168.2.0 24 12.12.12.1
yum源管理(60.0分)
1.当前有一个CentOS-7-x86_64-DVD-1511.iso的镜像文件,使用这个文件配置yum源,要求将这个镜像文件挂载在/opt/centos目录,请问如何配置自己的local.repo文件,使得可以使用该镜像中的软件包,安装软件。请将local.repo文件的内容以文本形式提交到答题框。
参考答案:
[centos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enabled=1
yum源管理(40分)
2. 当前有一个/opt目录,该目录中的文件如下所示: ├── ambari-2.6.0.0 │ ├── ambari │ ├── repodata │ └── smartsense ├── base │ ├── packages │ └── repodata 请问如何配置自己的local.repo文件,使得可以使用这两个地方的软件包,安装软件。请将local.repo文件的内容以文本形式提交到答题框。
参考答案:
[centos]
name=centos
baseurl=file:///opt/ambari-2.6.0.0
gpgcheck=0
enabled=1
[iaas]
name=iaas
baseurl=file:///opt/base
gpgcheck=0
enabled=1
yum源管理(60分)
3.当前有一个centos7.2-1511.iso的镜像文件,使用这个文件配置yum源,要求将这个镜像文件挂载在/opt/cenos目录。还存在一个ftp源,IP地址为192.168.100.200,ftp共享的目录为/opt,/opt目录中存在一个iaas目录(该目录下存在一个repodata目录)请问如何配置自己的local.repo文件,使得可以使用这两个地方的软件包,安装文件。请将local.repo文件的内容以文本形式提交到答题框。
[centos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enabled=1
[iaas]
name=iaas
baseurl=ftp://192.168.100.200/iaas
gpgcheck=0
enabled=1
本地YUM源管理(20分)
4. 使用VMWare软件启动提供的xserver1虚拟机(配置虚拟机xserver1的IP为192.168.100.11,主机名为xserver1),在虚拟机的/root目录下,存在一个CentOS-7-x86_64-DVD-1511.iso的镜像文件,使用这个镜像文件配置本地yum源,要求将这个镜像文件挂载在/opt/centos目录,请问如何配置自己的local.repo文件,使得可以使用该镜像中的软件包,安装软件。请将local.repo文件的内容以文本形式提交到答题框。
参考答案:
[centos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enabled=1
yum源管理(30分)
5. 当前存在一个ftp源,IP地址为192.168.100.200,ftp共享的目录为/opt,/opt目录中存在一个iaas目录(该目录下存在一个repodata目录)请问如何配置自己的ftp.repo文件,使得可以使用这两个地方的软件包,安装软件。请将ftp.repo文件的内容以文本形式提交到答题框。
参考答案:
[iaas]
name=iaas
baseurl=ftp://192.168.100.200/iaas
gpgcheck=0
enabled=1
数据库管理(60分)
1. 使用提供的“all-in-one”虚拟机,进入数据库。 (1)创建本地用户examuser,密码为000000; (2)查询mysql数据库中的user表的host,user,password字段; (3)赋予这个用户对所有数据库拥有“查询”“删除”“更新”“创建”的本地权限。依次将操作命令和返回结果以文本形式提交到答题框。
参考答案:
[MariaDB [(none)]> insert into mysql.user(host,user,Password) values("localhost","examuser",Password("000000"));
Query OK, 1 row affected, 4 warnings (0.00 sec)
MariaDB [(none)]> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [mysql]> select host,user,password from user;
+-----------+----------+-------------------------------------------+
| host | user | password |
+-----------+----------+-------------------------------------------+
| localhost | root | *032197AE5731D4664921A6CCAC7CFCE6A0698693 |
| xiandian | root | *032197AE5731D4664921A6CCAC7CFCE6A0698693 |
| 127.0.0.1 | root | *032197AE5731D4664921A6CCAC7CFCE6A0698693 |
| ::1 | root | *032197AE5731D4664921A6CCAC7CFCE6A0698693 |
| localhost | keystone | *032197AE5731D4664921A6CCAC7CFCE6A0698693 |
| % | keystone | *032197AE5731D4664921A6CCAC7CFCE6A0698693 |
| localhost | glance | *032197AE5731D4664921A6CCAC7CFCE6A0698693 |
| % | glance | *032197AE5731D4664921A6CCAC7CFCE6A0698693 |
| localhost | nova | *032197AE5731D4664921A6CCAC7CFCE6A0698693 |
| % | nova | *032197AE5731D4664921A6CCAC7CFCE6A0698693 |
| localhost | neutron | *032197AE5731D4664921A6CCAC7CFCE6A0698693 |
| % | neutron | *032197AE5731D4664921A6CCAC7CFCE6A0698693 |
| localhost | cinder | *032197AE5731D4664921A6CCAC7CFCE6A0698693 |
| % | cinder | *032197AE5731D4664921A6CCAC7CFCE6A0698693 |
| localhost | heat | *032197AE5731D4664921A6CCAC7CFCE6A0698693 |
| % | heat | *032197AE5731D4664921A6CCAC7CFCE6A0698693 |
| localhost | aodh | *032197AE5731D4664921A6CCAC7CFCE6A0698693 |
| % | aodh | *032197AE5731D4664921A6CCAC7CFCE6A0698693 |
| localhost | examuser | *032197AE5731D4664921A6CCAC7CFCE6A0698693 |
+-----------+----------+-------------------------------------------+
19 rows in set (0.00 sec)
MariaDB [mysql]> grant select,delete,update,create on *.* to examuser@"localhost" identified by "000000";
Query OK, 0 rows affected (0.01 sec)
数据库管理(70.0分)
2. 使用VMWare创建两台centos7系统的虚拟机,安装数据库服务,并将两台数据库配置为主从数据库模式(master和slave)。配置完成后,在从节点,执行show status slave\G查看从节点的复制状态。将查看从节点服务状态的返回结果以文本形式提交到答题框。(数据库用户名root,密码000000;关于数据库的命令均使用小写)
参考答案:
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.172.61
Master_User: root
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000145
Read_Master_Log_Pos: 391789243
Relay_Log_File: Report-relay-bin.000228
Relay_Log_Pos: 480230500
Relay_Master_Log_File: mysql-bin.000144
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB: dbXXX
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 1205
Last_Error: Slave SQL thread retried transaction 10 time(s) i n vain, giving up. Consider raising the value of the slave_transaction_retries v ariable.
Skip_Counter: 0
Exec_Master_Log_Pos: 480230337
Relay_Log_Space: 1784477152
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 1205
Last_SQL_Error: Slave SQL thread retried transaction 10 time(s) i n vain, giving up. Consider raising the value of the slave_transaction_retries v ariable.
Replicate_Ignore_Server_Ids:
Master_Server_Id: 1
Master_UUID: 07b51a82-dcd0-11e4-a812-00163e020999
Master_Info_File: /mnt/erp/programdata/data/master.info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State:
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp:
Last_SQL_Error_Timestamp: 150815 01:42:34
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set:
Executed_Gtid_Set:
Auto_Position: 0
1 row in set (0.00 sec)
主从数据库管理(40分)
1. 在xserver1、xserver2上安装mariadb数据库,并配置为主从数据库(xserver1为主节点、xserver2为从节点),实现两个数据库的主从同步。配置完毕后,请在xserver2上的数据库中执行“show slave status \G”命令查询从节点复制状态,将查询到的结果以文本形式提交到答题框。
参考答案:
MariaDB [(none)]> start slave;
MariaDB [(none)]> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: mysql1
Master_User: user
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000003
Read_Master_Log_Pos: 245
Relay_Log_File: mariadb-relay-bin.000005
Relay_Log_Pos: 529
Relay_Master_Log_File: mysql-bin.000003
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 245
Relay_Log_Space: 1256
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 30
1 row in set (0.00 sec)
MariaDB管理(70.0分)
1.使用VMware软件和提供的CentOS-7-x86_64-DVD-1511.iso创建虚拟机,自行配置好网络和YUM源,安装mariadb数据库,安装完毕后登录数据库,查询当前系统的时间和用户。依次将操作命令和返回结果以文本形式提交到答题框。(数据库用户名root,密码000000;关于数据库的命令均使用小写)
参考答案:
[MariaDB [(none)]> select sysdate();
+---------------------+
| sysdate() |
+---------------------+
| 2018-01-17 09:28:07 |
+---------------------+
1 row in set (0.00 sec)
MariaDB [(none)]> select user();
+----------------+
| user() |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.01 sec)
Linux存储LVM管理(30分)
1.使用xserver1虚拟机,使用VMWare软件自行添加一块大小为20G的硬盘,使用fdisk命令对该硬盘进形分区,要求分出两个大小为5G的分区。使用两个分区,创建名xcloudvg的卷组并指定PE大小为16 MB。将执行vgdisplay命令的返回结果以文本形式提交到答题框。
参考答案:
[root@localhost ~]# vgdisplay
--- Volume group ---
VG Name centos
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 19.51 GiB
PE Size 4.00 MiB
Total PE 4994
Alloc PE / Size 4984 / 19.47 GiB
Free PE / Size 10 / 40.00 MiB
VG UUID 2H21hv-L20X-mqhJ-SvzR-crT2-ln9v-jj2gTY
--- Volume group ---
VG Name xcloudvg
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size 9.97 GiB
PE Size 16.00 MiB
Total PE 638
Alloc PE / Size 0 / 0
Free PE / Size 638 / 9.97 GiB
VG UUID dU0pP2-EW9d-6c0h-8tgQ-t1bN-tBIo-FDqfdR
Linux存储LVM管理(80.0分)
2. 使用VMware软件和提供的CentOS-7-x86_64-DVD-1511.iso创建虚拟机,自行配置好网络并多添加一块大小为20G的硬盘,使用fdisk命令对该硬盘进形分区,要求分出三个大小为5G的分区。使用这三个分区,创建名xcloudvg的卷组。然后创建名xcloudlv的逻辑卷,大小为12G,最后用xfs文件系统对逻辑卷进行格式化并挂载到/mnt目录下。将上述所有操作命令和返回结果以文本形式提交到答题框。
参考答案:
[root@localhost ~]# pvcreate /dev/vdb1 /dev/vdb2 /dev/vdb3
Physical volume "/dev/vdb1" successfully created
Physical volume "/dev/vdb2" successfully created
Physical volume "/dev/vdb2" successfully created
[root@localhost ~]# vgcreate xcloudvg /dev/vdb[1-3]
Volume group "xcloudvg" successfully created
[root@localhost ~]# lvcreate -L +12G –n xcloudvg xcloudlv
Logical volume "xcloudlv" created.
[root@localhost ~]# mkfs.xfs /dev/mapper/xcloudvg-xcloudlv
[root@localhost ~]# mount /dev/mapper/ xcloudvg-xcloudlv /mnt/
Linux存储LVM管理(50分)
3. 使用提供的“all-in-one”虚拟机,该虚拟机存在一块大小为20G的磁盘/dev/vdb,使用fdisk命令对该硬盘进形分区,要求分出三个大小为5G的分区。使用这三个分区,创建名xcloudvg的卷组。然后创建名xcloudlv的逻辑卷,大小为12G,最后用xfs文件系统对逻辑卷进行格式化并挂载到/mnt目录下。将上述所有操作命令和返回结果以文本形式提交到答题框。
参考答案:
[root@localhost ~]# pvcreate /dev/vdb1 /dev/vdb2 /dev/vdb3
Physical volume "/dev/vdb1" successfully created
Physical volume "/dev/vdb2" successfully created
Physical volume "/dev/vdb2" successfully created
[root@localhost ~]# vgcreate xcloudvg /dev/vdb[1-3]
Volume group "xcloudvg" successfully created
[root@localhost ~]# lvcreate -L +12G –n xcloudvg xcloudlv
Logical volume "xcloudlv" created.
[root@localhost ~]# mkfs.xfs /dev/mapper/xcloudvg-xcloudlv
[root@localhost ~]# mount /dev/mapper/ xcloudvg-xcloudlv /mnt/
Keystone管理(60分)
1. 使用提供的“all-in-one”虚拟机,创建用户testuser,密码为xiandian,将testuser用户分配给admin项目,赋予用户admin的权限。依次将操作命令和查询结果以文本形式提交到答题框。
参考答案:
[root@xiandian~]# source /etc/keystone/admin-openrc.sh
[root@xiandian~]# openstack user create --domain demo --password xiandian testuser
+-----------+----------------------------------+
| Field | Value |
+-----------+----------------------------------+
| domain_id | 5a486c51bc8e4dffa4a181f6c54e0938 |
| enabled | True |
| id | ec6d67cdb3ac4b3ca827587c14be0a3e |
| name | testuser |
+-----------+----------------------------------+
[root@xiandian ~]# openstack role add --project admin --user testuser admin
OpenStack Cinder管理(40分)
1. 使用VMWare软件启动提供的opensatckallinone镜像,自行检查openstack中各服务的状态,若有问题自行排查。使用Cinder服务,创建名为“ lvm”的卷类型,然后创建一块带“lvm” 标识的云硬盘,名称为 BlockVloume,大小为 2G,查询该云硬盘详细信息。完成后,将cinder show BlockVloume命令的返回结果以文本形式提交到答题框。
参考答案:
[root@xiandian ~]# cinder show BlockVloume
+--------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2018-01-18T05:04:06.000000 |
| description | None |
| encrypted | False |
| id | 9f685fd4-4f33-4f0c-b70e-467dab381c24 |
| metadata | {} |
| migration_status | None |
| multiattach | False |
| name | BlockVloume |
| os-vol-host-attr:host | xiandian@lvm#LVM |
| os-vol-mig-status-attr:migstat | None |
| os-vol-mig-status-attr:name_id | None |
| os-vol-tenant-attr:tenant_id | 0ab2dbde4f754b699e22461426cd0774 |
| replication_status | disabled |
| size | 2 |
| snapshot_id | None |
| source_volid | None |
| status | available |
| updated_at | 2018-01-18T05:04:10.000000 |
| user_id | 53a1cf0ad2924532aa4b7b0750dec282 |
| volume_type | lvm |
+--------------------------------+--------------------------------------+
OpenStack Glance管理(40分)
2. 使用VMWare软件启动提供的opensatckallinone镜像,自行检查openstack中各服务的状态,若有问题自行排查。在xserver1节点的/root目录下存在一个cirros-0.3.4-x86_64-disk.img镜像;使用glance命令将镜像上传,并命名为mycirros,最后将glance image-show id命令的返回结果以文本形式提交到答题框。
参考答案:
[root@xiandian ~]# glance image-show d3663be2-3ebf-443a-b3fc-b3e39bda8783
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | ee1eca47dc88f4879d8a229cc70a07c6 |
| container_format | bare |
| created_at | 2019-10-24T10:16:52Z |
| disk_format | qcow2 |
| id | d3663be2-3ebf-443a-b3fc-b3e39bda8783 |
| min_disk | 0 |
| min_ram | 0 |
| name | mycirros |
| owner | 0ab2dbde4f754b699e22461426cd0774 |
| protected | False |
| size | 13287936 |
| status | active |
| tags | [] |
| updated_at | 2019-10-24T10:16:52Z |
| virtual_size | None |
| visibility | private |
+------------------+--------------------------------------+
OpenStack管理(80分)
3.使用VMWare创建两台CentOS7.2的操作系统,自行配置网络与IP,使用提供的软件包,安装OpenStack平台。完成安装后,使用curl命令查询http://192.168.100.10/dashboard/auth/login/。将curl命令的查询结果以文本形式提交到答题框。
[root@controller -]# curl http://192.168.100.10/dashboard/auth/login/
Login - XianDian Dashboard
云计算基础架构服务平台
OpenStack Neutron管理(40分)
4. 使用VMWare软件启动提供的opensatckallinone镜像,自行检查openstack中各服务的状态,若有问题自行排查。在dashboard界面创建云主机外部网络ext-net,子网为ext-subnet,云主机浮动IP可用网段为192.168.200.100 ~ 192.168.200.200,网关为192.168.200.1。创建云主机内部网络int-net1,子网为int-subnet1,云主机子网IP可用网段为10.0.0.100 ~ 10.0.0.200,网关为10.0.0.1。添加名为ext-router的路由器,添加网关在ext-net网络,添加内部端口到int-net1网络,完成内部网络int-net1和外部网络的连通。将执行neutron router-show ext-router命令所返回的结果以文本形式提交到答题框。
参考答案:
[root@controller ~]# neutron router-show 9d0e62e4-6340-4686-8d99-3fc715166302
+-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| admin_state_up | True |
| availability_zone_hints | |
| availability_zones | nova |
| description | |
| distributed | False |
| external_gateway_info | {"network_id": "49af02fe-8496-4337-9817-eee1a72feef0", "enable_snat": true, "external_fixed_ips": [{"subnet_id": "1e097cb7-9630-418d-bfd1-57e80354b39a", |
| | "ip_address": "192.168.200.3"}]} |
| ha | False |
| id | 9d0e62e4-6340-4686-8d99-3fc715166302 |
| name | ext-router |
| routes | |
| status | ACTIVE |
| tenant_id | 38e4fd41edaf40189d152dda18935b97 |
+-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
glance管理(60.0分)
1. 登录OpenStack的controller节点,使用crt的传输工具将提供的cirros-0.3.4-x86_64-disk.img镜像上传至“iaas-all”节点的/root目录下;使用glance命令将镜像上传,并命名为mycirros,最后使用glance命令查看该镜像的详细信息。将上述所有操作命令和返回结果以文本形式提交到答题框。
参考答案:
[root@xiandian ~]# source /etc/keystone/admin-openrc.sh
[root@xiandian ~]# glance image-create --name mycirros --disk-format qcow2 --container-format bare --progress < cirros-0.3.4-x86_64-disk.img
[=============================>] 100%
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | ee1eca47dc88f4879d8a229cc70a07c6 |
| container_format | bare |
| created_at | 2019-10-24T10:16:52Z |
| disk_format | qcow2 |
| id | d3663be2-3ebf-443a-b3fc-b3e39bda8783 |
| min_disk | 0 |
| min_ram | 0 |
| name | mycirros |
| owner | 0ab2dbde4f754b699e22461426cd0774 |
| protected | False |
| size | 13287936 |
| status | active |
| tags | [] |
| updated_at | 2019-10-24T10:16:52Z |
| virtual_size | None |
| visibility | private |
+------------------+--------------------------------------+
[root@xiandian ~]# glance image-show d3663be2-3ebf-443a-b3fc-b3e39bda8783
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | ee1eca47dc88f4879d8a229cc70a07c6 |
| container_format | bare |
| created_at | 2019-10-24T10:16:52Z |
| disk_format | qcow2 |
| id | d3663be2-3ebf-443a-b3fc-b3e39bda8783 |
| min_disk | 0 |
| min_ram | 0 |
| name | mycirros |
| owner | 0ab2dbde4f754b699e22461426cd0774 |
| protected | False |
| size | 13287936 |
| status | active |
| tags | [] |
| updated_at | 2019-10-24T10:16:52Z |
| virtual_size | None |
| visibility | private |
+------------------+--------------------------------------+
Nova管理(60分)
1. 使用提供的“all-in-one”虚拟机,通过nova的相关命令创建名为exam,ID为1234,内存为1024M,硬盘为20G,虚拟内核数量为2的云主机类型,查看exam的详细信息。依次将操作命令及返回结果以文本形式提交到答题框。
参考答案:
[root@xiandian ~]# nova flavor-create exam 1234 1024 20 2
+------+------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+------+------+-----------+------+-----------+------+-------+-------------+-----------+
| 1234 | exam | 1024 | 20 | 0 | | 2 | 1.0 | True |
+------+------+-----------+------+-----------+------+-------+-------------+-----------+
[root@xiandian ~]# nova flavor-show 1234
+----------------------------+-------+
| Property | Value |
+----------------------------+-------+
| OS-FLV-DISABLED:disabled | False |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| disk | 20 |
| extra_specs | {} |
| id | 1234 |
| name | exam |
| os-flavor-access:is_public | True |
| ram | 1024 |
| rxtx_factor | 1.0 |
| swap | |
| vcpus | 2 |
+----------------------------+-------+
Docker管理(80分)
1.假设当前存在docker镜像mysql:latest,将该镜像上传至本地,然后将该镜像推送至本地仓库(假设仓库地址为192.168.100.100:5000),从私有仓库中拉取mariadb:v10.3.18镜像。运行msyql镜像,要求将内部3306端口映射到外部的13306端口,提供交互接口,后台运行,容器名为xmysql。最后将mysql镜像和创建的容器删除。依次提交操作命令。
# docker load -i < mysql:latest
# docker push 192.168.100.100:5000/mysql:latest
# docker pull mariadb:v10.3.18
# docker run -name xmysql -itd -p 13306:3306 mysql:latest /bin/bash
# docker rmi mysql:latest
# docker rm -f xmysql
Docker管理(60分)
2. 假设当前存在docker镜像tomcat:latest,现在将tomcat镜像导出,导出名称为tomcat_images.tar,放在/media目录下,将以上操作命令填入答题框。
参考答案:
[root@server images]# docker save tomcat:latest > /media/tomcat_images.tar
Docker安装(30分)
1. 使用xserver1节点,自行配置YUM源,安装docker服务(需要用到的包为xserver1节点/root目录下的Docker.tar.gz)。安装完服务后,将registry_latest.tar上传到xserver1节点中并配置为私有仓库。要求启动registry容器时,将内部保存文件的目录映射到外部的/opt/registry目录,将内部的5000端口映射到外部5000端口。依次将启动registry容器的命令及返回结果、执行docker info命令的返回结果以文本形式提交到答题框。
参考答案:
[root@master ~]# docker run -d -v /opt/registry:/var/lib/registry -p 5000:5000 --restart=always --name registry registry:latest
Containers: 33
Running: 16
Paused: 0
Stopped: 17
Images: 22
Server Version: 18.09.6
Storage Driver: devicemapper
Pool Name: docker-253:0-113162281-pool
Pool Blocksize: 65.54kB
Base Device Size: 10.74GB
Backing Filesystem: xfs
Udev Sync Supported: true
Data file: /dev/loop0
Metadata file: /dev/loop1
Data loop file: /var/lib/docker/devicemapper/devicemapper/data
Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
Data Space Used: 3.573GB
Data Space Total: 107.4GB
Data Space Available: 18.72GB
Metadata Space Used: 22.59MB
Metadata Space Total: 2.147GB
Metadata Space Available: 2.125GB
Thin Pool Minimum Free Space: 10.74GB
Deferred Removal Enabled: true
Deferred Deletion Enabled: true
Deferred Deleted Device Count: 0
Library Version: 1.02.158-RHEL7 (2019-05-13)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 3.10.0-1062.7.1.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.913GiB
Name: master
ID: U4ME:YWV6:WZEK:7R7W:5OLN:MO4A:NVNH:AEPR:L7GE:UD4S:UZOY:GZXQ
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
192.168.70.10:5000
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
WARNING: the devicemapper storage-driver is deprecated, and will be removed in a future release.
WARNING: devicemapper: usage of loopback devices is strongly discouraged for production use.
Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.
Docker运维(30分)
1.使用xserver1节点,上传nginx_latest.tar到xserver1节点中,然后将该镜像打标签,上传至私有仓库。使用xserver2节点,自行安装docker服务,配置xserver2节点使用xserver1的私有仓库,配置完毕后,在xserver2节点拉取nginx_latest.tar镜像。最后将在xserver2上执行docker images命令返回的结果以文本形式提交到答题框。
参考答案:
[root@master ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
192.168.100.11:5000/nginx latest 94f6bc30fd27 4 seconds ago 126MB
部署Swarm集群(60分)
1. 使用xserver1、xserver2节点,自行配置好网络,安装好docker-ce。部署Swarm集群,并安装Portainer图形化管理工具,部署完成后,使用浏览器登录ip:9000界面,进入Swarm控制台。将curl swarm ip:9000返回的结果以文本形式提交到答题框。
参考答案:
[root@master ~]# curl 192.168.100.10:9000
<!DOCTYPE html><html lang="en" ng-app="portainer">
<head>
<meta charset="utf-8">
<title>Portainer</title>
<meta name="description" content="">
<meta name="author" content="Portainer.io">
<div class="row" style="text-align: center">
Loading Portainer...
<i class="fa fa-cog fa-spin" style="margin-left: 5px"></i>
</div>
<!-- !panel -->
</div>
Samba管理(30分)
1. 使用xserver1虚拟机,安装Samba服务所需要的软件包,将xserver1节点中的/opt/share目录使用Samba服务共享出来(目录不存在请自行创建)。操作完毕后,将xserver1节点Samba配置文件中的[share]段落和执行netstat -ntpl命令的返回结果以文本形式提交到答题框。
参考答案:
[share]
path = /opt/share
browseable = yes
public = yes
writable = yes
[root@samba ~]# netstat -ntpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 2718/smbd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1469/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2168/master
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 2718/smbd
tcp6 0 0 :::139 :::* LISTEN 2718/smbd
tcp6 0 0 :::22 :::* LISTEN 1469/sshd
tcp6 0 0 ::1:25 :::* LISTEN 2168/master
tcp6 0 0 :::445 :::* LISTEN 2718/smbd
FTP安装使用(20分)
1. 使用xserver1虚拟机,安装ftp服务,并配置ftp的共享目录为/opt。使用VMWare软件继续启动提供的xserver2虚拟机(配置虚拟机xserver2的IP为192.168.100.12,主机名为xserver2),并创建该虚拟机的yum源文件ftp.repo使用xserver1的ftp源(配置文件中的FTP地址使用主机名)。配置完成后,将xserver2节点的ftp.repo文件以文本形式提交到答题框。
参考答案:
[centos]
name=centos
baseurl=ftp://xserver1/centos
gpgcheck=0
enabled=1
部署WordPress应用(30分)
1. 使用xserver1节点,基于lnmp环境,部署WordPress应用(WordPress源码包在/root目录下)。应用部署完毕后,设置WordPress的站点标题为自己的姓名(例:名字叫张三,则设置站点标题为张三的BLOG),设置完毕后登录WordPresss首页。最后将命令curl ip(ip为wordpress的首页ip)的返回结果以文本形式提交到答题框。
参考答案:
[root@localhost ~]# curl 192.168.100.10
<!DOCTYPE html>
<title>张三 – 又一个WordPress站点</title>
<p>欢迎使用WordPress。这是您的第一篇文章。编辑或删除它,然后开始写作吧!</p>
LNMP环境部署(40分)
1. 使用xserver1节点,安装单节点lnmp环境。安装lnmp环境需要用到的YUM源为CentOS-7-x86_64-DVD-1511.iso和lnmp目录(均在/root目录下)。安装并配置完lnmp环境后。依次查询数据库、nginx、php服务的状态,并使用netstat -ntpl命令查看端口开放情况。最后依次将查询服务状态的返回结果,和查看端口开放情况的返回结果以文本形式提交到答题框。
参考答案:
[root@localhost ~]# systemctl status mariadb
● mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
Active: active (running) since Fri 2019-12-06 12:29:37 EST; 56s ago
Process: 2741 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
Process: 2713 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
Main PID: 2740 (mysqld_safe)
CGroup: /system.slice/mariadb.service
├─2740 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
└─2897 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariadb/ma...
Dec 06 12:29:34 localhost.localdomain systemd[1]: Starting MariaDB database server...
Dec 06 12:29:34 localhost.localdomain mysqld_safe[2740]: 191206 12:29:34 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
Dec 06 12:29:34 localhost.localdomain mysqld_safe[2740]: 191206 12:29:34 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Dec 06 12:29:37 localhost.localdomain systemd[1]: Started MariaDB database server.
[root@localhost ~]# systemctl status nginx
● nginx.service - nginx - high performance web server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
Active: active (running) since Fri 2019-12-06 12:29:54 EST; 46s ago
Docs: http://nginx.org/en/docs/
Process: 2945 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=0/SUCCESS)
Main PID: 2946 (nginx)
CGroup: /system.slice/nginx.service
├─2946 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
└─2947 nginx: worker process
Dec 06 12:29:54 localhost.localdomain systemd[1]: Starting nginx - high performance web server...
Dec 06 12:29:54 localhost.localdomain systemd[1]: PID file /var/run/nginx.pid not readable (yet?) after start.
Dec 06 12:29:54 localhost.localdomain systemd[1]: Started nginx - high performance web server.
[root@localhost ~]# systemctl status php-fpm
● php-fpm.service - The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; vendor preset: disabled)
Active: active (running) since Fri 2019-12-06 12:30:00 EST; 59s ago
Main PID: 2953 (php-fpm)
Status: "Processes active: 0, idle: 5, Requests: 0, slow: 0, Traffic: 0req/sec"
CGroup: /system.slice/php-fpm.service
├─2953 php-fpm: master process (/etc/php-fpm.conf)
├─2955 php-fpm: pool www
├─2956 php-fpm: pool www
├─2957 php-fpm: pool www
├─2958 php-fpm: pool www
└─2959 php-fpm: pool www
Dec 06 12:29:59 localhost.localdomain systemd[1]: Starting The PHP FastCGI Process Manager...
Dec 06 12:30:00 localhost.localdomain systemd[1]: Started The PHP FastCGI Process Manager.
[root@localhost ~]# netstat -ntpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 2953/php-fpm: maste
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2897/mysqld
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 2946/nginx: master
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1494/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2651/master
tcp6 0 0 :::22 :::* LISTEN 1494/sshd
tcp6 0 0 ::1:25 :::* LISTEN 2651/master
LNMP+WordPress管理(60分)
1. 使用提供的CentOS系统虚拟机,根据提供的软件包,安装LNMP+WordPress环境,应用部署完毕后,设置WordPress的站点标题为自己的姓名(例:名字叫张三,则设置站点标题为张三的BLOG),设置完毕后登录WordPress。将WordPress首页截图上传至答题框。(截图需体现站点名称)
WordPress应用系统(80分)
1.使用提供的软件包和vmware提供的centos7.2操作系统,完成LNMP+WordPress部署。部署完成后,进行登录,最后提交WordPress首页和后台管理界面。(设置WordPress名称为自己的姓名+BLOG,例如张三,则WordPress首页显示张三BLOG,答案的截图需体现这点)