当前位置:   article > 正文

1+X中级操作题_1+xpython中级题型

1+xpython中级题型

RAID

热添加磁盘
echo "- - -" | tee /sys/class/scsi_host/host{0,1,2}/scan
  • 1
  • 2

44 Raid存储管理(40分) A

使用提供的虚拟机,该虚拟机存在一块大小为20G的磁盘/dev/vdb,使用fdisk命令对该硬盘进形分区,要求分出三个大小为5G的分区。使用这三个分区,创建名为/dev/md5、raid级别为5的磁盘阵列。创建完成后使用xfs文件系统进形格式化,并挂载到/mnt目录下。将mdadm -D /dev/md5命令和返回结果;df -h命令和返回结果以文本形式提交到答题框。

操作步骤:

配置yum源
磁盘分区
yum -y install mdadm
mdadm -C /dev/md5 -l 5 -n 3 -x 0 /dev/sdb{1,2,3}
mkfs.xfs /dev/md5 
mount /dev/md5 /mnt/
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

-C 指定名称 , -l 指定RAID级别 ,-n 所需要的分区数 ,-x 备份盘的个数 ,总个数= n + x

参考答案:

[root@xiandian ~]# mdadm -D /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Wed Oct 23 17:08:07 2019
Raid Level : raid5
Array Size : 5238784 (5.00 GiB 5.36 GB)
Used Dev Size : 5238784 (5.00 GiB 5.36 GB)
Raid Devices : 3
Total Devices : 3
Persistence : Superblock is persistent
Update Time : Wed Oct 23 17:13:37 2019
State : clean
Active Devices : 3
Working Devices : 3
Failed Devices : 0
Spare Devices : 0
Name : xiandian:0 (local to host xiandian)
UUID : 71123d35:b354bc98:2e36589d:f0ed3491
Events : 17
Number Major Minor RaidDevice State
0 253 17 0 active sync /dev/vdb1
1 253 18 1 active sync /dev/vdb2
2 253 19 2 active sync /dev/vdb3
[root@xiandian ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 41G 2.4G 39G 6% /
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 4.0K 3.9G 1% /dev/shm
tmpfs 3.9G 17M 3.9G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/loop0 2.8G 33M 2.8G 2% /swift/node
tmpfs 799M 0 799M 0% /run/user/0
/dev/md5 10.0G 33M 10.0G 1% /mnt
  • 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

44 Raid存储管理(40分) B

登录云主机,在云主机中,存在一个大小为20G的硬盘为/dev/vdb,使用fdisk命令对该硬盘进形分区,要求分出两个大小为5G的分区。使用这两个分区,创建名为/dev/md0、raid级别为1的磁盘阵列。创建完成后使用xfs文件系统进形格式化,并挂载到/mnt目录下。将mdadm -D /dev/md0命令和df -h命令返回得结果以文本形式提交到答题框。

操作步骤:

配置yum源
磁盘分区
yum -y install mdadm
mdadm -C /dev/md0 -l 1 -n 2 -x 0 /dev/sdb{1,2}
mkfs.xfs /dev/md0 
mount /dev/md0 /mnt
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

参考答案:

[root@xiandian ~]# mdadm -D /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Wed Oct 23 17:08:07 2019
Raid Level : raid1
Array Size : 5238784 (5.00 GiB 5.36 GB)
Used Dev Size : 5238784 (5.00 GiB 5.36 GB)
Raid Devices : 2
Total Devices : 2
Persistence : Superblock is persistent
Update Time : Wed Oct 23 17:13:37 2019
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Name : xiandian:0 (local to host xiandian)
UUID : 71123d35:b354bc98:2e36589d:f0ed3491
Events : 17
Number Major Minor RaidDevice State
0 253 17 0 active sync /dev/vdb1
1 253 18 1 active sync /dev/vdb2
[root@xiandian ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 41G 2.4G 39G 6% /
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 4.0K 3.9G 1% /dev/shm
tmpfs 3.9G 17M 3.9G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/loop0 2.8G 33M 2.8G 2% /swift/node
tmpfs 799M 0 799M 0% /run/user/0
/dev/md0 5.0G 33M 5.0G 1% /mnt
  • 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

44 Raid管理(40分) D

使用提供的虚拟机和软件包,完成Raid磁盘阵列的创建。当前虚拟机存储在一个大小为20G的磁盘vdb,利用磁盘分区新建4个磁盘分区,每个大小为5 GB。用3个5 GB的分区来模拟一个名为md5,级别为raid 5,外加一个热备盘的磁盘阵列。创建完成后将mdadm -D /dev/md5的返回结果以文本形式提交到答题框。

操作步骤:

配置yum源
磁盘分区
yum -y install mdadm
mdadm -C /dev/md5 -l 1 -n 3 -x 1 /dev/sdb{1,2,3,4}
mkfs.xfs /dev/md5 
mount /dev/md5 /mnt
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

参考答案:

[root@localhost ~]# mdadm -D /dev/md5
/dev/md5:
Version : 1.2
Creation Time : Sat Oct 5 13:17:41 2019
Raid Level : raid5
Array Size : 41908224 (39.97 GiB 42.91 GB)
Used Dev Size : 20954112 (19.98 GiB 21.46 GB)
Raid Devices : 3
Total Devices : 4
Persistence : Superblock is persistent
Update Time : Sat Oct 5 13:19:27 2019
State : clean
Active Devices : 3
Working Devices : 4
Failed Devices : 0
Spare Devices : 1
Layout : left-symmetric
Chunk Size : 512K
Consistency Policy : unknown
Name : localhost.localdomain:5 (local to host localhost.localdomain)
UUID : f51467bd:1199242b:bcb73c7c:160d523a
Events : 18
Number Major Minor RaidDevice State
0 8 16 0 active sync /dev/sdb
1 8 32 1 active sync /dev/sdc
4 8 48 2 active sync /dev/sdd
3 8 64 - spare /dev/sde
  • 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

KVM

44 KVM管理(40分) C E 44

使用提供的虚拟机和软件包,完成KVM服务的安装与KVM虚拟机的启动。使用提供的cirros镜像与qemu-ifup-NAT脚本启动虚拟机,启动完毕后登录,登录有执行ip addr list命令,将该命令的返回结果以文本形式提交到答题框。

操作步骤:

将提供的kvm_yum上传到opt,并配置yum源
yum install qemu-kvm libvirt net-tools
systemctl restart libvirtd
ln -s /usr/libexec/qemu-kvm /usr/bin/qemu-kvm
chmod +x qemu-ifup-NAT
qemu-kvm -m 1024 -drive file=/root/cirros-0.3.4-x86_64-disk.img,if=virtio -net nic,model=virtio -net tap,script=qemu-ifup-NAT -nographic -vnc :1
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

参考答案:

$ ip addr list
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.89/24 brd 192.168.122.255 scope global eth0
inet6 fe80::5054:ff:fe12:3456/64 scope link
valid_lft forever preferred_lft forever
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

Docker

安装

53 Docker安装(40分) A B 53 C 50 D 52 E 53

使用提供的虚拟机和软件包,自行配置YUM源,安装docker-ce服务。安装完毕后执行docker info命令的返回结果以文本形式提交到答题框。

操作步骤:

将docker镜像上传到x1
tar zxvf Docker.tar.gz 
cp -rf Docker /opt/
ls /opt/Docker/      
rm -f /etc/yum.repos.d/*
vi /etc/yum.repos.d/centos.repo
mkdir /opt/centos
mount CentOS-7-x86_64-DVD-1511.iso /opt/centos/
yum repolist
yum -y install docker-ce
systemctl start docker
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

备用途径:

k8s
cp -rvf Docker /opt/
yum -y install vsftpd
vi /etc/vsftpd/vsftpd.conf
systemctl start vsftpd
systemctl stop firewalld
setenforce 0

x1
rm -f /etc/yum.repos.d/*
vi /etc/yum.repos.d/centos.repo
    [centos]
    name=centos
    baseurl=file:///opt/centos
    gpgcheck=0
    enabled=1
    [docker]
    name=docker
    baseurl=ftp://192.168.100.20/Docker            #需要添加一块网卡
    gpgcheck=0
    enabled=1
mkdir /opt/centos
mount CentOS-7-x86_64-DVD-1511.iso /opt/centos/
systemctl stop firewalld
setenforce 0
yum clean all;yum repolist
yum -y install docker-ce
systemctl start docker
  • 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

参考答案:

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.
  • 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
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65

compose

52 Docker Compose安装(40分) C

使用提供的虚拟机和软件包,安装docker compose服务,安装完毕后,使用命令查看docker compose的版本信息,将查询版本信息的命令与返回结果已文本形式提交到答题框。

操作步骤:

如果题目给出compose包就用,没有就在k8s里做
cp /root/compose/docker-compose /usr/local/bin/              
chmod +x /usr/local/bin/docker-compose    
docker-compose --version
  • 1
  • 2
  • 3
  • 4

参考答案:

[root@compose ~]# docker-compose --version
docker-compose version 1.25.0-rc2, build 661ac20e
  • 1
  • 2

2、55、Docker Compose 测试题

使用VMWare软件启动提供的k8sallinone镜像,完成docker compose案例,compose案例所有用到的文件均在/root/compose目录下,需要用到的镜像均在/root/images目录下。理解docker compose的原理与工作流程,在/root目录下新建composetest目录作为工作目录,理解提供的配置文件与部署文件,运行docker compose案例。运行成功后,使用curl命令访问http://IP:5000。最后将运行docker-compose up的结果和curl的结果以文本形式提交到答题框。 (30)分

操作步骤:

cp /root/compose/docker-compose /usr/local/bin/              
chmod +x /usr/local/bin/docker-compose    
进入目录compose,查看各个文件,找到所需要的镜像。
docker load -i python_3.5-alpine.tar 
docker load -i redis_alpine.tar 
mkdir composetest
cp /root/compose/* /root/composetest/
cd /root/composetest/
docker-compose up -d            #后台守护态运行
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

参考答案:

[root@master composetest]# curl http://192.168.100.20:5000
Hello World! I have been seen 1 times.
[root@master composetest]# docker-compose up
composetest_redis_1 is up-to-date
composetest_web_1 is up-to-date
Attaching to composetest_redis_1, composetest_web_1
redis_1  | 1:C 20 May 2021 11:13:32.030 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis_1  | 1:C 20 May 2021 11:13:32.030 # Redis version=5.0.6, bits=64, commit=00000000, modified=0, pid=1, just started
redis_1  | 1:C 20 May 2021 11:13:32.030 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
redis_1  | 1:M 20 May 2021 11:13:32.032 * Running mode=standalone, port=6379.
redis_1  | 1:M 20 May 2021 11:13:32.032 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
redis_1  | 1:M 20 May 2021 11:13:32.032 # Server initialized
redis_1  | 1:M 20 May 2021 11:13:32.032 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
redis_1  | 1:M 20 May 2021 11:13:32.032 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
redis_1  | 1:M 20 May 2021 11:13:32.032 * Ready to accept connections
web_1    |  * Serving Flask app "app" (lazy loading)
web_1    |  * Environment: production
web_1    |    WARNING: This is a development server. Do not use it in a production deployment.
web_1    |    Use a production WSGI server instead.
web_1    |  * Debug mode: on
web_1    |  * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
web_1    |  * Restarting with stat
web_1    |  * Debugger is active!
web_1    |  * Debugger PIN: 324-831-420
web_1    | 192.168.100.20 - - [20/May/2021 11:14:40] "GET / HTTP/1.1" 200 -
  • 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

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

Harbor

1、54 Docker Harbor安装(40分) B C 51 E 55

使用提供的虚拟机与软件包,部署Docker Harbor镜像仓库服务。安装完毕后,将执行./install.sh --with-notary --with-clair命令返回结果中的[step4]的内容以文本形式提交到答题框。

操作步骤:

k8s
./image.sh
cp /root/compose/docker-compose /usr/local/bin/
chmod +x /usr/local/bin/docker-compose
#上传harbor-offline-installer-v1.5.3.tgz并解压到opt目录下
tar  -zvxf  harbor-offline-installer-v1.5.3.tgz -C /opt/
cd /opt/harbor
vi harbor.cfg
        hostname = 192.168.132.157
./prepare 
./install.sh    #将题目要求的后缀去掉,并在结果的http后面加上s
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

参考答案:

[Step 4]: starting Harbor ...
✔ ----Harbor has been installed and started successfully.----
Now you should be able to visit the admin portal at https://10.24.2.37.
For more details, please visit https://github.com/vmware/harbor .
  • 1
  • 2
  • 3
  • 4

docker File

53 Dockerfile编写(40分) C

自定义Dockerfile,要求Dockerfile主要完成以下工作: ①构建一个基于Python 3.5的镜像。 ②把当前目录添加到镜像中的/code路径下。 ③把工作路径设置成/code。 ④设置容器的默认命令为python app.py。 将Dockerfile文件以文本形式提交到答题框。

 ls /root/compose/Dockerfile          #答案在这里
  • 1

参考答案:

FROM python:3.5-alpine
ADD . /code
WORKDIR /code
CMD ["python", "app.py"]
  • 1
  • 2
  • 3
  • 4

swarm

54 部署Swarm集群(40分) A

使用提供的虚拟机和软件包,安装好docker-ce。部署Swarm集群,并安装Portainer图形化管理工具,部署完成后,使用浏览器登录ip:9000界面,进入Swarm控制台。将curl swarm ip:9000返回的结果以文本形式提交到答题框。

操作步骤:

k8s
docker swarm init --advertise-addr 192.168.100.20
docker load -i images/portainer_portainer_latest.tar
docker run -dit -p 9000:9000 portainer
curl http://192.168.100.20:9000
  • 1
  • 2
  • 3
  • 4
  • 5

完整操作步骤:

k8s
cp Docker /opt/
yum -y imstall vsftpd
vi /etc/vsftpd/vsftpd.cfg
systemctl start vsftpd
vi /lib/systemd/system/docker.service
	ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock 
systemctl daemon-reload
systemctl restart docker
docker swarm init --advertise-addr 192.168.100.20
docker load -i images/portainer_portainer_latest.tar
——————————————————————————————————————————————————————————————
docker run -dit -p 9000:9000 portainer
进入浏览器配置
curl http://192.168.100.20:9000

x1
rm -f /etc/yum.repod.s/*
vi /etc/yum.repod.s/centos.repo
添加一块与k8s相同的网卡
yum clean all;yum repolist
yum -y install docker-ce
vi /lib/systemd/system/docker.service
	ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock
systemctl daemon-reload
systemctl restart docker
docker swarm join --token SWMTKN-1-4jf6s1utl70jziglvs83hgu950x2iwrxchl4pacn9x0zfa3rgb-08ryk4mqss3tb3ml6535b76r4 192.168.100.20:2377
  • 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

参考答案:

[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>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

53 部署Swarm集群(40分) D E

使用提供的虚拟机,自行配置好网络,安装好docker-ce。部署Swarm集群,并安装Portainer图形化管理工具,部署完成后,使用浏览器登录ip:9000界面,进入Swarm控制台。将curl swarm ip:9000返回的结果以文本形式提交到答题框。

操作步骤:

同上
  • 1

参考答案:

[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>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

kubernetes

54 Kubernetes平台搭建(40分) D

使用提供的虚拟机和软件包,搭建Kubernetes平台,平台的两个节点分别为master和node节点,在将node节点加入到集群后,登录master节点,使用kubectl get nodes查询各节点状态。将查询节点状态的返回结果以文本形式提交到答题框。

操做步骤:


  • 1

参考答案:

[root@master ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
master Ready master 117m v1.14.1
node Ready <none> 6m30s v1.14.1
  • 1
  • 2
  • 3
  • 4

zookerper

1、Zookeeper集群(40分) A

使用提供的三台虚拟机和软件包,完成Zookeeper集群的安装与配置,配置完成后,在相应的目录使用./zkServer.sh status命令查看三个Zookeeper节点的状态,将三个节点的状态以文本形式提交到答题框。

操作步骤:

hostnamectl set-hostname zookeeper1
rm -f /etc/yum.repos.d/*
vi /etc/yum.repos.d/centos.repo
        [centos]
        name=centos
        baseurl=file:///opt/centos
        enabled=1
        gpgcheck=0
        [gpmall]
        name=gpmall
        baseurl=file:///opt/gpmall-repo
        enabled=1
        gpgcheck=0
cp -rf gpmall-repo/ /opt/
mkdir /opt/centos
mount CentOS-7-x86_64-DVD-1511.iso /opt/centos/
yum clean all;yum repolist
tar -zvxf zookeeper-3.4.14.tar.gz
cd zookeeper-3.4.14/conf/
mv zoo_sample.cfg zoo.cfg
cd
cd zookeeper-3.4.14/bin/
./zkServer.sh start
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23

参考答案:

[root@zookeeper1 bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /root/zookeeper-3.4.14/bin/../conf/zoo.cfg
Mode: follower                                                                     #注意#
[root@zookeeper2 bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /root/zookeeper-3.4.14/bin/../conf/zoo.cfg
Mode: leader                                                                       #注意#
[root@zookeeper3 bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /root/zookeeper-3.4.14/bin/../conf/zoo.cfg
Mode: follower                                                                     #注意#
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

2、47 Zookeeper集群(40分) B E 47

继续使用上题的三台虚拟机,使用提供的软件包,完成Zookeeper集群的安装与配置,配置完成后,在相应的目录使用./zkServer.sh status命令查看三个Zookeeper节点的状态,将三个节点的状态以文本形式提交到答题框。

操作步骤:

同上
  • 1

参考答案:

[root@zookeeper1 bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /root/zookeeper-3.4.14/bin/../conf/zoo.cfg
Mode: follower
[root@zookeeper2 bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /root/zookeeper-3.4.14/bin/../conf/zoo.cfg
Mode: leader
[root@zookeeper3 bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /root/zookeeper-3.4.14/bin/../conf/zoo.cfg
Mode: follower
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

kafka

1、48 Kafka集群(40分) A

使用提供的三台虚拟机和软件包,完成Kafka集群的安装与配置,配置完成后,在相应的目录使用 ./kafka-topics.sh --create --zookeeper 你的IP:2181 --replication-factor 1 --partitions 1 --topic test创建topic,将输入命令后的返回结果以文本形式提交到答题框。

参考答案:

[root@zookeeper1 bin]# ./kafka-topics.sh --create --zookeeper 172.16.51.23:2181 --replication-factor 1 --partitions 1 --topic test
Created topic "test".
  • 1
  • 2

2、48 Kafka集群(40分) B E 48

继续使用上题的三台虚拟机,使用提供软件包,完成Kafka集群的安装与配置,配置完成后,在相应的目录使用 ./kafka-topics.sh --create --zookeeper 你的IP:2181 --replication-factor 1 --partitions 1 --topic test创建topic,将输入命令后的返回结果以文本形式提交到答题框。

参考答案:

[root@zookeeper1 bin]# ./kafka-topics.sh --create --zookeeper 172.16.51.23:2181 --replication-factor 1 --partitions 1 --topic test
Created topic "test".
  • 1
  • 2

zabbi-server

1、49 Zabbix-server节点搭建(40分) A

使用提供的虚拟机和软件包,完成Zabbix监控系统server端的搭建,搭建完毕后启动服务,然后使用netstat -ntpl命令查看端口启动情况,将netstat -ntpl命令的返回结果以文本形式提交到答题框。

操作步骤:

rm -f /etc/yum.repos.d/*
vi /etc/yum.repos.d/centos.repo
        [centos]
        name=centos
        baseurl=file:///opt/centos
        enabled=1
        gpgcheck=0
        [zabbix]
        name=zabbix
        baseurl=file:///opt/zabbix
        enabled=1
        gpgcheck=0
mkdir /opt/centos
mount CentOS-7-x86_64-DVD-1511.iso /opt/centos/
cp -rf zabbix /opt/
yum clean all;yum repolist
yum install -y vsftpd httpd mariadb-server
systemctl start vsftpd httpd mariadb
yum -y install net-tools
netstat -ntpl

将zabbix_server补上


  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24

参考答案:

[root@zabbix-server ~]# 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:10051 0.0.0.0:* LISTEN 10611/zabbix_server
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 10510/mysqld
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 975/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 886/master
tcp6 0 0 :::10051 :::* LISTEN 10611/zabbix_server
tcp6 0 0 :::80 :::* LISTEN 10579/httpd
tcp6 0 0 :::21 :::* LISTEN 10015/vsftpd
tcp6 0 0 :::22 :::* LISTEN 975/sshd
tcp6 0 0 ::1:25 :::* LISTEN 886/master
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

电商系统

1、46 应用商城系统(40分) A C 46 D 45

使用提供的软件包和提供的虚拟机,完成单节点应用系统部署。部署完成后,进行登录,(订单中填写的收货地址填写自己学校的地址,收货人填写自己的实际联系方式)最后使用curl命令去获取商城首页的返回信息,将curl http://你自己的商城IP/#/home获取到的结果以文本形式提交到答题框。

参考步骤:

vi gpmall-single/dist/index.html
  • 1

参考答案:

[root@server ~]# curl http://172.30.11.27/#/home
<!DOCTYPE html><html><head><meta charset=utf-8><title>1+x-示例项目</title><meta name=keywords content=""><meta name=description content=""><meta http-equiv=X-UA-Compatible content="IE=Edge"><meta name=wap-font-scale content=no><link rel="shortcut icon " type=images/x-icon href=/static/images/favicon.ico><link href=/static/css/app.8d4edd335a61c46bf5b6a63444cd855a.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.2d17a82764acff8145be.js></script><script type=text/javascript src=/static/js/vendor.4f07d3a235c8a7cd4efe.js></script><script type=text/javascript src=/static/js/app.81180cbb92541cdf912f.js></script></body></html><style>body{
min-width:1250px;
  • 1
  • 2
  • 3

2、49 应用商城系统(40分) B E 49

继续使用上题的三台虚拟机,使用提供的软件包,基于集群应用系统部署。部署完成后,进行登录,(订单中填写的收货地址填写自己学校的地址,收货人填写自己的实际联系方式)最后使用curl命令去获取商城首页的返回信息,将curl http://你自己的商城IP/#/home获取到的结果以文本形式提交到答题框。

参考步骤:

同上
  • 1

参考答案:

[root@server ~]# curl http://172.30.11.27/#/home
<!DOCTYPE html><html><head><meta charset=utf-8><title>1+x-示例项目</title><meta name=keywords content=""><meta name=description content=""><meta http-equiv=X-UA-Compatible content="IE=Edge"><meta name=wap-font-scale content=no><link rel="shortcut icon " type=images/x-icon href=/static/images/favicon.ico><link href=/static/css/app.8d4edd335a61c46bf5b6a63444cd855a.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.2d17a82764acff8145be.js></script><script type=text/javascript src=/static/js/vendor.4f07d3a235c8a7cd4efe.js></script><script type=text/javascript src=/static/js/app.81180cbb92541cdf912f.js></script></body></html><style>body{
min-width:1250px;
  • 1
  • 2
  • 3

SQL

主从复制

1、45 主从数据库管理(40分) A B 45 C 45 D 47 E 45

使用提供的两台虚拟机,在虚拟机上安装mariadb数据库,并配置为主从数据库,实现两个数据库的主从同步。配置完毕后,请在从节点上的数据库中执行“show slave status \G”命令查询从节点复制状态,将查询到的结果以文本形式提交到答题框。

操作步骤:

主
rm -f /etc/yum.repos.d/*
cp -rf gpmall-repo /opt/
mkdir /opt/centos
mount CentOS-7-x86_64-DVD-1511.iso /opt/centos/
vi /etc/yum.repos.d/centos.repo
        [centos]
        name=centos
        baseurl=file:///opt/centos
        gpgcheck=0
        enabled=1
        [gpmall]
        name=gpmall
        baseurl=file:///opt/gpmall-repo
        gpgcheck=0
        enabled=1
yum clean all;yum repolist
yum -y install vsftpd
vi /etc/vsftpd/vsftpd.conf 
systemctl start vsftpd
systemctl stop firewalld
setenforce 0
yum -y install mariadb mariadb-server
systemctl restart mariadb
mysql_secure_installation                 #初始化数据库
vi /etc/my.cnf
        [mysqld]
        server-id=2
        log_bin=log_bin
systemctl restart mariadb
mysql -uroot -p000000
    create user 'repl'@'192.168.132.%' identified by 'repl';  #创建用户
 	grant replication slave on *.* to 'repl'@'192.168.132.%'; #给用户授权
 	set password for 'repl'@'192.168.132.%' = password('000000'); #设密码
 	show master status;     #查看信息
  • 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
从
rm -f /etc/yum.repos.d/*
vi /etc/yum.repos.d/centos.repo
        [centos]
        name=centos
        baseurl=ftp://192.168.132.157/centos
        gpgcheck=0
        enabled=1
        [gpmall]
        name=gpmall
        baseurl=ftp://192.168.132.157/gpmall-repo
        gpgcheck=0
        enabled=1
yum clean all;yum repolist
systemctl stop firewalld
setenforce 0
yum -y install mariadb mariadb-server
systemctl restart mariadb
mysql_secure_installation
vi /etc/my.cnf
        [mysqld]
        server-id=3
        log_bin=log_bin
systemctl restart mariadb
mysql -uroot -p000000
help CHANGE MASTER TO;    #查看帮助
help change master to;
change master to master_host='192.168.132.157',master_user='repl',master_password='000000',master_port=3306,master_log_file='log_bin.000002',master_log_pos=851;
start slave;              #启动从数据库
show slave status\G       #查看信息
  • 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

参考答案:

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)
  • 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
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44

读写分离

3、46 读写分离数据库管理(40分) B D 48 E 46

使用提供的虚拟机与软件包,基于上一题构建的主从数据库,进一步完成Mycat读写分离数据库的配置安装。需要用的配置文件schema.xml文件如下所示(server.xml文件不再给出): select user() 配置读写分离数据库完毕后,使用netstat -ntpl命令查询端口启动情况。最后将netstat -ntpl命令的返回结果以文本形式提交到答题框。

参考答案:

8066 9066
在这里插入图片描述

[root@mycat ~]# netstat -ntlp
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:22              0.0.0.0:*               LISTEN      1114/sshd           
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1992/master         
tcp        0      0 127.0.0.1:32000         0.0.0.0:*               LISTEN      3988/java           
tcp6       0      0 :::45929                :::*                    LISTEN      3988/java           
tcp6       0      0 :::9066                 :::*                    LISTEN      3988/java           
tcp6       0      0 :::40619                :::*                    LISTEN      3988/java           
tcp6       0      0 :::22                   :::*                    LISTEN      1114/sshd           
tcp6       0      0 ::1:25                  :::*                    LISTEN      1992/master         
tcp6       0      0 :::1984                 :::*                    LISTEN      3988/java           
tcp6       0      0 :::8066                 :::*                    LISTEN      3988/java   
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

数据库运维

5、46 数据库运维(40分) D

使用上一题安装的数据库,进行数据库备份操作,要求使用mysqldump命令将gpmall数据库导出进行备份,备份名为gpmall_bak.sql,并存放在/opt目录下(使用绝对路径),将上述所有操作命令和返回结果以文本形式提交到答题框。

参考答案:

[root@mysql ~]# mysqldump -uroot -p123456 gpmall > /opt/gpmall_bak.sql
[root@mysql opt ]# ls
gpmall_bak.sql
  • 1
  • 2
  • 3

脚本

shell 脚本

1、55 Shell脚本补全(40分) A D 55

下面有一段脚本,作用是自动配置redis服务,由于工程师的失误,将脚本中的某些代码删除了,但注释还在,请根据注释,填写代码。最后将填写的代码按照顺序以文本形式提交至答题框。 redis(){ cd #修改redis的配置文件,将bind 127.0.0.1注释 sed -i (此处填写) /etc/redis.conf #修改redis的配置文件,将protected-mode yes改为protected-mode no sed -i (此处填写) /etc/redis.conf #启动redis服务 systemctl start redis #设置开机自启 systemctl enable redis if [ $? -eq 0 ] then sleep 3 echo -e “\033[36mredis启动成功\033[0m” else echo -e “\033[31mredis启动失败,请检查\033[0m” exit 1 fi sleep 2 }

参考答案:

sed -i 's/bind 127.0.0.1/#bind 127.0.0.1/g' /etc/redis.conf
sed -i 's/protected-mode yes/protected-mode no/g' /etc/redis.conf
  • 1
  • 2

2、55 Shell脚本补全(40分) B

下面有一段脚本,作用是自动配置nginx服务,由于工程师的失误,将脚本中的某些代码删除了,但注释还在,请根据注释,填写代码。最后将填写的代码按照顺序以文本形式提交至答题框。 nginx(){ cd #删除默认项目路径下的文件 rm -rf /usr/share/nginx/html/* #将提供的dist静态文件复制到nginx项目目录 cp -rvf /root/dist/* /usr/share/nginx/html #修改nginx配置文件如下 cat > /etc/nginx/conf.d/default.conf << EOF server { listen 80; server_name localhost; #charset koi8-r; #access_log /var/log/nginx/host.access.log main; location / { root /usr/share/nginx/html; index index.html index.htm; } location /user { (此处需要填写) } location /shopping { proxy_pass http://127.0.0.1:8081; } location /cashier { proxy_pass http://127.0.0.1:8083; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } } EOF #启动nginx服务 systemctl start nginx #设置nginx开机自启 (此处需填写) #检查nginx服务是否成功启动 if [ $? -eq 0 ] then sleep 3 echo -e “\033[36mnginx启动成功\033[0m” else echo -e “\033[31mnginx启动失败,请检查\033[0m” exit 1 fi sleep 2 }

参考答案:

proxy_pass http://127.0.0.1:8082;
systemctl enable nginx
  • 1
  • 2

3、54 Shell脚本补全(40分) C

下面有一段脚本,作用是自动配置mysql服务,由于工程师的失误,将脚本中的某些代码删除了,但注释还在,请根据注释,填写代码。最后将填写的代码按照顺序以文本形式提交至答题框。 脚本如下所示: mariadb(){ cd #在数据库的my.cnf文件添加内容如下 (此处需填写) [mysqld] init_connect=‘SET collation_connection = utf8_unicode_ci’ init_connect=‘SET NAMES utf8’ character-set-server=utf8 collation-server=utf8_unicode_ci skip-character-set-client-handshake EOF #启动数据库 systemctl start mariadb #设置数据库root的密码为123456 mysqladmin -uroot password 123456 #创建gpmall数据库,并将gpmall.sql文件导入 mysql -uroot -p123456 << EOF (此处需填写) use gpmall source /root/gpmall.sql EOF #设置开机自启数据库 systemctl enable mariadb #重启数据库服务 systemctl restart mariadb #检查数据库是否重启成功 if [ $? -eq 0 ] then sleep 3 echo -e “\033[36m==maridb启动成功=\033[0m” else echo -e “\033[31mmariadb启动失败,请检查\033[0m” exit 1 fi sleep 2 }

参考答案:

cat >> /etc/my.cnf << EOF
create database gpmall;
  • 1
  • 2

python 脚本

4、55 Python脚本补全(40分) C

下面有一段Python脚本,由于工程师的失误,将脚本中的某些代码删除了,但注释还在,请根据注释,填写代码。最后将填写的代码按照顺序以文本形式提交至答题框。 Python脚本如下: def get_html(url, encoding=‘utf-8’): # 定义headers headers = { ‘User-Agent’: ‘Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36’ } # 调用requests依赖包的get方法,请求该网址,返回response (此处需填写) # 设置response字符为utf-8 (此处需填写) # 返回response的文本 return response.text

参考答案:

response = requests.get(url, headers=headers)
response.encoding = encoding
  • 1
  • 2

网络

路由器

关闭恶心的提示信息
<Huawei>undo terminal monitor
  • 1
  • 2

41 路由器管理(40分) A

配置R1和R2路由器(路由器使用R2220),R1路由器配置端口g0/0/1地址为192.168.1.1/30,端口g0/0/1连接R2路由器。配置端口g0/0/2地址为192.168.2.1/24,作为内部PC1机网关地址。R2路由器配置端口g0/0/1地址为192.168.1.2/30,端口g0/0/1连接R1路由器,配置端口g0/0/2地址为192.168.3.1/24,作为内部PC2机网关地址。R1和R2路由器启用OSPF动态路由协议自动学习路由。使PC1和PC2可以相互访问。(所有配置命令使用完整命令)将上述所有操作命令及返回结果以文本形式提交到答题框。

参考答案:

[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]ip address 192.168.1.1 30
[Huawei-GigabitEthernet0/0/1]quit
[Huawei]interface GigabitEthernet 0/0/2
[Huawei-GigabitEthernet0/0/2]ip address 192.168.2.1 24
[Huawei-GigabitEthernet0/0/2]quit
[Huawei]ospf 1
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.3
[Huawei-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]ip address 192.168.1.2 30
[Huawei-GigabitEthernet0/0/1]quit
[Huawei]interface GigabitEthernet 0/0/2
[Huawei-GigabitEthernet0/0/2]ip address 192.168.3.1 24
[Huawei-GigabitEthernet0/0/2]quit
[Huawei]ospf 1
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.3
[Huawei-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20

无线AC

42 无线AC管理(40分) A

配置无线AC控制器(型号使用AC6005),开启dhcp功能,设置vlan20网关地址为172.16.20.1/24,并配置vlan20接口服务器池,设置dhcp分发dns为114.114.114.114、223.5.5.5。将上述所有操作命令及返回结果以文本形式提交到答题框。

参考答案:

[SW1]vlan batch 20
[SW1]dhcp enable
[SW1]interface vlanif 20
[SW1-Vlanif20]ip address 172.16.20.1 24
[SW1-Vlanif20]dhcp select interface
[SW1-Vlanif20]dhcp server dns-list 114.114.114.114 223.5.5.5
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

42 无线AC网络管理(40分) C

配置无线AC控制器,设置安全策略Internet,配置安全认证方式为wpa-wpa2,密码为a1234567,设置无线ssid为Internet,创建VAP模板名称为Internet,绑定业务vlan为101,绑定安全策略,绑定SSID模板,创建AP组,名称为ap-group1,绑定vap模板到射频卡0、1上。将上述所有操作命令及返回结果以文本形式提交到答题框。

参考答案:

[AC1-wlan-view]security-profile name Internet
[AC1-wlan-sec-prof-Internet]security wpa-wpa2 psk pass-phrase a1234567 aes
[AC1-wlan-sec-prof-Internet]quit
[AC1-wlan-view]ssid-profile name Internet
[AC1-wlan-ssid-prof-Internet]ssid Internet
[AC1-wlan-ssid-prof-Internet]quit
[AC1-wlan-view]vap-profile name Internet
[AC1-wlan-vap-prof-Internet]forward-mode direct-forward
[AC1-wlan-vap-prof-Internet]service-vlan vlan-id 101
[AC1-wlan-vap-prof-Internet]security-profile Internet
[AC1-wlan-vap-prof-Internet]ssid-profile Internet
[AC1-wlan-vap-prof-Internet]quit
[AC1-wlan-view]ap-group name ap-group1
[AC1-wlan-ap-group-ap-group1]vap-profile Internet wlan 1 radio 0
[AC1-wlan-ap-group-ap-group1]vap-profile Internet wlan 1 radio 1
[AC1-wlan-ap-group-ap-group1]quit
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

交换机

41 交换机管理(40分) B E:41 网络管理(40分)

在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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

42 交换机管理(40分) B

交换机配置:交换机g0/0/1端口连接R1路由器,所属vlan1001,配置地址192.168.1.2/30,与路由器通信。配置g0/0/2连接PC1机,所属vlan101,配置PC1机网关地址为172.16.101.254/24。配置默认路由下一跳为路由器地址。路由器配置:R1路由器g0/0/1端口配置地址12.12.12.1/30,配置端口多路复用PAT配置。R1路由器g0/0/2端口配置地址192.168.1.1/30,连接交换机。路由器配置默认路由访问外部网络,配置静态路由访问PC机网络。(所有配置命令使用完整命令)将上述操作命令及返回结果以文本形式提交到答题框。

参考答案:

[Huawei]vlan batch 101 1001
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type access
[Huawei-GigabitEthernet0/0/1]port default vlan 1001
[Huawei-GigabitEthernet0/0/1]quit
[Huawei]interface vlan 1001
[Huawei-Vlanif1001]ip address 192.168.1.2 30
[Huawei]interface GigabitEthernet 0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type access
[Huawei-GigabitEthernet0/0/2]port default vlan 101
[Huawei-GigabitEthernet0/0/2]quit
[Huawei]interface vlan 101
[Huawei-Vlanif101]ip address 172.16.101.254 24
[Huawei-Vlanif101]quit
[Huawei]ip route-static 0.0.0.0 0 192.168.1.1
[Huawei]acl number 2000
[Huawei-acl-basic-2000]rule 1 permit
[Huawei-acl-basic-2000]quit
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]ip add
[Huawei-GigabitEthernet0/0/1]ip address 12.12.12.1 30
[Huawei-GigabitEthernet0/0/1]nat outbound 2000
[Huawei-GigabitEthernet0/0/1]quit
[Huawei]interface GigabitEthernet 0/0/2
[Huawei-GigabitEthernet0/0/2]ip address 192.168.1.1 30
[Huawei-GigabitEthernet0/0/2]quit
[Huawei]ip route-static 0.0.0.0 0 GigabitEthernet 0/0/1
[Huawei]ip route-static 172.16.101.0 255.255.255.0 192.168.1.2
  • 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

防火墙

41 防火墙管理(40分) C

配置防火墙g0/0/2端口添加至trust域,g0/0/1端口添加至untrust域。配置trust域到untrust域规则,放行内部地址172.16.105.0/24网段。配置NAT规则,匹配内部地址172.16.105.0/24网段,使用g0/0/1端口的地址进行转换。(所有配置命令使用完整命令)将上述所有操作命令及返回结果以文本形式提交到答题框。

参考答案:

[SRG]firewall zone trust
[SRG-zone-trust]add interface GigabitEthernet 0/0/2
[SRG-zone-trust]quit
[SRG]firewall zone untrust
[SRG-zone-untrust]add interface GigabitEthernet 0/0/1
[SRG-zone-untrust]quit
[SRG]policy interzone trust untrust outbound
[SRG-policy-interzone-trust-untrust-outbound]policy 0
[SRG-policy-interzone-trust-untrust-outbound-0]action permit
[SRG-policy-interzone-trust-untrust-outbound-0]policy source 172.16.105.0 0.255.255.255
[SRG-policy-interzone-trust-untrust-outbound-0]quit
[SRG-policy-interzone-trust-untrust-outbound]quit
[SRG]nat-policy interzone trust untrust outbound
[SRG-nat-policy-interzone-trust-untrust-outbound]policy 1
[SRG-nat-policy-interzone-trust-untrust-outbound-1]action source-nat
[SRG-nat-policy-interzone-trust-untrust-outbound-1]policy source 172.16.105.0 0.255.255.255
[SRG-nat-policy-interzone-trust-untrust-outbound-1]easy-ip GigabitEthernet 0/0/1
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

42 防火墙管理(40分) D

配置防火墙g0/0/2为trust域,配置g0/0/1为untrust域,配置g0/0/2地址为10.10.5.1/24,配置g0/0/1端口地址为192.168.10.254/24,配置默认路由下一跳为192.168.10.1,配置从trust域到untrust域策略,匹配放行内部地址为172.16.0.0/16网段,配置从trust域到untrust域nat策略,匹配内部地址为172.16.0.0/16网段,使用g0/0/1端口地址。将上述操作命令及返回结果以文本形式提交到答题框。

参考答案:

[SRG]firewall zone trust
[SRG-zone-trust]add interface GigabitEthernet 0/0/2
[SRG-zone-trust]quit
[SRG]firewall zone untrust
[SRG-zone-untrust]add interface GigabitEthernet 0/0/1
[SRG-zone-untrust]quit
[SRG]interface GigabitEthernet 0/0/2
[SRG-GigabitEthernet0/0/2]ip address 10.10.5.1 24
[SRG-GigabitEthernet0/0/2]quit
[SRG]interface GigabitEthernet 0/0/1
[SRG-GigabitEthernet0/0/1]ip address 192.168.10.254 24
[SRG-GigabitEthernet0/0/1]quit
[SRG]ip route-static 0.0.0.0 0 192.168.10.1
[SRG]policy interzone trust untrust outbound
[SRG-policy-interzone-trust-untrust-outbound]policy 0
[SRG-policy-interzone-trust-untrust-outbound-0]action permit
[SRG-policy-interzone-trust-untrust-outbound-0]policy source 172.16.0.0 0.0.255.255
[SRG-policy-interzone-trust-untrust-outbound-0]quit
[SRG-policy-interzone-trust-untrust-outbound]quit
[SRG]nat-policy interzone trust untrust outbound
[SRG-nat-policy-interzone-trust-untrust-outbound]policy 1
[SRG-nat-policy-interzone-trust-untrust-outbound-1]action source-nat
[SRG-nat-policy-interzone-trust-untrust-outbound-1]policy source 172.16.0.0 0.0.255.255
[SRG-nat-policy-interzone-trust-untrust-outbound-1]easy-ip GigabitEthernet 0/0/1
[SRG-nat-policy-interzone-trust-untrust-outbound-1]quit
[SRG-nat-policy-interzone-trust-untrust-outbound]quit
  • 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

网络管理

41 网络管理(40分) D

通过一条命令在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。将上述操作命令及返回结果以文本形式提交到答题框。

参考答案:

[SW1]vlan batch 101 102
[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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

42 网络管理(40分) E

配置SW1交换机vlan20地址为172.17.20.253/24,配置vrrp虚拟网关为172.17.20.254, vrid为1,配置优先级为120。配置vlan17地址为172.17.17.253/24,配置vrrp虚拟网关为172.17.17.254,vrid为2。配置mstp协议,vlan20为实例1,vlan17为实例2,vlan20在SW1上为主,vlan17在SW1上为备。将上述操作命令以文本形式提交到答题框。

参考答案:

[SW1]interface Vlanif 20
[SW1-Vlanif20]ip address 172.17.20.253 24
[SW1-Vlanif20]vrrp vrid 1 virtual-ip 172.17.20.254
[SW1-Vlanif20]vrrp vrid 1 priority 120
[SW1-Vlanif20]vrrp vrid 1 track interface GigabitEthernet 0/0/4 reduced 15
[SW1-Vlanif20]quit
[SW1]interface Vlanif 17
[SW1-Vlanif17]ip address 172.17.17.253 24
[SW1-Vlanif17]vrrp vrid 2 virtual-ip 172.17.17.254
[SW1-Vlanif17]quit
[SW1]stp region-configuration
[SW1-mst-region]region-name RG1
[SW1-mst-region]instance 1 vlan 20
[SW1-mst-region]instance 2 vlan 17
[SW1-mst-region]active region-configuration
[SW1-mst-region]quit
[SW1]stp instance 1 root primary
[SW1]stp instance 2 root secondary
[SW1]stp pathcost-standard legacy
[SW1]stp enable
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20

yum源

43 YUM源管理(40分) A

若存在一个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
  • 1
  • 2
  • 3
  • 4
  • 5

43 YUM源管理(40分) B C 43 D 43 E 43

假设当前有一个centos7.2-1511.iso的镜像文件,使用这个文件配置yum源,要求将这个镜像文件挂载在/opt/centos目录。还存在一个ftp源,IP地址为192.168.100.200,ftp配置文件中配置为anon_root=/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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

openstack

keystone

域:openstack domain create name
项目:openstack project create --domain xiandian name
用户:openstack user create --domain xiandian --password password --email qq@qq.com name
角色:openstack role create name
用户、角色、项目的绑定:openstack role add --project xiangmu --user yonghu juese
  • 1
  • 2
  • 3
  • 4
  • 5

50 Keystone管理(40分) A

使用提供的“all-in-one”镜像,自行检查openstack中各服务的状态,若有问题自行排查。在keystone中创建用户testuser,密码为password,创建好之后,查看testuser的详细信息。将openstack user show testuser命令的返回结果以文本形式提交到答题框。

source /etc/keystone/admin-openrc.sh 
openstack domain list
openstack user create --domain xiandian --password 000000 testuser
openstack user show testuser
  • 1
  • 2
  • 3
  • 4

参考答案:

[root@xiandian~]# source /etc/keystone/admin-openrc.sh
[root@xiandian~]# openstack user show testuser
+-----------+----------------------------------+
| Field | Value |
+-----------+----------------------------------+
| domain_id | 639e7d52170d4759b5438e3b29bbf339 |
| enabled | True |
| id | df8ca15f17a8435d8889987b4b78c7a2 |
| name | testuser |
+-----------+----------------------------------+
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

50 Keystone管理(40分) B

使用提供的“all-in-one”虚拟机,在keystone中创建用户testuser,密码为password,创建好之后,查看testuser的详细信息,以文本形式提交以上操作命令到答题框。

 source /etc/keystone/admin-openrc.sh 
 openstack domain list
 openstack user create --domain xiandian --password password testuser
 openstack user show testuser
  • 1
  • 2
  • 3
  • 4

参考答案:

[root@xiandian~]# source /etc/keystone/admin-openrc.sh
[root@xiandian~]# openstack user create --domain xiandian --password password testuser
+-----------+----------------------------------+
| Field   | Value              |
+-----------+----------------------------------+
| domain_id | 5a486c51bc8e4dffa4a181f6c54e0938 |
| enabled  | True               |
| id    | ec6d67cdb3ac4b3ca827587c14be0a3e |
| name   | testuser             |
+-----------+----------------------------------+
[root@xiandian~]# openstack user show testuser
+-----------+----------------------------------+
| Field | Value |
+-----------+----------------------------------+
| domain_id | 639e7d52170d4759b5438e3b29bbf339 |
| enabled | True |
| id | df8ca15f17a8435d8889987b4b78c7a2 |
| name | testuser |
+-----------+----------------------------------+
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19

49 Keystone服务运维(40分) D

使用提供的“all-in-one”虚拟机,使用openstack命令,创建一个名称为“alice”账户,密码为“mypassword123”,邮箱为“alice@example.com”。并且创建一个名为“acme”项目。创建一个角色“compute-user”。给用户“alice”分配“acme”项目下的“compute-user”角色。将以上操作命令及结果以文本形式填入答题框。

openstack domain list
openstack user create --domain xiandian --password mypassword123 --email alice@example.com alice
openstack project create --domain xiandian acme
openstack role create compute-user
openstack role add --project acme --user alice compute-user
  • 1
  • 2
  • 3
  • 4
  • 5

参考答案:

[root@xiandian ~]# source /etc/keystone/admin-openrc.sh
[root@xiandian ~]# openstack user create --password mypassword123 --email alice@example.com --domain domain alice
+-----------+----------------------------------+
| Field | Value |
+-----------+----------------------------------+
| domain_id | 3ac89594c8e944a9b5bb567fca4e75aa |
| email | alice@example.com |
| enabled | True |
| id | 17122f34cbf94aba835195bd94758753 |
| name | alice |
+-----------+----------------------------------+
[root@xiandian ~]# openstack project create --domain domain acme
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | |
| domain_id | 3ac89594c8e944a9b5bb567fca4e75aa |
| enabled | True |
| id | b1304aa3b53a4203821c1eef5fcc05fc |
| is_domain | False |
| name | acme |
| parent_id | 3ac89594c8e944a9b5bb567fca4e75aa |
+-------------+----------------------------------+
[root@xiandian ~]# openstack role create compute-user
+-----------+----------------------------------+
| Field | Value |
+-----------+----------------------------------+
| domain_id | None |
| id | 87b10d35ed044038b7bf0960ca2f37c0 |
| name | compute-user |
+-----------+----------------------------------+
[root@xiandian ~]# openstack role add --user alice --project acme compute-user
  • 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

glance

镜像的上传、查看
更新磁盘大小: glance image-update --min-disk=1
  • 1
  • 2

51 Glance管理(40分) A

使用提供的“all-in-one”镜像,自行检查openstack中各服务的状态,若有问题自行排查。使用提供的cirros-0.3.4-x86_64-disk.img镜像;使用glance命令将镜像上传,并命名为mycirros,最后将glance image-show id命令的返回结果以文本形式提交到答题框。

操作步骤:

glance image-create --name mycirros --disk-format qcow2 --container-format bare --progress --file /root/cirros-0.3.4-x86_64-disk.img
glance image-show d3663be2-3ebf-443a-b3fc-b3e39bda8783
  • 1
  • 2

参考答案:

[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 |
+------------------+--------------------------------------+
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21

52 Glance管理(40分) B

登录“all-in-one”节点,使用crt的传输工具将提供的cirros-0.3.4-x86_64-disk.img镜像上传至“all-in-one”节点的/root目录下;使用glance命令将镜像上传,并命名为mycirros,最后使用glance命令查看该镜像的详细信息。将上述所有操作命令和返回结果以文本形式提交到答题框。

glance image-create --name mycirros --disk-format qcow2 --container-format bare --progress --file /root/cirros-0.3.4-x86_64-disk.img
glance image-show 67aa01fb-f172-49b3-ae98-17c4c51724b6
  • 1
  • 2

参考答案:

[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 |
+------------------+--------------------------------------+
  • 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
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44

50 Glance服务运维(40分) D

使用提供的“all-in-one”虚拟机,使用Glance命令,创建一个名称为“cirros”镜像,镜像文件使用提供的为“cirros-0.3.4-x86_64-disk.img”。通过glance 命令查看镜像“cirros”的详细信息。使用glance 命令更新镜像信息min-disk(min-disk默认单位为G)为1G。将以上操作命令及结果以文本形式填入答题框。

glance image-create --name "cirros" --disk-format qcow2 --container-format bare --progress --file /root/cirros-0.3.4-x86_64-disk.img
glance image-show 67aa01fb-f172-49b3-ae98-17c4c51724b6
glance image-update --min-disk=1 67aa01fb-f172-49b3-ae98-17c4c51724b6
  • 1
  • 2
  • 3

参考答案:

[root@xiandian images]# glance image-create --name "cirros" --disk-format qcow2 --container-format bare --progress < cirros-0.3.4-x86_64-disk.img
[=============================>] 100%
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | 64d7c1cd2b6f60c92c14662941cb7913 |
| container_format | bare |
| created_at | 2019-09-28T04:57:59Z |
| disk_format | qcow2 |
| id | db715025-a795-4519-9947-c5acbe2d5788 |
| min_disk | 0 |
| min_ram | 0 |
| name | cirros |
| owner | 0ab2dbde4f754b699e22461426cd0774 |
| protected | False |
| size | 13167616 |
| status | active |
| tags | [] |
| updated_at | 2019-09-28T04:58:00Z |
| virtual_size | None |
| visibility | private |
+------------------+--------------------------------------+
\# glance image-show db715025-a795-4519-9947-c5acbe2d5788
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | 64d7c1cd2b6f60c92c14662941cb7913 |
| container_format | bare |
| created_at | 2019-09-28T04:57:59Z |
| disk_format | qcow2 |
| id | db715025-a795-4519-9947-c5acbe2d5788 |
| min_disk | 0 |
| min_ram | 0 |
| name | cirros |
| owner | 0ab2dbde4f754b699e22461426cd0774 |
| protected | False |
| size | 13167616 |
| status | active |
| tags | [] |
| updated_at | 2019-09-28T04:58:00Z |
| virtual_size | None |
| visibility | private |
+------------------+--------------------------------------+
\# glance image-update --min-disk=1 db715025-a795-4519-9947-c5acbe2d5788
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | 64d7c1cd2b6f60c92c14662941cb7913 |
| container_format | bare |
| created_at | 2019-09-28T04:57:59Z |
| disk_format | qcow2 |
| id | db715025-a795-4519-9947-c5acbe2d5788 |
| min_disk | 1 |
| min_ram | 0 |
| name | cirros |
| owner | 0ab2dbde4f754b699e22461426cd0774 |
| protected | False |
| size | 13167616 |
| status | active |
| tags | [] |
| updated_at | 2019-09-28T05:22:09Z |
| virtual_size | None |
| visibility | private |
+------------------+--------------------------------------+
  • 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
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64

nova

创建云主机类型
查看云主机类型
创建安全组
  • 1
  • 2
  • 3

52 Nova管理(40分) A

使用提供的“all-in-one”镜像,自行检查openstack中各服务的状态,若有问题自行排查。通过nova的相关命令创建名为exam,ID为1234,内存为1024M,硬盘为20G,虚拟内核数量为2的云主机类型,查看exam的详细信息。将nova flavor-show id操作命令的返回结果以文本形式提交到答题框。

[root@controller ~]# nova flavor-create exam 1234 1024 20 2
[root@xiandian ~]# nova flavor-show 1234
  • 1
  • 2

参考答案:

[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 |
+----------------------------+-------+
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

51 Nova服务运维(40分) D

使用提供的“all-in-one”虚拟机,使用Nova命令,创建一个名为test的安全组,描述为’test the nova command about the rules’。并且使用命令创建一个名为test,ID为6,内存为2048 MB,磁盘为20 GB,vcpu数量为2的云主机类型,查看test云主机类型的详细信息。将以上操作命令及结果以文本形式填入答题框。

nova secgroup-create test 'test the nova command about the rules'
nova flavor-create test 6 2048 20 2
nova flavor-show test
  • 1
  • 2
  • 3

参考答案:

\# nova secgroup-create test 'test the nova command about the rules'
+--------------------------------------+------+---------------------------------------+
| Id | Name | Description |
+--------------------------------------+------+---------------------------------------+
| d1ce4ef1-26c8-4b3d-958b-bc778bf283f3 | test | test the nova command about the rules |
+--------------------------------------+------+---------------------------------------+
\# nova flavor-create test 6 2048 20 2
+----+------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+----+------+-----------+------+-----------+------+-------+-------------+-----------+
| 6 | test | 2048 | 20 | 0 | | 2 | 1.0 | True |
+----+------+-----------+------+-----------+------+-------+-------------+-----------+
\# nova flavor-show test
+----------------------------+-------+
| Property | Value |
+----------------------------+-------+
| OS-FLV-DISABLED:disabled | False |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| disk | 20 |
| extra_specs | {} |
| id | 6 |
| name | test |
| os-flavor-access:is_public | True |
| ram | 2048 |
| rxtx_factor | 1.0 |
| swap | |
| vcpus | 2 |
+----------------------------+-------+
  • 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

swift

查询
创建容器
将文件上传到容器
  • 1
  • 2
  • 3

47 swift管理(40分) C

登录“all-in-one”云主机。使用swift相关命令,查询swift对象存储服务可以存储的单个文件大小的最大值,依次将操作命令及返回结果以文本形式提交到答题框。

参考答案:

[root@xiandian ~]# swift capabilities |grep max_file_size
max_file_size: 5368709122
  • 1
  • 2

52 对象存储管理(40分) E B 51

使用提供的“all-in-one”虚拟机,使用openstack命令,创建名为examtest的容器并查询,上传一个aaa.txt(可自行创建)文件到这个容器中并查询。依次将操作命令和返回结果以文本形式提交到答题框。

openstack container create examtest
openstack container list
openstack object create examtest aaa.txt
openstack object list examtest
  • 1
  • 2
  • 3
  • 4

参考答案:

[root@xiandian ~]# openstack container create examtest
+---------------------------------------+-----------+------------------------------------+
| account | container | x-trans-id |
+---------------------------------------+-----------+------------------------------------+
| AUTH_0ab2dbde4f754b699e22461426cd0774 | examtest | tx9e7b54f8042d4a6ca5ccf-005a93daf3 |
+---------------------------------------+-----------+------------------------------------+
[root@xiandian ~]# openstack container list
+----------+
| Name |
+----------+
| examtest |
+----------+
[root@xiandian ~]# openstack object create examtest aaa.txt
+---------+-----------+----------------------------------+
| object | container | etag |
+---------+-----------+----------------------------------+
| aaa.txt | examtest | 45226aa24b72ce0ccc4ff73eefe2e26f |
+---------+-----------+----------------------------------+
[root@xiandian ~]# openstack object list examtest
+---------+
| Name |
+---------+
| aaa.txt |
+---------+
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24

cinder

逻辑卷管理  
简单查询 vgs
详细查询 vgdisplay
创建
——————
创建云硬盘
查看云硬盘信息
创建云硬盘类型
创建带有类型的云硬盘
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

48 cinder管理(40分) C

登录“all-in-one”云主机,使用命令查看当前卷组信息,使用lvcreate命令,创建名称为BlockVloume,大小为2G的lvm逻辑卷,查询该逻辑卷详细信息,依次将操作命令及返回结果以文本形式提交到答题框。

vgs
lvcreate -L +2G -n BlockVolume cinder-volumes
lvdisplay
  • 1
  • 2
  • 3

参考答案:

[root@xiandian ~]# vgs
VG #PV #LV #SN Attr VSize VFree
cinder-volumes 1 0 0 wz--n- 4.75g 4.75g
[root@xiandian ~]# lvcreate -L +2G -n BlockVolume cinder-volumes
Logical volume "BlockVolume" created.
[root@xiandian ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
BlockVolume cinder-volumes -wi-a----- 2.00g
[root@xiandian ~]# lvdisplay
--- Logical volume ---
LV Path /dev/cinder-volumes/BlockVolume
LV Name BlockVolume
VG Name cinder-volumes
LV UUID qv2rgN-k5EQ-3gL7-nx5j-sx32-EeHk-wPrMaK
LV Write Access read/write
LV Creation host, time xiandian, 2018-01-18 03:22:26 +0000
LV Status available
\# open 0
LV Size 2.00 GiB
Current LE 512
Segments 1
Allocation inherit
Read ahead sectors auto
\- currently set to 8192
Block device 252:0
  • 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

51 Cinder服务运维(40分) E

使用提供的“all-in-one”虚拟机,使用Cinder命令,创建一个2 GB的云硬盘extend-demo,并且查看云硬盘信息,创建了一个名为“lvm”的卷类型。通过cinder命令查看现有的卷类型。创建一块带“lvm”标识名为type_test_demo的云硬盘,最后使用命令查看所创建的云硬盘。将以上操作命令及结果以文本形式填入答题框。

cinder create --name extend-demo 2
cinder list
cinder type-create lvm
cinder type-list
cinder create --name type-test-demo --volume-type lvm 1
cinder show type_test_demo
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

参考答案:

\# cinder create --name cinder-volume-demo 2
+--------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2019-09-28T18:59:13.000000 |
| description | None |
| encrypted | False |
| id | 5df3295d-3c92-41f5-95af-c371a3e8b47f |
| metadata | {} |
| migration_status | None |
| multiattach | False |
| name | cinder-volume-demo |
| 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 | creating |
| updated_at | 2019-09-28T18:59:14.000000 |
| user_id | 53a1cf0ad2924532aa4b7b0750dec282 |
| volume_type | None |
+--------------------------------+--------------------------------------+
\# cinder list
+--------------+-----------+---------------------+------+-------------+------------------+-----------+
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+--------------+-----------+---------------------+------+-------------+------------------+-----------+
| 5df3295d-3c92-41f5-95af-c371a3e8b47f | available | cinder-volume-demo | 2 | - | false | |
+--------------+-----------+---------------------+------+-------------+------------------+-----------+
\# cinder type-create lvm
+--------------------------------------+------+-------------+-----------+
| ID | Name | Description | Is_Public |
+--------------------------------------+------+-------------+-----------+
| b247520f-84dd-41cb-a706-4437e7320fa8 | lvm | - | True |
+--------------------------------------+------+-------------+-----------+
\# cinder type-list
+--------------------------------------+------+-------------+-----------+
| ID | Name | Description | Is_Public |
+--------------------------------------+------+-------------+-----------+
| b247520f-84dd-41cb-a706-4437e7320fa8 | lvm | - | True |
+--------------------------------------+------+-------------+-----------+
\# cinder create --name type_test_demo --volume-type lvm 1
+--------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2019-09-28T19:15:14.000000 |
| description | None |
| encrypted | False |
| id | 12d09316-1c9f-43e1-93bd-24e54cbf7ef6 |
| metadata | {} |
| migration_status | None |
| multiattach | False |
| name | type_test_demo |
| os-vol-host-attr:host | None |
| 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 | 1 |
| snapshot_id | None |
| source_volid | None |
| status | creating |
| updated_at | None |
| user_id | 53a1cf0ad2924532aa4b7b0750dec282 |
| volume_type | lvm |
+--------------------------------+--------------------------------------+
\# cinder show type_test_demo
+--------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2019-09-28T19:15:14.000000 |
| description | None |
| encrypted | False |
| id | 12d09316-1c9f-43e1-93bd-24e54cbf7ef6 |
| metadata | {} |
| migration_status | None |
| multiattach | False |
| name | type_test_demo |
| 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 | 1 |
| snapshot_id | None |
| source_volid | None |
| status | available |
| updated_at | 2019-09-28T19:15:15.000000 |
| user_id | 53a1cf0ad2924532aa4b7b0750dec282 |
| volume_type | lvm |
+--------------------------------+--------------------------------------+
  • 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
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105

ceilometer

49 Ceilometer管理(40分) C

登录“all-in-one”云主机。使用ceilometer相关命令,查询测量值的列表信息。依次将操作命令及返回结果以文本形式提交到答题框。

meter    测量值
alarm    警报
——————————————————————————————————————————————————————————————————————————————————————
[root@xiandian ~]# ceilometer meter-list
  • 1
  • 2
  • 3
  • 4

参考答案:

[root@xiandian ~]# ceilometer meter-list
+---------------------------------+-------+-----------+------------------------------------------------+----------------------------------+----------------------------------+
| Name | Type | Unit | Resource ID | User ID | Project ID |
+---------------------------------+-------+-----------+------------------------------------------------+----------------------------------+----------------------------------+
| image | gauge | image | 3bb63ae0-3129-442b-b19f-9f66298132aa | None | 0ab2dbde4f754b699e22461426cd0774 |
| image | gauge | image | 4f4ca979-6fec-425f-84f7-b29be66ca055 | None | 0ab2dbde4f754b699e22461426cd0774 |
| image.size | gauge | B | 3bb63ae0-3129-442b-b19f-9f66298132aa | None | 0ab2dbde4f754b699e22461426cd0774 |
| image.size | gauge | B | 4f4ca979-6fec-425f-84f7-b29be66ca055 | None | 0ab2dbde4f754b699e22461426cd0774 |
| storage.containers.objects | gauge | object | 0ab2dbde4f754b699e22461426cd0774/examcontainer | None | 0ab2dbde4f754b699e22461426cd0774 |
| storage.containers.objects | gauge | object | 0ab2dbde4f754b699e22461426cd0774/mycontainer | None | 0ab2dbde4f754b699e22461426cd0774 |
| storage.containers.objects | gauge | object | 82771f9e78a6482c93facbe85450c8a4/list | None | 82771f9e78a6482c93facbe85450c8a4 |
| storage.containers.objects | gauge | object | 82771f9e78a6482c93facbe85450c8a4/mycontainer | None | 82771f9e78a6482c93facbe85450c8a4 |
| storage.containers.objects.size | gauge | B | 0ab2dbde4f754b699e22461426cd0774/examcontainer | None | 0ab2dbde4f754b699e22461426cd0774 |
| storage.containers.objects.size | gauge | B | 0ab2dbde4f754b699e22461426cd0774/mycontainer | None | 0ab2dbde4f754b699e22461426cd0774 |
| storage.containers.objects.size | gauge | B | 82771f9e78a6482c93facbe85450c8a4/list | None | 82771f9e78a6482c93facbe85450c8a4 |
| storage.containers.objects.size | gauge | B | 82771f9e78a6482c93facbe85450c8a4/mycontainer | None | 82771f9e78a6482c93facbe85450c8a4 |
| storage.objects | gauge | object | 0ab2dbde4f754b699e22461426cd0774 | None | 0ab2dbde4f754b699e22461426cd0774 |
| storage.objects | gauge | object | 20b1ab08ea644670addb52f6d2f2ed61 | None | 20b1ab08ea644670addb52f6d2f2ed61 |
| storage.objects | gauge | object | 82771f9e78a6482c93facbe85450c8a4 | None | 82771f9e78a6482c93facbe85450c8a4 |
| storage.objects | gauge | object | f35885323bac4e4987065a4ca2d364f6 | None | f35885323bac4e4987065a4ca2d364f6 |
| storage.objects.containers | gauge | container | 0ab2dbde4f754b699e22461426cd0774 | None | 0ab2dbde4f754b699e22461426cd0774 |
| storage.objects.containers | gauge | container | 20b1ab08ea644670addb52f6d2f2ed61 | None | 20b1ab08ea644670addb52f6d2f2ed61 |
| storage.objects.containers | gauge | container | 82771f9e78a6482c93facbe85450c8a4 | None | 82771f9e78a6482c93facbe85450c8a4 |
| storage.objects.containers | gauge | container | f35885323bac4e4987065a4ca2d364f6 | None | f35885323bac4e4987065a4ca2d364f6 |
| storage.objects.outgoing.bytes | delta | B | 0ab2dbde4f754b699e22461426cd0774 | None | 0ab2dbde4f754b699e22461426cd0774 |
| storage.objects.outgoing.bytes | delta | B | 20b1ab08ea644670addb52f6d2f2ed61 | None | 20b1ab08ea644670addb52f6d2f2ed61 |
| storage.objects.outgoing.bytes | delta | B | 82771f9e78a6482c93facbe85450c8a4 | None | 82771f9e78a6482c93facbe85450c8a4 |
| storage.objects.outgoing.bytes | delta | B | f35885323bac4e4987065a4ca2d364f6 | None | f35885323bac4e4987065a4ca2d364f6 |
| storage.objects.size | gauge | B | 0ab2dbde4f754b699e22461426cd0774 | None | 0ab2dbde4f754b699e22461426cd0774 |
| storage.objects.size | gauge | B | 20b1ab08ea644670addb52f6d2f2ed61 | None | 20b1ab08ea644670addb52f6d2f2ed61 |
| storage.objects.size | gauge | B | 82771f9e78a6482c93facbe85450c8a4 | None | 82771f9e78a6482c93facbe85450c8a4 |
| storage.objects.size | gauge | B | f35885323bac4e4987065a4ca2d364f6 | None | f35885323bac4e4987065a4ca2d364f6 |
| volume.size | gauge | GB | 56658f68-fb78-4fc9-b6e6-6c55988b9cde | 53a1cf0ad2924532aa4b7b0750dec282 | 0ab2dbde4f754b699e22461426cd0774 |
| volume.size | gauge | GB | 9f685fd4-4f33-4f0c-b70e-467dab381c24 | 53a1cf0ad2924532aa4b7b0750dec282 | 0ab2dbde4f754b699e22461426cd0774 |
| volume.size | gauge | GB | ced33323-c10e-4b7f-a63f-28b8638c1fbf | 53a1cf0ad2924532aa4b7b0750dec282 | 0ab2dbde4f754b699e22461426cd0774 |
+---------------------------------+-------+-----------+------------------------------------------------+----------------------------------+----------------------------------+
  • 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
  • 36

neutron

50 Neutron服务运维(40分) E

使用提供的“all-in-one”虚拟机,使用Neutron命令,查询网络服务的列表信息中的“binary”一列,并且查询网络sharednet1详细信息。然后查询网络服务DHCP agent的详细信息。将以上操作命令及结果以文本形式填入答题框。

[root@xiandian ~]# neutron agent-list -c binary
[root@xiandian ~]# neutron net-list
[root@xiandian ~]# neutron net-show bd923693-d9b1-4094-bd5b-22a038c44827
[root@xiandian ~]# neutron agent-list
[root@xiandian ~]# neutron agent-show a3504292-e108-4ad1-ae86-42ca9ccfde78
  • 1
  • 2
  • 3
  • 4
  • 5

参考答案:

[root@xiandian ~]# neutron agent-list -c binary
+---------------------------+
| binary |
+---------------------------+
| neutron-l3-agent |
| neutron-openvswitch-agent |
| neutron-dhcp-agent |
| neutron-metadata-agent |
+---------------------------+
[root@xiandian ~]# neutron net-list
+--------------------------------------+------------+---------+
| id | name | subnets |
+--------------------------------------+------------+---------+
| bd923693-d9b1-4094-bd5b-22a038c44827 | sharednet1 | |
+--------------------------------------+------------+---------+
\# neutron net-show bd923693-d9b1-4094-bd5b-22a038c44827
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | True |
| availability_zone_hints | |
| availability_zones | 
| created_at | 2017-02-23T04:58:17 |
| description | |
| id | bd923693-d9b1-4094-bd5b-22a038c44827 |
| ipv4_address_scope | |
| ipv6_address_scope | |
| mtu | 1500 |
| name | sharednet1 |
| port_security_enabled | True |
| provider:network_type | flat |
| provider:physical_network | physnet1 |
| provider:segmentation_id | |
| router:external | False |
| shared | True |
| status | ACTIVE |
| subnets | |
| tags | |
| tenant_id | 20b1ab08ea644670addb52f6d2f2ed61 |
| updated_at | 2017-02-23T04:58:17 |
+---------------------------+--------------------------------------+
[root@xiandian ~]# neutron agent-list
+-----------+----------------+----------+-------------------+-------+-------------------+--------------+
| id | agent_type | host | availability_zone | alive | admin_state_up | binary |
+-----------+----------------+----------+-------------------+-------+-------------------+--------------+
| 7dd3ea38-c6fc-4a73-a530-8b007afeb778 | L3 agent | xiandian | nova | :-) | True | neutron-l3-agent |
| 8c0781e7-8b3e-4c9f-a8da-0d4cdc570afb | Open vSwitch agent | xiandian | | :-) | True | neutron-openvswitch-agent |
| a3504292-e108-4ad1-ae86-42ca9ccfde78 | DHCP agent | xiandian | nova | :-) | True | neutron-dhcp-agent |
| be17aa73-deba-411a-ac10-fd523079085d | Metadata agent | xiandian | | :-) | True | neutron-metadata-agent |
+-----------+----------------+----------+-------------------+-------+-------------------+--------------+
[root@xiandian ~]# neutron agent-show a3504292-e108-4ad1-ae86-42ca9ccfde78
+---------------------+----------------------------------------------------------+
| Field | Value |
+---------------------+----------------------------------------------------------+
| admin_state_up | True |
| agent_type | DHCP agent |
| alive | True |
| availability_zone | nova |
| binary | neutron-dhcp-agent |
| configurations | { |
| | "subnets": 1, |
| | "dhcp_lease_duration": 86400, |
| | "dhcp_driver": "neutron.agent.linux.dhcp.Dnsmasq", |
| | "networks": 1, |
| | "log_agent_heartbeats": false, |
| | "ports": 2 |
| | } |
| created_at | 2017-02-23 04:57:05 |
| description | |
| heartbeat_timestamp | 2019-09-28 21:33:06 |
| host | xiandian |
| id | a3504292-e108-4ad1-ae86-42ca9ccfde78 |
| started_at | 2017-02-23 04:57:05 |
| topic | dhcp_agent |
+---------------------+----------------------------------------------------------+
  • 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
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75

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

打包文件
tar zcvf docker.tar.gz Docker/
解压文件
tar zxvf Docker.tar.gz -C /opt/
  • 1
  • 2
  • 3
  • 4
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/561697
推荐阅读
相关标签
  

闽ICP备14008679号