1+x2022年9月16日实操题答案

1、使用eNSP模拟器,启动S5700交换机。
通过一条命令在S1交换机上创建vlan100、vlan101,配置vlan100网关为:172.16.100.254/24。
配置vlan101网关为:172.16.101.254/24。配置g0/0/1端口为trunk模式,放行vlan100。
配置g0/0/2端口为access模式,所属vlan101。将以上所有操作命令和返回结果以文本形式提交大答题框。(使用完整命令-通过Tab键补全)(20 分)

参考答案:
[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



————————————————————————————————————————————————
2、使用eNSP模拟器。
配置路由器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。
将以上所有操作命令和返回结果以文本形式提交到答题框。(使用完整命令-通过Tab键补全)(30 分)

参考答案:
[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



————————————————————————————————————————————————
3、使用VMWare软件启动提供的xserver1虚拟机(配置虚拟机xserver1的IP为192.168.100.11,主机名为xserver1),
在虚拟机的/root目录下,存在一个CentOS-7-x86_64-DVD-1511.iso的镜像文件,
使用这个镜像文件配置本地yum源,要求将这个镜像文件挂载在/opt/centos目录,
请问如何配置自己的local.repo文件,使得可以使用该镜像中的软件包,安装软件。
请将local.repo文件的内容和执行yum repolist的返回结果以文本形式提交到答题框(20 分)

参考答案: (只有local.repo文件的内容)
[centos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enabled=1


————————————————————————————————————————————————
4、使用xserver1虚拟机,安装ftp服务,并配置ftp的共享目录为/opt。
使用VMWare软件继续启动提供的xserver2虚拟机(配置虚拟机xserver2的IP为192.168.100.12,主机名为xserver2),
并创建该虚拟机的yum源文件ftp.repo使用xserver1的ftp源(配置文件中的FTP地址使用主机名)。
配置完成后,将xserver1节点执行netstat -ntpl命令(netstat命令若不能用,则自行安装net-tools工具)
的返回结果和将xserver2节点的ftp.repo文件以文本形式提交到答题框(30 分)

参考答案: (只有xserver2节点的ftp.repo文件以文本形式)
[centos]
name=centos
baseurl=ftp://xserver1/centos
gpgcheck=0
enabled=1




————————————————————————————————————————————————
5、使用xserver1虚拟机,使用VMWare软件自行添加一块大小为20G的硬盘,
使用fdisk命令对该硬盘进形分区,要求分出两个大小为5G的分区。
使用两个分区,创建名xcloudvg的卷组,然后再创建一个5G的分区,
将xcloudvg扩容至15G,最后执行vgdisplay命令查看卷组信息。
将上述所有操作命令和返回结果以文本形式提交到答题框(30 分)

参考答案:(操作命令)
[root@localhost ~]# pvcreate /dev/vdb1 /dev/vdb2
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-2] –s 15M

参考答案:(返回结果)
[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 15.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


————————————————————————————————————————————————
6、在xserver1、xserver2上安装mariadb数据库,并配置为主从数据库(xserver1为主节点、xserver2为从节点)
实现两个数据库的主从同步。配置完毕后,请在xserver2上的数据库中执行“show slave status \G”命令
查询从节点复制状态,将查询到的结果以文本形式提交到答题框(40 分)

参考答案:
MariaDB [(none)]> start slave;
MariaDB [(none)]> show slave tatus\G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: xserver1
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)




————————————————————————————————————————————————
7、使用xserver1节点,安装单节点lnmp环境。安装lnmp环境需要用到的YUM源
为CentOS-7-x86_64-DVD-1511.iso和lnmp目录(均在/root目录下)。
安装并配置完lnmp环境后。依次查询数据库、nginx、php服务的状态,
并使用netstat -ntpl命令查看端口开放情况。最后依次将查询服务状态的返回结果,
和查看端口开放情况的返回结果以文本形式提交到答题框(40 分)

参考答案:[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 ManagerLoaded:
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




————————————————————————————————————————————————
8、使用xserver1节点,基于lnmp环境,部署WordPress应用(WordPress源码包在/root目录下)。
应用部署完毕后,设置WordPress的站点标题为自己的姓名
(例:名字叫张三,则设置站点标题为张三的BLOG),设置完毕后登录WordPresss首页。
最后将命令curl ip(ip为wordpress的首页ip)的返回结果以文本形式提交到答题框(40 分)

参考答案:
[root@localhost ~]# curl 192.168.100.10
欢迎使用WordPress。这是您的第一篇文章。编辑或删除它,然后开始写作吧!




————————————————————————————————————————————————
9、使用VMWare软件启动提供的opensatckallinone镜像,自行检查openstack中各服务的状态,若有问题自行排查。
在keystone中创建用户testuser,密码为password,创建好之后,查看testuser的详细信息。
将openstack user show testuser命令的返回结果以文本形式提交到答题框(30 分)

答案:[root@controller ~]# source /etc/keystone/admin-openrc.sh
[root@controller ~]# openstack user create testuser --domain xiandian --password password testuser
[root@controller ~]# openstack user show testuser

参考答案:
[root@controller ~]# openstack user show testuser





————————————————————————————————————————————————

10、使用VMWare软件启动提供的opensatckallinone镜像,
自行检查openstack中各服务的状态,若有问题自行排查。
在xserver1节点的/root目录下存在一个cirros-0.3.4-x86_64-disk.img镜像;
使用glance命令将镜像上传,并命名为mycirros,
最后将glance image-show id命令的返回结果以文本形式提交到答题框(30 分)

答案:[root@xserver1 ~]# scp cirros-0.3.4-x86_64-disk.img root@192.168.100.10:~
[root@controller ~]# glance image-create --name ‘mycirros’ --disk-format qcow2 --container-format bare --progress < cirros-0.3.4-x86_64-disk.img
[root@controller ~]# glance image-show 5c981efa-955d-44f4-9120-bed616501033

参考答案:[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 |
+------------------+--------------------------------------+


————————————————————————————————————————————————
11、使用VMWare软件启动提供的opensatckallinone镜像,
自行检查openstack中各服务的状态,
若有问题自行排查。使用Cinder服务,
创建名为“ lvm”的卷类型,然后创建一块带“lvm” 标识的云硬盘,
名称为 BlockVloume,大小为 2G,查询该云硬盘详细信息。
完成后,将cinder show BlockVloume命令的返回结果以文本形式提交到答题框(30 分)

参考答案:
[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 |+--------------------------------+--------------------------------------+



————————————————————————————————————————————————
12、使用VMWare软件启动提供的opensatckallinone镜像,
自行检查openstack中各服务的状态,若有问题自行排查。
使用nova相关命令,查询nova所有的监控列表,并查看ID为1的监控主机的详细信息,
将操作命令和返回结果以文本形式提交到答题框(30 分)






————————————————————————————————————————————————
13、使用VMWare软件启动提供的opensatckallinone镜像,
自行检查openstack中各服务的状态,若有问题自行排查。
使用swift相关命令,创建一个名叫examcontainer的容器,
然后往这个容器中上传一个test.txt的文件(文件可以自行创建),上传完毕后,
使用命令查看容器,将操作命令和返回结果以文本形式提交到答题框(40 分)

参考答案:
[root@controller ~]# swift post examcontainer
[root@controller ~]# touch test.txt
[root@controller ~]# swift upload examcontainer test.txt
test.txt
[root@controller ~]# swift list examcontainer
test.txt
————————————————————————————————————————————————
14、使用xserver1节点,自行配置YUM源,安装docker服务
(需要用到的包为xserver1节点/root目录下的Docker.tar.gz)。
安装完服务后,将registry_latest.tar上传到xserver1节点中并配置为私有仓库。
要求启动registry容器时,将内部保存文件的目录映射到外部的/opt/registry目录,
将内部的5000端口映射到外部5000端口。依次将启动registry容器的命令及返回结果、
执行docker info命令的返回结果以文本形式提交到答题框(40 分)





————————————————————————————————————————————————
15、使用xserver1节点,新建httpd目录,然后编写Dockerfile文件,
要求如下:
1)使用centos:latest镜像作为基础镜像;
2)作者为xiandian;
3)Dockerfile要求删除镜像的yum源,使用当前系统的local.repo源文件;
4)安装http服务;
5)暴露80端口。编写完毕后,构建的镜像名字叫httpd:v1.0的镜像。
完成后将Dockerfile文件和镜像列表信息以文本形式提交到答题框(50 分)





 

  • 11
    点赞
  • 44
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值