【實(shí)操題】?
41.網(wǎng)絡(luò)管理?
使用本地?PC?機(jī)的?eNSP?環(huán)境,在?eNSP?中使用?S5700?交換機(jī)進(jìn)行配置,通?
過一條命令劃分?vlan 2.vlan 3.vlan 1004,通過端口組的方式配置端口?1-5?為?access?
模式,并添加至?vlan2?中。配置端口?10?為?trunk?模式,并放行?vlan3。創(chuàng)建三層?
vlan 2,配置?IP?地址為:172.16.2.1/24,創(chuàng)建三層?vlan1004,配置?IP?地址為:?
192.168.4.2/30。通過命令添加默認(rèn)路由,下一跳為?192.168.4.1。將上述操作命令?
以文本形式提交到答題框。(使用完整命令,使用?Tab?鍵補(bǔ)齊)(30?分)?
參考答案:?
[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?
42.防火墻管理?
使用本地?PC?機(jī)的?eNSP?環(huán)境,防火墻型號使用?USG5500,配置防火墻?g0/0/2?端?
口添加至?trust?域,g0/0/1?端口添加至?untrust?域。配置?trust?域到?untrust?域規(guī)則,?
放行內(nèi)部地址?172.16.105.0/24?網(wǎng)段。配置?NAT?規(guī)則,匹配內(nèi)部地址?
172.16.105.0/24?網(wǎng)段,使用?g0/0/1?端口的地址進(jìn)行轉(zhuǎn)換。(使用完整命令,使用?
Tab?鍵補(bǔ)齊)(30?分)?
參考答案:?
[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?
43.KVM?管理?
使用?xnode1?節(jié)點(diǎn),完成?KVM?服務(wù)的安裝與?KVM?虛擬機(jī)的啟動(安裝?KVM?組?
件使用?CentOS-7-x86_64-DVD-1511.iso?鏡像源)。安裝完畢后,使用提供的?cirros?
鏡像與?qemu-ifup-NAT?腳本啟動虛擬機(jī)(命令為?qemu-kvm -m 1024 -drive?
file=xxx.img,if=virtio -net nic,model=virtio -net tap,script=xxx -nographic -vnc :1)。?
啟動完畢后將登錄界面從#####debug end######那行開始至最后的內(nèi)容以文本?
形式提交到答題框。(40?分)?
參考答案:?
############ debug end ############## ____ ____ ____ / __/ __ ____ ____ / __?
\/ __/ / /__ / // __// __// /_/ /\ \ \___//_//_/ /_/ \____/___/ http://cirros-cloud.net login as?
'cirros' user. default password: 'cubswin:)'. use 'sudo' for root. cirros login:?
44.Raid?存儲管理?
使用?xnode1?節(jié)點(diǎn),使用?vmware?給?xnode1?節(jié)點(diǎn)添加一塊大小為?20G?的硬盤。使?
用?fdisk?命令對該硬盤進(jìn)形分區(qū),要求分出兩個(gè)大小為?5G?的分區(qū)。使用這兩個(gè)?
分區(qū),創(chuàng)建名為/dev/md0.raid?級別為?1?的磁盤陣列。創(chuàng)建完成后使用?xfs?文件系統(tǒng)進(jìn)形格式化,并掛載到/mnt?目錄下。將?mdadm -D /dev/md0?命令和?df -h?命令?
返回得結(jié)果以文本形式提交到答題框。(40?分)?
參考答案:?
[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?
45.主從數(shù)據(jù)庫管理?
使用?xnode2.xnode3?虛擬機(jī)進(jìn)行實(shí)驗(yàn),在這兩臺虛擬機(jī)上安裝?mariadb?數(shù)據(jù)庫服?
務(wù),并配置為主從數(shù)據(jù)庫(xnode2?為主節(jié)點(diǎn).xnode3?為從節(jié)點(diǎn),安裝數(shù)據(jù)庫使用?
CentOS-7-x86_64-DVD-1511.iso?和?gpmall-repo?這兩個(gè)源),實(shí)現(xiàn)兩個(gè)數(shù)據(jù)庫的?
主從同步。配置完畢后,請?jiān)?xnode3?上的數(shù)據(jù)庫中執(zhí)行“show slave status \G”命?
令查詢從節(jié)點(diǎn)復(fù)制狀態(tài),將查詢到的結(jié)果以文本形式提交到答題框。(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)?
46.讀寫分離數(shù)據(jù)庫管理?
使用?xnode1,xnode2,xnode3?三個(gè)節(jié)點(diǎn),完成數(shù)據(jù)庫讀寫分離實(shí)驗(yàn)(安裝數(shù)據(jù)?
庫使用?CentOS-7-x86_64-DVD-1511.iso?和?gpmall-repo?這兩個(gè)源)。數(shù)據(jù)庫中間?
件使用?Mycat-server-1.6-RELEASE-20161028204710-linux.tar。完成?Mycat?讀寫分?
離數(shù)據(jù)庫的配置安裝。需要用的配置文件?schema.xml?文件如下所示(server.xml?
文件不再給出):select user()配置讀寫分離數(shù)據(jù)庫完畢后:1.使用?netstat -ntpl?命?
令查詢端口啟動情況;2.登陸?mycat,查詢數(shù)據(jù)庫。將上述兩個(gè)操作的操作命令?
返回結(jié)果以文本形式提交到答題框。(30?分)?
參考答案:?
[root@mycat ~]# 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:22 0.0.0.0:* LISTEN?
1400/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2353/master tcp 0 0?
127.0.0.1:32000 0.0.0.0:* LISTEN 10427/java tcp6 0 0 :::9066 :::* LISTEN?
10427/java tcp6 0 0 :::35056 :::* LISTEN 10427/java tcp6 0 0 :::22 :::* LISTEN?
1400/sshd tcp6 0 0 ::1:25 :::* LISTEN 2353/master tcp6 0 0 :::37982 :::* LISTEN 10427/java tcp6 0 0 :::1984 :::* LISTEN 10427/java tcp6 0 0 :::8066 :::* LISTEN?
10427/java?
[root@mycat ~]# mysql -h127.0.0.1 -P8066 -uroot -p123456?
Welcome to the MariaDB monitor. Commands end with ; or \g. Your MySQL?
connection id is 2 Server version: 5.6.29-mycat-1.6-RELEASE-20161028204710?
MyCat Server (OpenCloundDB) Copyright (c) 2000, 2018, Oracle, MariaDB?
Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current?
input statement. MySQL [(none)]> show databases; +----------+ | DATABASE |?
+----------+ | USERDB | +----------+ 1 row in set (0.001 sec)?
47.Zookeeper?集群?
繼續(xù)使用上題的三臺虛擬機(jī),使用提供的軟件包,完成?Zookeeper?集群的安裝與?
配置,配置完成后,在相應(yīng)的目錄使用./zkServer.sh status?命令查看三個(gè)?Zookeeper?
節(jié)點(diǎn)的狀態(tài),將三個(gè)節(jié)點(diǎn)的狀態(tài)以文本形式提交到答題框。(30?分)?
參考答案:?
[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?
48.Kafka?集群?
繼續(xù)使用上題的三臺虛擬機(jī),使用提供軟件包,完成?Kafka?集群的安裝與配置,?
配置完成后,查看三個(gè)節(jié)點(diǎn)?Kafka?的端口啟動情況并在相應(yīng)的目錄使用./kafka-topics.sh --create --zookeeper?你的?IP:2181 --replication-factor 1?
--partitions 1 --topic test?創(chuàng)建?topic,將查看?Kafka?端口啟動情況和創(chuàng)建?topic?命令?
的返回結(jié)果以文本形式提交到答題框。(30?分)?
參考答案:?
# netstat -ntpl |grep 9092?
tcp6 0 0 192.168.200.11:9092 :::* LISTEN 4975/java?
[root@zookeeper1 bin]# ./kafka-topics.sh --create --zookeeper 172.16.51.23:2181?
--replication-factor 1 --partitions 1 --topic test Created topic "test".?
49.應(yīng)用商城系統(tǒng)?
繼續(xù)使用上題的三臺虛擬機(jī),使用提供的軟件包,基于集群應(yīng)用系統(tǒng)部署。部署?
完成后,進(jìn)行登錄,(訂單中填寫的收貨地址填寫自己學(xué)校的地址,收貨人填寫?
自己的實(shí)際聯(lián)系方式)最后使用?curl?命令去獲取商城首頁的返回信息,將?curl?
http://你自己的商城?IP/#/home?獲取到的結(jié)果以文本形式提交到答題框。(40?分)?
參考答案:?
[root@server ~]# curl http://172.30.11.27/#/home <!DOCTYPE?
html><html><head><meta charset=utf-8><title>1+x-示例項(xiàng)目</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;?50.Glance?服務(wù)運(yùn)維?
使用?VMWare?軟件啟動提供的?opensatckallinone?鏡像,自行檢查?openstack?中各?
服務(wù)的狀態(tài),若有問題自行排查。使用?Glance?命令,創(chuàng)建一個(gè)名稱為“cirros”鏡?
像,鏡像文件使用?xnode1?鏡像中提供的為“cirros-0.3.4-x86_64-disk.img”。通過?
glance?命令查看鏡像“cirros”的詳細(xì)信息。將上述所有操作命令及返回結(jié)果以文?
本形式填入答題框。(20?分)?
參考答案:?
[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 |?
+------------------+--------------------------------------+
?51.Neutron?服務(wù)運(yùn)維?
使用?VMWare?軟件啟動提供的?opensatckallinone?鏡像,自行檢查?openstack?中各?
服務(wù)的狀態(tài),若有問題自行排查。使用?Neutron?命令,查詢網(wǎng)絡(luò)服務(wù)的列表信息?
中的“binary”一列,并且查詢網(wǎng)絡(luò)?sharednet1?詳細(xì)信息。然后查詢網(wǎng)絡(luò)服務(wù)?DHCP?
agent?的詳細(xì)信息。將以上操作命令及結(jié)果以文本形式填入答題框。(40?分)?
參考答案:?
[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 | +---------------------+----------------------------------------------------------+?
52.Cinder?服務(wù)運(yùn)維?
使用?VMWare?軟件啟動提供的?opensatckallinone?鏡像,自行檢查?openstack?中各?
服務(wù)的狀態(tài),若有問題自行排查。使用?Cinder?命令,創(chuàng)建一個(gè)?2 GB?的云硬盤?
extend-demo,并且查看云硬盤信息,創(chuàng)建了一個(gè)名為“l(fā)vm”的卷類型。通過?cinder?
命令查看現(xiàn)有的卷類型。創(chuàng)建一塊帶“l(fā)vm”標(biāo)識名為?type_test_demo?的云硬盤,?
最后使用命令查看所創(chuàng)建的云硬盤。將以上操作命令及結(jié)果以文本形式填入答題?
框。(40?分)?
參考答案:# 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 | +--------------------------------+--------------------------------------+?53.對象存儲管理?
使用?VMWare?軟件啟動提供的?opensatckallinone?鏡像,自行檢查?openstack?中各?
服務(wù)的狀態(tài),若有問題自行排查。使用?openstack?命令,創(chuàng)建名為?examtest?的容?
器并查詢,上傳一個(gè)?aaa.txt(可自行創(chuàng)建)文件到這個(gè)容器中并查詢。依次將操?
作命令和返回結(jié)果以文本形式提交到答題框。(30?分)?
參考答案:?
[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 | +---------+?
54.Docker?使用?
使用?VMWare?軟件啟動提供的?k8sallinone?鏡像,該鏡像已安裝?docker?服務(wù)。創(chuàng)?
建/opt/xiandian?目錄,創(chuàng)建完成后啟動名為?xiandian-dir,鏡像為?nginx_latest.tar?
的容器(鏡像在/root/images?目錄下),并指定/opt/xiandian?為容器啟動的數(shù)據(jù)卷,指定?nginx?的?80?端口映射到外部?81?端口。創(chuàng)建完成后通過?inspect?命令指定查?
看數(shù)據(jù)卷的情況。將以上操作命令及返回結(jié)果以文本形式填入答題框。(30?分)?
參考答案:?
[root@master ~]# mkdir /opt/xiandian?
[root@master ~]# docker run -itd --name xiandian-dir -v /opt/xiandian -p 81:80?
nginx:latest /bin/bash?
e103676b5199ff766cb06b71fcb4c438fc083b4d4e044863db0944370c0fb914?
[root@master ~]# docker inspect -f '{{.Config.Volumes}}' xiandian-dir?
map[/opt/xiandian:{}]?
55.Docker Compose?
使用?VMWare?軟件啟動提供的?k8sallinone?鏡像,完成?docker compose?案例,?
compose?案例所有用到的文件均在/root/compose?目錄下,需要用到的鏡像均在?
/root/images?目錄下。理解?docker compose?的原理與工作流程,在/root?目錄下新?
建?composetest?目錄作為工作目錄,理解提供的配置文件與部署文件,運(yùn)行?docker?
compose?案例。運(yùn)行成功后,使用?curl?命令訪問?http://IP:5000。最后將運(yùn)行?
docker-compose up?的結(jié)果和?curl?的結(jié)果以文本形式提交到答題框。(30?分)?
參考答案:?
[root@master composetest]# docker-compose up?
Building web Step 1/4 : FROM python:3.5-alpine ---> 96b4e8050dda Step 2/4 : ADD .?
/code ---> 61ddeca19fc4 Step 3/4 : WORKDIR /code ---> Running in bc3d9a0a6e52?
Removing intermediate container bc3d9a0a6e52 ---> a1fed72666b9 Step 4/4 : CMD?
["python", "app.py"] ---> Running in 63d2ddf47472 Removing intermediate container?
63d2ddf47472 ---> 08bab6135480 Successfully built 08bab6135480 Successfully?
tagged composetest_web:latest WARNING: Image for service web was built because?
it did not already exist. To rebuild this image you must use `docker-compose build` or?
`docker-compose up --build`. Creating composetest_web_1 ... done Creating?
composetest_redis_1 ... done Attaching to composetest_redis_1, composetest_web_1 redis_1 | 1:C 11 May 2020 12:41:24.126 # oO0OoO0OoO0Oo Redis is starting?
oO0OoO0OoO0Oo redis_1 | 1:C 11 May 2020 12:41:24.126 # Redis version=5.0.6,?
bits=64, commit=00000000, modified=0, pid=1, just started redis_1 | 1:C 11 May?
2020 12:41:24.126 # 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 11 May?
2020 12:41:24.128 * Running mode=standalone, port=6379. redis_1 | 1:M 11 May?
2020 12:41:24.128 # 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?
11 May 2020 12:41:24.128 # Server initialized redis_1 | 1:M 11 May 2020?
12:41:24.128 # 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 11 May 2020?
12:41:24.128 # 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 11 May 2020 12:41:24.128 * 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:?
124-577-743?
[root@master ~]# curl 192.168.100.20:5000?
Hello World! I have been seen 1 times.?
56.K8S?平臺安裝使用?VMWare?軟件啟動提供的?k8sallinone?鏡像,確認(rèn)?IP?地址,執(zhí)行/root?目錄下?
的?install.sh?腳本進(jìn)行一鍵部署?K8S?平臺。等待安裝完畢后使用?kubectl?命令查看?
nodes.cs.pods?的狀態(tài),將查看的命令與返回結(jié)果以文本形式提交到答題框。(30?
分)?
參考答案:?
[root@master ~]# kubectl get nodes?
NAME STATUS ROLES AGE VERSION?
master Ready master 56m v1.14.1?
[root@master ~]# kubectl get cs?
NAME STATUS MESSAGE ERROR?
scheduler Healthy ok controller-manager Healthy ok?
etcd-0 Healthy {"health":"true"}?
[root@master ~]# kubectl get pods -n kube-system?
NAME READY STATUS RESTARTS AGE coredns-8686dcc4fd-mhsw5 1/1?
Running 0 60s coredns-8686dcc4fd-sgmgc 1/1 Running 0 60s etcd-master 1/1?
Running 0 15s kube-apiserver-master 1/1 Running 0 17s?
kube-flannel-ds-amd64-dqg24 1/1 Running 0 54s kube-proxy-q62n6 1/1 Running 0?
60s kubernetes-dashboard-5f7b999d65-dnrnz 1/1 Running 0 44s?
57.K8S?平臺使用?
使用上一題安裝完成的?K8S?平臺,進(jìn)行?K8S?平臺的使用與運(yùn)維。完成下面實(shí)驗(yàn)。?
實(shí)驗(yàn):運(yùn)行?nginx?應(yīng)用,使用?kubectl?命令運(yùn)行?nginx?應(yīng)用,要求使用?nginx_latest.tar?
鏡像,只使用本地鏡像不向外拉取,副本數(shù)為?4。運(yùn)行成功后,使用命令查看?pods?
狀態(tài).將?80?端口放出,最后使用?curl?命令查看?nginx?首頁。將上述操作命令與返?
回結(jié)果以文本形式提交到答題框。(40?分)?
參考答案:?
root@master ~]# kubectl run nginx --image=nginx:latest --image-pull-policy=Never?
--replicas=4 kubectl run --generator=deployment/apps.v1 is DEPRECATED and will be removed?
in a future version. Use kubectl run --generator=run-pod/v1 or kubectl create instead.?
deployment.apps/nginx created?
[root@master ~]# kubectl expose deploy/nginx --port 80?
service/nginx exposed?
[root@master ~]# kubectl get svc?
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE kubernetes ClusterIP?
10.96.0.1 <none> 443/TCP 3h18m nginx ClusterIP 10.100.220.6 <none> 80/TCP 9s?
[root@master ~]# curl 10.100.220.6:80?
<!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> <style> body?
{ width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; }?
</style> </head> <body> <h1>Welcome to nginx!</h1> <p>If you see this page, the?
nginx web server is successfully installed and working. Further configuration is?
required.</p> <p>For online documentation and support please refer to <a?
>nginx.org</a>.<br/> Commercial support is available at <a?
>nginx.com</a>.</p> <p><em>Thank you for using?
nginx.</em></p> </body> </html>?
58.Ansible?腳本?
使用?xnode1?節(jié)點(diǎn),該節(jié)點(diǎn)已經(jīng)安裝了?Ansible?服務(wù),使用?xnode1?節(jié)點(diǎn)作為?Ansible?
的母機(jī),首先配置?Ansible?的?hosts?文件,將?xnode2?和?xnode3?加入到?hosts?中,?
并使用?Ansible?命令?ping?下?hosts?內(nèi)的主機(jī)。然后使用?Ansible?命令將本地的?
/etc/hosts?文件復(fù)制到?xnode2?和?xnode3?節(jié)點(diǎn)的/root?目錄下。將執(zhí)行的兩個(gè)?Ansible?
命令和返回結(jié)果以文本形式提交到答題框。(40?分)?
參考答案:?
[root@xnode1 ~]# ansible all -m ping 192.168.200.13?
| SUCCESS => { "ansible_facts": { "discovered_interpreter_python":?
"/usr/bin/python" }, "changed": false, "ping": "pong" } 192.168.200.12 | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed":?
false, "ping": "pong" }?
[root@xnode1 ~]# ansible host -m copy -a "src=/etc/hosts dest=/root"?
192.168.200.13 | CHANGED => { "ansible_facts": { "discovered_interpreter_python":?
"/usr/bin/python" }, "changed": true, "checksum":?
"7335999eb54c15c67566186bdfc46f64e0d5a1aa", "dest": "/root/hosts", "gid": 0,?
"group": "root", "md5sum": "54fb6627dbaa37721048e4549db3224d", "mode":?
"0644", "owner": "root", "secontext": "system_u:object_r:admin_home_t:s0", "size":?
158, "src":?
"/root/.ansible/tmp/ansible-tmp-1589216530.26-2930-194839602799100/source",?
"state": "file", "uid": 0 } 192.168.200.12 | CHANGED => { "ansible_facts":?
{ "discovered_interpreter_python": "/usr/bin/python" }, "changed": true, "checksum":?
"7335999eb54c15c67566186bdfc46f64e0d5a1aa", "dest": "/root/hosts", "gid": 0,?
"group": "root", "md5sum": "54fb6627dbaa37721048e4549db3224d", "mode":?
"0644", "owner": "root", "secontext": "system_u:object_r:admin_home_t:s0", "size":?
158, "src":?
"/root/.ansible/tmp/ansible-tmp-1589216530.25-2928-166732987871246/source",?文章來源:http://www.zghlxwxcb.cn/news/detail-753141.html
"state": "file", "uid": 0 }文章來源地址http://www.zghlxwxcb.cn/news/detail-753141.html
到了這里,關(guān)于云計(jì)算中級實(shí)操題的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!