当前位置:   article > 正文

1+X云计算平台运维与开发认证(中级)样卷C-实操过程_1+x云计算平台运维与开发中级样卷c

1+x云计算平台运维与开发中级样卷c

相关内容:

选择题可能有些题目有点小问题,请酌情参考,主要还是以实操为主

单选题(200分)

  1. 下面对项目管理叙述错误的是(10分)
    A、项目文档管理是指在一个项目运行过程中将提交的各类文档进行收集管理控制的过程
    B、工程项目保存的文档要涵盖项目可研、总体设计、基础设计、详细设计等整个项目周期
    C、项目经理可以从项目周期角度去把握项目进展情况(正确答案)
    D、项目保存的文档包括项目系统管理、文档版本控制、文档质量管理等管理内容
  2. 项目计划阶段不包括(10分)
    A、里程碑和基线时间设定
    B、人员安排
    C、风险预测
    D、一份项目工作任务书(正确答案)
  3. 以下哪个不是FAT AP的特点 (10分)
    A、简单的无线接入
    B、自行管理
    C、无缝漫游(正确答案)
    D、独立提供无线网络
  4. 以下哪个不是FIT AP的特点 (10分)
    A、可以独立提供无线网络(正确答案)
    B、集中管理
    C、三层漫游
    D、基于用户下发权限
  5. 数据库主服务器将更新写入二进制日志文件,并维护文件的一个_来跟踪日志循环。(10分)
    A、内容
    B、索引(正确答案)
    C、编号
    D、顺序
  6. 在主服务器上执行的SQL语句,在从服务器上执行同样的语句。MySQL默认采用_,效率比较高。(10分)
    A、基于索引的复制
    B、基于日志的复制
    C、基于语句的复制(正确答案)
    D、基于主服务器复制
  7. Nginx的启动后台中主进程的作用是什么?(10分)
    A、启动需要的进程
    B、管理其他主进程
    C、与其他进程通信
    D、管理工作者进程(正确答案)
  8. 操作Nginx时需要与哪个进程进行通讯?(10分)
    A、主进程(正确答案)
    B、通讯进程
    C、网络进程
    D、worker进程
  9. OpenStack系统架构中各个组件之间的通信核心组件是?(10分)
    A、Mysql
    B、Keystone(正确答案)
    C、Glance
    D、Nova
  10. 下列选项当中,哪个是Swift创建容器的命令(10分)
    A、swift post(正确答案)
    B、swift create
    C、swift found
    D、swift establish
  11. 以下关于Swift服务的描述错误的是?(10分)
    A、Swift通过REST API接口来访问数据,可以通过API变成实现文件的存储和管理,使得资源管理实现自动化。
    B、Swift提供多重备份机制,拥有极高的数据可靠性,数据存放在高分布式的Swift系统中,几乎不会丢失。
    C、Swift通过独立节点来形成存储系统,但在数据量的存储上不能做到无限拓展。(正确答案)
    D、Swift的性能可以通过增加Swift集群来实现线性提升,所以Swift很难达到性能瓶颈。
  12. 腾讯云使用的计算虚拟化技术是以下哪项?(10分)
    A、Xen
    B、KVM(正确答案)
    C、Citrix
    D、VMware
  13. 下列哪个不属于客户上云的典型价值?(10分)
    A、异地灾备
    B、节省投资
    C、简化运维
    D、增强机房管理(正确答案)
  14. 下列腾讯云主机安全组件,描述正确的是?(10分)
    A、腾讯云主机安全组件是一系列软件的组成,可提供任何类型的安全防御
    B、腾讯云主机安全组件会导致云服务器性能下降
    C、腾讯云主机安全组件主要压力在平台上,并不会导致客户云服务器性能大量下降(正确答案)
    D、以上皆对
  15. 您维护了一个音视频APP,但是您发现用户的连接成功率并不高,您分析后发现连接失败的原因大多数都是因为解析超时或缓慢造成的,您应该如何做才可以解决问题,让APP中的音乐保持流畅?(10分)
    A、使用腾讯云监控平台检测服务质量
    B、使用腾讯云HttpDNS服务(正确答案)
    C、使用腾讯云拔测平台检测全国范围内的服务质量
    D、使用腾讯云CDN加速
  16. 下面哪个是Docker Swarm中一个部署的最小单元?(10分)
    A、Stack
    B、Yaml
    C、Task(正确答案)
    D、Service
  17. 下面哪个公司是OpenShift的开发公司?(10分)
    A、 谷歌
    B、 微软
    C、 红帽(正确答案)
    D、 亚马逊
  18. Shell本身是用哪种语言编写的程序?(10分)
    A、Python
    B、C语言(正确答案)
    C、Java
    D、PHP
  19. Ansible是基于_进行工作的。(10分)
    A、任务集
    B、模块(正确答案)
    C、进程
    D、框架
  20. Ansible通过_实现配置管理、应用部署、任务执行等功能。(10分)
    A、FTP
    B、SSH(正确答案)
    C、HTTP
    D、TCP

 

多选题(200分)

  1. 关于开发阶段叙述正确的是(10分)
    A、采用构建工具进行自动化版本构建,避免人为操作失误(正确答案)
    B、软件的包、版本进行统一管理,避免不同版本的直接冲突(正确答案)
    C、注意各个环境的一致性,保证构建脚本执行成功(正确答案)
    D、提高软件工程中模块构建的耦合度,提高软件功能模块构建系统的灵活性
  2. 下面对测试人员在设计和执行测试时的重要原则描述正确的是(10分)
    A、测试用例需清晰定义对预期的输入和输出;(正确答案)
    B、彻底检查每个测试的执行结果(正确答案)
    C、测试用例的编写不仅应当根据有效和预料到的输入情况,而且也应当考虑无效和未预料到的输入情况(正确答案)
    D、检查程序是否“未做其应该做的”仅是测试的一半,测试的另一半是检查程序是否“做了其不应该做的”(正确答案)
  3. 属于无线AP的安全措施的是 (10分)
    A、隐藏SSID(正确答案)
    B、启用WEP(正确答案)
    C、启用MAC地址过滤(正确答案)
    D、启用DHCP服务
  4. 以上可以工作在2.4GHz频段的无线协议是 (10分)
    A、802.11a
    B、802.11n(正确答案)
    C、802.11g(正确答案)
    D、802.11b(正确答案)
  5. 网络地址172.16.1.0/24,选择子网掩码为255.255.255.224,以下说法正确的是 (10分)
    A、划分了4个有效子网
    B、划分了6个有效子网(正确答案)
    C、每个子网的有效主机数是30个(正确答案)
    D、每个子网的有效主机数是32个
  6. 如何在命令行查看一台linux机器的CPU、SWAP分区信息、硬盘信息?(10分)
    A、cat /proc/cpuinfo(正确答案)
    B、du(正确答案)
    C、cat /proc/swaps(正确答案)
    D、df -lh
  7. 下列哪些是数据库的优化方案?(10分)
    A、 memcache(正确答案)
    B、分表(正确答案)
    C、搜索引擎(正确答案)
    D、主从分离(正确答案)
  8. kafka有哪些重要的设计思想?(10分)
    A、 消息持久化(正确答案)
    B、 消息有效期(正确答案)
    C、 批量发送(正确答案)
    D、 分区机制partition(正确答案)
  9. 下列提法中,属于ifconfig命令作用范围的是。(10分)
    A、配置本地回环地址(正确答案)
    B、配置网卡的IP地址(正确答案)
    C、激活网络适配器(正确答案)
    D、加载网卡到内核中
  10. 下列选项当中,哪些说法是正确的(10分)
    A、nova start是创建云主机
    B、nova restart是重启云主机(正确答案)
    C、nova boot是启动云主机
    D、nova reset是重建云主机(正确答案)
  11. Neutron网络形式主要包括以下哪些?(10分)
    A、Flat(正确答案)
    B、VLAN(正确答案)
    C、GRE(正确答案)
    D、VXLAN(正确答案)
  12. 下列选项当中,哪些是典型的私有云平台(10分)
    A、3A Cloud(正确答案)
    B、OpenStack(正确答案)
    C、OATOS(正确答案)
    D、Utility
  13. 公司业务在选择合适的腾讯云服务器时需要考虑的原则有?(10分)
    A、成本(正确答案)
    B、计算能力(正确答案)
    C、IO时延要求(正确答案)
    D、其他需求(正确答案)
  14. 创建云主机时,可以购买的网络带宽有哪几个计费标准?(10分)
    A、按使用流量计费(正确答案)
    B、按带宽计费(正确答案)
    C、按时长计费
    D、以上皆无
  15. 腾讯云 VPC提供了灵活、高性能的 Internet 连接方式包括下列哪些方法?(10分)
    A、对端网关
    B、VPN 通道
    C、弹性 IP(正确答案)
    D、NAT 网关(正确答案)
  16. 腾讯为什么能提供云服务?(10分)
    A、强大的基础设施(正确答案)
    B、丰富的大规模管理经验:基于QQ、QQ空间等海量服务考验;经微信、腾讯游戏等海量业务的技术锤炼(正确答案)
    C、采购能力及研发能力:可以降低云产品的成本并提供业界领先的计算、网络和存储性能(正确答案)
    D、业务能力:基于互联网业务大量的数据沉淀和经验积累后,能够提供了文字识别,图像识别,语音设别和人脸识别等服务能力(正确答案)
  17. 下面关于Docker Image的说法,正确的是?(10分)
    A、 镜像是一个只读模板(正确答案)
    B、 由Dockerfile文本描述镜像的内容(正确答案)
    C、 镜像定义类似面向过程的类
    D、 构建一个镜像实际就是安装、配置和运行的过程(正确答案)
  18. 下面属于OpenShift内部的部分核心组件和概念的是(10分)
    A、 Master Node(正确答案)
    B、 Scheduler
    C、 Compute Node(正确答案)
    D、 Etcd(正确答案)
  19. Ansible任务执行包含以下哪两种模式_。(10分)
    A、fixedRate模式
    B、ad-hoc模式(正确答案)
    C、playbook模式(正确答案)
    D、cron模式
  20. Python模块化的优点_。(10分)
    A、提高了代码的可维护性(正确答案)
    B、效率高(正确答案)
    C、避免函数名称和变量名称重复(正确答案)
    D、可移植性

 

实操题(600分)

1. 防火墙管理(40分)

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

架构图(考试时命令对就行了,只用 一台FW1就够了,但为了学到东西所以练习时采用完整的部署方案)

FW1配置:

  1. <SRG>system-view
  2. [SRG]sysname FW1
  3. [FW1]firewall zone trust
  4. [FW1-zone-trust]add interface GigabitEthernet 0/0/2
  5. [FW1-zone-trust]quit
  6. [FW1]firewall zone untrust
  7. [FW1-zone-untrust]add interface GigabitEthernet 0/0/1
  8. [FW1-zone-untrust]quit
  9. [FW1]policy interzone trust untrust outbound
  10. [FW1-policy-interzone-trust-untrust-outbound]policy 0
  11. [FW1-policy-interzone-trust-untrust-outbound-0]action permit
  12. [FW1-policy-interzone-trust-untrust-outbound-0]policy source 172.16.105.0 0.255.255.255
  13. [FW1-policy-interzone-trust-untrust-outbound-0]quit
  14. [FW1-policy-interzone-trust-untrust-outbound]quit
  15. [FW1]nat-policy interzone trust untrust outbound
  16. [FW1-nat-policy-interzone-trust-untrust-outbound]policy 1
  17. [FW1-nat-policy-interzone-trust-untrust-outbound-1]action source-nat
  18. [FW1-nat-policy-interzone-trust-untrust-outbound-1]policy source 172.16.105.0 0.255.255.255
  19. [FW1-nat-policy-interzone-trust-untrust-outbound-1]easy-ip GigabitEthernet 0/0/1
  20. [FW1-nat-policy-interzone-trust-untrust-outbound-1]quit
  21. [FW1-nat-policy-interzone-trust-untrust-outbound]quit
  22. [FW1]interface GigabitEthernet 0/0/1
  23. [FW1-GigabitEthernet0/0/1]ip address 192.168.200.2 24
  24. [FW1-GigabitEthernet0/0/1]quit
  25. [FW1]interface GigabitEthernet 0/0/2
  26. [FW1-GigabitEthernet0/0/2]ip address 172.16.105.2 24
  27. [FW1-GigabitEthernet0/0/2]quit
  28. [FW1]ospf 1
  29. [FW1-ospf-1]area 0
  30. [FW1-ospf-1-area-0.0.0.0]network 192.168.200.0 0.0.0.255
  31. [FW1-ospf-1-area-0.0.0.0]network 172.16.105.0 0.0.0.255
  32. [FW1-ospf-1-area-0.0.0.0]quit
  33. [FW1-ospf-1]quit

 

R1配置:

  1. <Huawei>system-view
  2. [Huawei]sysname R1
  3. [R1]interface GigabitEthernet 0/0/1
  4. [R1-GigabitEthernet0/0/1]ip address 172.16.104.1 24
  5. [R1-GigabitEthernet0/0/1]quit
  6. [R1]interface GigabitEthernet 0/0/2
  7. [R1-GigabitEthernet0/0/2]ip address 172.16.105.1 24
  8. [R1-GigabitEthernet0/0/2]quit
  9. [R1]ospf 1
  10. [R1-ospf-1]area 0
  11. [R1-ospf-1-area-0.0.0.0]network 172.16.104.0 0.0.0.255
  12. [R1-ospf-1-area-0.0.0.0]network 172.16.105.0 0.0.0.255
  13. [R1-ospf-1-area-0.0.0.0]quit
  14. [R1-ospf-1]quit

 

测试:

先使用PC1去ping与一下Cloud1的地址

在随便启动一台虚拟机来互ping

我虚拟机IP:192.168.200.40

PC1:

 

2. 无线AC网络管理(40分)

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

架构图(考试时命令对就行了,只用 一台AC就够了,但为了学到东西所以练习时采用完整的部署方案)

AC1配置:

  1. <AC6005>system-view
  2. [AC6005]sysname AC1
  3. [AC1]vlan batch 100 101
  4. [AC1]dhcp enable
  5. [AC1]interface Vlanif 101
  6. [AC1-Vlanif101]description USER
  7. [AC1-Vlanif101]ip address 172.16.20.1 24
  8. [AC1-Vlanif101]dhcp select interface
  9. [AC1-Vlanif101]dhcp server dns-list 114.114.114.114 223.5.5.5
  10. [AC1-Vlanif101]quit
  11. [AC1]interface Vlanif 100
  12. [AC1-Vlanif100]description AP_Manage
  13. [AC1-Vlanif100]ip address 192.168.10.254 24
  14. [AC1-Vlanif100]dhcp select interface
  15. [AC1-Vlanif100]quit
  16. [AC1]capwap source interface Vlanif 100
  17. [AC1]wlan
  18. [AC1-wlan-view]regulatory-domain-profile name office-domain
  19. [AC1-wlan-regulate-domain-office-domain]country-code CN
  20. [AC1-wlan-regulate-domain-office-domain]quit
  21. [AC1-wlan-view]ssid-profile name internet
  22. [AC1-wlan-ssid-prof-internet]ssid internet
  23. [AC1-wlan-ssid-prof-internet]quit
  24. [AC1-wlan-view]security-profile name internet
  25. [AC1-wlan-sec-prof-internet]security wpa-wpa2 psk pass-phrase a1234567 aes
  26. [AC1-wlan-sec-prof-internet]quit
  27. [AC1-wlan-view]vap-profile name internet
  28. [AC1-wlan-vap-prof-internet]forward-mode direct-forward
  29. [AC1-wlan-vap-prof-internet]security-profile internet
  30. [AC1-wlan-vap-prof-internet]ssid-profile internet
  31. [AC1-wlan-vap-prof-internet]service-vlan vlan-id 101
  32. [AC1-wlan-vap-prof-internet]quit
  33. [AC1-wlan-view]ap-group name ap-group1
  34. [AC1-wlan-ap-group-ap-group1]regulatory-domain-profile office-domain
  35. Warning: Modifying the country code will clear channel, power and antenna gain c
  36. onfigurations of the radio and reset the AP. Continue?[Y/N]:y
  37. [AC1-wlan-ap-group-ap-group1]vap-profile internet wlan 1 radio 0
  38. [AC1-wlan-ap-group-ap-group1]vap-profile internet wlan 1 radio 1
  39. [AC1-wlan-ap-group-ap-group1]quit

 

获取AP的mac(点击设置):

 

此图像的alt属性为空;文件名为image-3.png

 

  1. [AC1-wlan-view]ap-id 0 ap-mac 00E0-FC99-4730
  2. [AC1-wlan-ap-0]ap-group ap-group1
  3. Warning: This operation may cause AP reset. If the country code changes, it will
  4. clear channel, power and antenna gain configurations of the radio, Whether to c
  5. ontinue? [Y/N]:y
  6. Info: This operation may take a few seconds. Please wait for a moment.. done.
  7. [AC1-wlan-ap-0]quit
  8. [AC1-wlan-view]quit
  9. [AC1]interface GigabitEthernet 0/0/1
  10. [AC1-GigabitEthernet0/0/1]port link-type trunk
  11. [AC1-GigabitEthernet0/0/1]port trunk allow-pass vlan 100 101
  12. [AC1-GigabitEthernet0/0/1]quit

 

SW1配置:

  1. <Huawei>system-view
  2. [Huawei]sysname SW1
  3. [SW1]vlan batch 100 101
  4. [SW1]interface GigabitEthernet 0/0/24
  5. [SW1-GigabitEthernet0/0/24]description to_AC
  6. [SW1-GigabitEthernet0/0/24]port link-type trunk
  7. [SW1-GigabitEthernet0/0/24]port trunk allow-pass vlan 100 101
  8. [SW1-GigabitEthernet0/0/24]quit
  9. [SW1]interface GigabitEthernet 0/0/1
  10. [SW1-GigabitEthernet0/0/1]description to_AP
  11. [SW1-GigabitEthernet0/0/1]port link-type trunk
  12. [SW1-GigabitEthernet0/0/1]port trunk pvid vlan 100
  13. [SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan 100 101
  14. [SW1-GigabitEthernet0/0/1]quit

 

结果(随便点个连接WiFi的机子查IP):

发现主机以及获得地址了

 

3.YUM源管理(40分)

假设当前有一个centos7.2-1511.iso的镜像文件,使用这个文件配置yum源,要求将这个镜像文件挂载在/opt/centos目录。还存在一个ftp源,IP地址为192.168.100.200,ftp配置文件中配置为anon_root=/opt,/opt目录中存在一个iaas目录(该目录下存在一个repodata目录)请问如何配置自己的local.repo文件,使得可以使用这两个地方的软件包,安装软件。请将local.repo文件的内容以文本形式提交到答题框。

  • 这题是假设有这些东西,写对就行了,或者使用一个xserver1做vsftpd服务,将centos7.2-1511.iso上传到xserver2

xserver2:

  1. [root@xserver2 ~]# systemctl stop firewalld
  2. [root@xserver2 ~]# systemctl disable firewalld
  3. # 注释:selinux防火墙,设置访问模式(得重启才生效):
  4. [root@xserver2 ~]# vim /etc/selinux/config
  5. # 注释:将SELINUX=enforcing改成SELINUX=Permissive
  6. SELINUX=Permissive
  7. # 注释:配置临时访问模式(无需重启):
  8. [root@xserver2 ~]# setenforce 0
  9. [root@xserver2 ~]# getenforce
  10. Permissive
  11. [root@xserver2 ~]# mount -o loop CentOS-7-x86_64-DVD-1511.iso /opt/centos/
  12. mount: /dev/loop0 is write-protected, mounting read-only
  13. [root@xserver2 ~]# cat /etc/yum.repos.d/local.repo
  14. [centos]
  15. name=centos
  16. baseurl=file:///opt/centos
  17. enabled=1
  18. gpgcheck=0
  19. [iaas]
  20. name=iaas
  21. baseurl=ftp://192.168.100.200/iaas
  22. enabled=1
  23. gpgcheck=0

 

4. KVM管理(40分)

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

  • 将kvm_yum上传到root目录,将qemu-ifup-NAT.txt重命名为qemu-ifup-NAT.sh:
  1. [root@localhost ~]# vim /etc/yum.repos.d/local.repo
  2. [centos]
  3. name=centos
  4. baseurl=file:///opt/centos
  5. enabled=1
  6. gpgcheck=0
  7. [kvm]
  8. name=kvm
  9. baseurl=file:///root/kvm_yum
  10. enabled=1
  11. gpgcheck=0
  12. [root@localhost ~]# yum install -y qemu-kvm openssl libvirt
  13. [root@localhost ~]# systemctl restart libvirtd
  14. [root@localhost ~]# ln -sv /usr/libexec/qemu-kvm /usr/bin/qemu-kvm
  15. /usr/bin/qemu-kvm’ ->/usr/libexec/qemu-kvm’
  16. [root@localhost ~]# mv qemu-ifup-NAT.txt qemu-ifup-NAT.sh
  17. [root@localhost ~]# chmod +x qemu-ifup-NAT.sh
  18. [root@localhost ~]# 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.sh -nographic
  19. Could not access KVM kernel module: No such file or directory
  20. failed to initialize KVM: No such file or directory
  21. Back to tcg accelerator.
  22. Warning:dnsmasq is already running. No need to run it again.
  23. SeaBIOS (version 1.11.0-2.el7)
  24. iPXE (http://ipxe.org) 00:03.0 C980 PCI2.10 PnP PMM+3FF94780+3FED4780 C980
  25. Booting from Hard Disk...
  26. GRUB Loading stage1.5.
  27. GRUB loading, please wait...
  28. Starting up ..
  29. [ 0.000000] Initializing cgroup subsys cpuset
  30. [ 0.000000] Initializing cgroup subsys cpu
  31. [ 0.000000] Linux version 3.2.0-80-virtual (buildd@batsu) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1)
  32. [ 0.000000] Command line: LABEL=cirros-rootfs ro console=tty1 console=ttyS0
  33. [ 0.000000] KERNEL supported cpus:
  34. [ 0.000000] Intel GenuineIntel
  35. [ 0.000000] AMD AuthenticAMD
  36. [ 0.000000] Centaur CentaurHauls
  37. [ 0.000000] BIOS-provided physical RAM map:
  38. [ 0.000000] BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
  39. [ 0.000000] BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
  40. [ 0.000000] BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
  41. [ 0.000000] BIOS-e820: 0000000000100000 - 000000003fffc000 (usable)
  42. [ 0.000000] BIOS-e820: 000000003fffc000 - 0000000040000000 (reserved)
  43. [ 0.000000] BIOS-e820: 00000000fffc0000 - 0000000100000000 (reserved)
  44. [ 0.000000] NX (Execute Disable) protection: active
  45. [ 0.000000] SMBIOS 2.4 present.
  46. [ 0.000000] No AGP bridge found
  47. [ 0.000000] last_pfn = 0x3fffc max_arch_pfn = 0x400000000
  48. [ 0.000000] x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106
  49. [ 0.000000] found SMP MP-table at [ffff8800000f63b0] f63b0
  50. [ 0.000000] init_memory_mapping: 0000000000000000-000000003fffc000
  51. [ 0.000000] RAMDISK: 37c92000 - 37ff0000
  52. [ 0.000000] ACPI: RSDP 00000000000f6210 00014 (v00 BOCHS )
  53. [ 0.000000] ACPI: RSDT 000000003ffffad7 00030 (v01 BOCHS BXPCRSDT 00000001 BXPC 00000001)
  54. [ 0.000000] ACPI: FACP 000000003ffff177 00074 (v01 BOCHS BXPCFACP 00000001 BXPC 00000001)
  55. [ 0.000000] ACPI: DSDT 000000003fffe040 01137 (v01 BOCHS BXPCDSDT 00000001 BXPC 00000001)
  56. [ 0.000000] ACPI: FACS 000000003fffe000 00040
  57. [ 0.000000] ACPI: SSDT 000000003ffff1eb 00874 (v01 BOCHS BXPCSSDT 00000001 BXPC 00000001)
  58. [ 0.000000] ACPI: APIC 000000003ffffa5f 00078 (v01 BOCHS BXPCAPIC 00000001 BXPC 00000001)
  59. [ 0.000000] No NUMA configuration found
  60. [ 0.000000] Faking a node at 0000000000000000-000000003fffc000
  61. [ 0.000000] Initmem setup node 0 0000000000000000-000000003fffc000
  62. [ 0.000000] NODE_DATA [000000003fff7000 - 000000003fffbfff]
  63. [ 0.000000] Zone PFN ranges:
  64. [ 0.000000] DMA 0x00000010 -> 0x00001000
  65. [ 0.000000] DMA32 0x00001000 -> 0x00100000
  66. [ 0.000000] Normal empty
  67. [ 0.000000] Movable zone start PFN for each node
  68. [ 0.000000] early_node_map[2] active PFN ranges
  69. [ 0.000000] 0: 0x00000010 -> 0x0000009f
  70. [ 0.000000] 0: 0x00000100 -> 0x0003fffc
  71. [ 0.000000] ACPI: PM-Timer IO Port: 0x608
  72. [ 0.000000] ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)
  73. [ 0.000000] ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1])
  74. [ 0.000000] ACPI: IOAPIC (id[0x00] address[0xfec00000] gsi_base[0])
  75. [ 0.000000] IOAPIC[0]: apic_id 0, version 17, address 0xfec00000, GSI 0-23
  76. [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
  77. [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 high level)
  78. [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
  79. [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 high level)
  80. [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 high level)
  81. [ 0.000000] Using ACPI (MADT) for SMP configuration information
  82. [ 0.000000] SMP: Allowing 1 CPUs, 0 hotplug CPUs
  83. [ 0.000000] PM: Registered nosave memory: 000000000009f000 - 00000000000a0000
  84. [ 0.000000] PM: Registered nosave memory: 00000000000a0000 - 00000000000f0000
  85. [ 0.000000] PM: Registered nosave memory: 00000000000f0000 - 0000000000100000
  86. [ 0.000000] Allocating PCI resources starting at 40000000 (gap: 40000000:bffc0000)
  87. [ 0.000000] Booting paravirtualized kernel on bare hardware
  88. [ 0.000000] setup_percpu: NR_CPUS:64 nr_cpumask_bits:64 nr_cpu_ids:1 nr_node_ids:1
  89. [ 0.000000] PERCPU: Embedded 27 pages/cpu @ffff88003fc00000 s78848 r8192 d23552 u2097152
  90. [ 0.000000] Built 1 zonelists in Node order, mobility grouping on. Total pages: 257926
  91. [ 0.000000] Policy zone: DMA32
  92. [ 0.000000] Kernel command line: LABEL=cirros-rootfs ro console=tty1 console=ttyS0
  93. [ 0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
  94. [ 0.000000] Checking aperture...
  95. [ 0.000000] No AGP bridge found
  96. [ 0.000000] Memory: 1012360k/1048560k available (6576k kernel code, 452k absent, 35748k reserved, 6)
  97. [ 0.000000] SLUB: Genslabs=15, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
  98. [ 0.000000] Hierarchical RCU implementation.
  99. [ 0.000000] RCU dyntick-idle grace-period acceleration is enabled.
  100. [ 0.000000] NR_IRQS:4352 nr_irqs:256 16
  101. [ 0.000000] Console: colour VGA+ 80x25
  102. [ 0.000000] console [tty1] enabled
  103. [ 0.000000] console [ttyS0] enabled
  104. [ 0.000000] allocated 8388608 bytes of page_cgroup
  105. [ 0.000000] please try 'cgroup_disable=memory' option if you don't want memory cgroups
  106. [ 0.000000] Fast TSC calibration failed
  107. [ 0.000000] TSC: Unable to calibrate against PIT
  108. [ 0.000000] TSC: using PMTIMER reference calibration
  109. [ 0.000000] Detected 3390.935 MHz processor.
  110. [ 0.028662] Calibrating delay loop (skipped), value calculated using timer frequency.. 6781.87 Bogo)
  111. [ 0.029371] pid_max: default: 32768 minimum: 301
  112. [ 0.032001] Security Framework initialized
  113. [ 0.033556] AppArmor: AppArmor initialized
  114. [ 0.033685] Yama: becoming mindful.
  115. [ 0.036002] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)
  116. [ 0.036002] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
  117. [ 0.036002] Mount-cache hash table entries: 256
  118. [ 0.036002] Initializing cgroup subsys cpuacct
  119. [ 0.036002] Initializing cgroup subsys memory
  120. [ 0.036002] Initializing cgroup subsys devices
  121. [ 0.036002] Initializing cgroup subsys freezer
  122. [ 0.036002] Initializing cgroup subsys blkio
  123. [ 0.036002] Initializing cgroup subsys perf_event
  124. [ 0.036002] mce: CPU supports 10 MCE banks
  125. [ 0.036002] SMP alternatives: switching to UP code
  126. [ 0.085713] Freeing SMP alternatives: 24k freed
  127. [ 0.086261] ACPI: Core revision 20110623
  128. [ 0.102019] ftrace: allocating 26610 entries in 105 pages
  129. [ 0.118594] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
  130. [ 0.156009] CPU0: AMD QEMU Virtual CPU version 1.5.3 stepping 03
  131. [ 0.156009] APIC calibration not consistent with PM-Timer: 139ms instead of 100ms
  132. [ 0.156009] APIC delta adjusted to PM-Timer: 6249992 (8743536)
  133. [ 0.156009] Performance Events: Broken PMU hardware detected, using software events only.
  134. [ 0.156492] NMI watchdog disabled (cpu0): hardware events not enabled
  135. [ 0.156993] Brought up 1 CPUs
  136. [ 0.157131] Total of 1 processors activated (6781.87 BogoMIPS).
  137. [ 0.166195] devtmpfs: initialized
  138. [ 0.179266] EVM: security.selinux
  139. [ 0.179359] EVM: security.SMACK64
  140. [ 0.179427] EVM: security.capability
  141. [ 0.187359] print_constraints: dummy:
  142. [ 0.188202] RTC time: 10:13:19, date: 05/22/20
  143. [ 0.189085] NET: Registered protocol family 16
  144. [ 0.192172] ACPI: bus type pci registered
  145. [ 0.193548] PCI: Using configuration type 1 for base access
  146. [ 0.202485] bio: create slab <bio-0> at 0
  147. [ 0.204800] ACPI: Added _OSI(Module Device)
  148. [ 0.204908] ACPI: Added _OSI(Processor Device)
  149. [ 0.204996] ACPI: Added _OSI(3.0 _SCP Extensions)
  150. [ 0.205084] ACPI: Added _OSI(Processor Aggregator Device)
  151. [ 0.226640] ACPI: Interpreter enabled
  152. [ 0.226764] ACPI: (supports S0 S5)
  153. [ 0.227204] ACPI: Using IOAPIC for interrupt routing
  154. [ 0.248481] ACPI: No dock devices found.
  155. [ 0.248617] HEST: Table not found.
  156. [ 0.248734] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
  157. [ 0.250625] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
  158. [ 0.252569] pci_root PNP0A03:00: host bridge window [io 0x0000-0x0cf7]
  159. [ 0.252759] pci_root PNP0A03:00: host bridge window [io 0x0d00-0xffff]
  160. [ 0.252901] pci_root PNP0A03:00: host bridge window [mem 0x000a0000-0x000bffff]
  161. [ 0.253036] pci_root PNP0A03:00: host bridge window [mem 0x40000000-0xfebfffff]
  162. [ 0.258912] pci 0000:00:01.3: quirk: [io 0x0600-0x063f] claimed by PIIX4 ACPI
  163. [ 0.259224] pci 0000:00:01.3: quirk: [io 0x0700-0x070f] claimed by PIIX4 SMB
  164. [ 0.284776] pci0000:00: Unable to request _OSC control (_OSC support mask: 0x1e)
  165. [ 0.297311] ACPI: PCI Interrupt Link [LNKA] (IRQs 5 *10 11)
  166. [ 0.297999] ACPI: PCI Interrupt Link [LNKB] (IRQs 5 *10 11)
  167. [ 0.298483] ACPI: PCI Interrupt Link [LNKC] (IRQs 5 10 *11)
  168. [ 0.298952] ACPI: PCI Interrupt Link [LNKD] (IRQs 5 10 *11)
  169. [ 0.299238] ACPI: PCI Interrupt Link [LNKS] (IRQs *9)
  170. [ 0.301682] vgaarb: device added: PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none
  171. [ 0.301984] vgaarb: loaded
  172. [ 0.302057] vgaarb: bridge control possible 0000:00:02.0
  173. [ 0.303180] i2c-core: driver [aat2870] using legacy suspend method
  174. [ 0.303331] i2c-core: driver [aat2870] using legacy resume method
  175. [ 0.304483] SCSI subsystem initialized
  176. [ 0.305723] usbcore: registered new interface driver usbfs
  177. [ 0.306042] usbcore: registered new interface driver hub
  178. [ 0.306686] usbcore: registered new device driver usb
  179. [ 0.308657] PCI: Using ACPI for IRQ routing
  180. [ 0.313022] NetLabel: Initializing
  181. [ 0.313105] NetLabel: domain hash size = 128
  182. [ 0.313177] NetLabel: protocols = UNLABELED CIPSOv4
  183. [ 0.313905] NetLabel: unlabeled traffic allowed by default
  184. [ 0.369076] AppArmor: AppArmor Filesystem Enabled
  185. [ 0.369652] pnp: PnP ACPI init
  186. [ 0.369833] ACPI: bus type pnp registered
  187. [ 0.375223] pnp: PnP ACPI: found 6 devices
  188. [ 0.375341] ACPI: ACPI bus type pnp unregistered
  189. [ 0.394684] Switching to clocksource acpi_pm
  190. [ 0.395149] NET: Registered protocol family 2
  191. [ 0.406185] IP route cache hash table entries: 32768 (order: 6, 262144 bytes)
  192. [ 0.410624] TCP established hash table entries: 131072 (order: 9, 2097152 bytes)
  193. [ 0.412790] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes)
  194. [ 0.413739] TCP: Hash tables configured (established 131072 bind 65536)
  195. [ 0.413889] TCP reno registered
  196. [ 0.414060] UDP hash table entries: 512 (order: 2, 16384 bytes)
  197. [ 0.414254] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
  198. [ 0.415193] NET: Registered protocol family 1
  199. [ 0.415484] pci 0000:00:00.0: Limiting direct PCI/PCI transfers
  200. [ 0.415638] pci 0000:00:01.0: PIIX3: Enabling Passive Release
  201. [ 0.415842] pci 0000:00:01.0: Activating ISA DMA hang workarounds
  202. [ 0.422966] Trying to unpack rootfs image as initramfs...
  203. [ 0.429911] audit: initializing netlink socket (disabled)
  204. [ 0.430417] type=2000 audit(1590142399.428:1): initialized
  205. [ 0.561790] HugeTLB registered 2 MB page size, pre-allocated 0 pages
  206. [ 0.578889] VFS: Disk quotas dquot_6.5.2
  207. [ 0.579617] Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
  208. [ 0.589481] fuse init (API version 7.17)
  209. [ 0.590323] msgmni has been set to 1977
  210. [ 0.613806] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
  211. [ 0.614254] io scheduler noop registered
  212. [ 0.614375] io scheduler deadline registered (default)
  213. [ 0.614735] io scheduler cfq registered
  214. [ 0.615718] pci_hotplug: PCI Hot Plug PCI Core version: 0.5
  215. [ 0.616355] pciehp: PCI Express Hot Plug Controller Driver version: 0.4
  216. [ 0.618371] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
  217. [ 0.618865] ACPI: Power Button [PWRF]
  218. [ 0.634672] ERST: Table is not found!
  219. [ 0.634790] GHES: HEST is not enabled!
  220. [ 0.636666] ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 11
  221. [ 0.636902] virtio-pci 0000:00:03.0: PCI INT A -> Link[LNKC] -> GSI 11 (level, high) -> IRQ 11
  222. [ 0.725351] ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 10
  223. [ 0.725602] virtio-pci 0000:00:04.0: PCI INT A -> Link[LNKD] -> GSI 10 (level, high) -> IRQ 10
  224. [ 0.726699] Serial: 8250/16550 driver, 32 ports, IRQ sharing enabled
  225. [ 0.748340] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
  226. [ 0.805971] 00:05: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
  227. [ 0.834595] Linux agpgart interface v0.103
  228. [ 0.849149] brd: module loaded
  229. [ 0.861034] loop: module loaded
  230. [ 0.874798] vda: vda1
  231. [ 0.894087] Freeing initrd memory: 3448k freed
  232. [ 0.896830] scsi0 : ata_piix
  233. [ 0.897847] scsi1 : ata_piix
  234. [ 0.898286] ata1: PATA max MWDMA2 cmd 0x1f0 ctl 0x3f6 bmdma 0xc060 irq 14
  235. [ 0.898422] ata2: PATA max MWDMA2 cmd 0x170 ctl 0x376 bmdma 0xc068 irq 15
  236. [ 0.901392] Fixed MDIO Bus: probed
  237. [ 0.901708] tun: Universal TUN/TAP device driver, 1.6
  238. [ 0.901797] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
  239. [ 0.908111] PPP generic driver version 2.4.2
  240. [ 0.909758] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
  241. [ 0.910003] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
  242. [ 0.910201] uhci_hcd: USB Universal Host Controller Interface driver
  243. [ 0.910680] usbcore: registered new interface driver libusual
  244. [ 0.911227] i8042: PNP: PS/2 Controller [PNP0303:KBD,PNP0f13:MOU] at 0x60,0x64 irq 1,12
  245. [ 0.913292] serio: i8042 KBD port at 0x60,0x64 irq 1
  246. [ 0.913554] serio: i8042 AUX port at 0x60,0x64 irq 12
  247. [ 0.914713] mousedev: PS/2 mouse device common for all mice
  248. [ 0.916900] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input1
  249. [ 0.918165] rtc_cmos 00:01: RTC can wake from S4
  250. [ 0.919431] rtc_cmos 00:01: rtc core: registered rtc_cmos as rtc0
  251. [ 0.919785] rtc0: alarms up to one day, 114 bytes nvram
  252. [ 0.920627] device-mapper: uevent: version 1.0.3
  253. [ 0.922066] device-mapper: ioctl: 4.22.0-ioctl (2011-10-19) initialised: dm-devel@redhat.com
  254. [ 0.922602] cpuidle: using governor ladder
  255. [ 0.922717] cpuidle: using governor menu
  256. [ 0.922791] EFI Variables Facility v0.08 2004-May-17
  257. [ 0.924595] TCP cubic registered
  258. [ 0.925278] NET: Registered protocol family 10
  259. [ 0.931603] NET: Registered protocol family 17
  260. [ 0.931764] Registering the dns_resolver key type
  261. [ 0.934698] registered taskstats version 1
  262. [ 1.013651] Magic number: 4:873:224
  263. [ 1.014233] rtc_cmos 00:01: setting system clock to 2020-05-22 10:13:20 UTC (1590142400)
  264. [ 1.014437] powernow-k8: Processor cpuid 6d3 not supported
  265. [ 1.015351] BIOS EDD facility v0.16 2004-Jun-25, 0 devices found
  266. [ 1.015464] EDD information not available.
  267. [ 1.064256] ata2.00: ATAPI: QEMU DVD-ROM, 1.5.3, max UDMA/100
  268. [ 1.065808] ata2.00: configured for MWDMA2
  269. [ 1.070890] scsi 1:0:0:0: CD-ROM QEMU QEMU DVD-ROM 1.5. PQ: 0 ANSI: 5
  270. [ 1.074738] sr0: scsi3-mmc drive: 4x/4x cd/rw xa/form2 tray
  271. [ 1.074937] cdrom: Uniform CD-ROM driver Revision: 3.20
  272. [ 1.077154] sr 1:0:0:0: Attached scsi generic sg0 type 5
  273. [ 1.086555] Freeing unused kernel memory: 928k freed
  274. [ 1.102980] Write protecting the kernel read-only data: 12288k
  275. [ 1.128858] Freeing unused kernel memory: 1596k freed
  276. [ 1.147351] Freeing unused kernel memory: 1184k freed
  277. info: initramfs: up at 1.23
  278. NOCHANGE: partition 1 is size 64260. it cannot be grown
  279. info: initramfs loading root from /dev/vda1
  280. info: /etc/init.d/rc.sysinit: up at 1.90
  281. info: container: none
  282. Starting logging: OK
  283. modprobe: module virtio_blk not found in modules.dep
  284. modprobe: module virtio_net not found in modules.dep
  285. WARN: /etc/rc3.d/S10-load-modules failed
  286. Initializing random number generator... done.
  287. Starting acpid: OK
  288. cirros-ds 'local' up at 2.91
  289. no results found for mode=local. up 3.16. searched: nocloud configdrive ec2
  290. Starting network...
  291. udhcpc (v1.20.1) started
  292. Sending discover...
  293. Sending select for 192.168.122.89...
  294. Lease of 192.168.122.89 obtained, lease time 3600
  295. cirros-ds 'net' up at 6.76
  296. checking http://169.254.169.254/2009-04-04/instance-id
  297. failed 1/20: up 7.00. request failed
  298. failed 2/20: up 19.34. request failed
  299. failed 3/20: up 31.84. request failed
  300. failed 4/20: up 44.06. request failed
  301. failed 5/20: up 56.30. request failed
  302. failed 6/20: up 68.69. request failed
  303. failed 7/20: up 81.10. request failed
  304. failed 8/20: up 93.30. request failed
  305. failed 9/20: up 105.62. request failed
  306. failed 10/20: up 117.91. request failed
  307. failed 11/20: up 130.15. request failed
  308. failed 12/20: up 142.46. request failed
  309. failed 13/20: up 154.73. request failed
  310. failed 14/20: up 167.19. request failed
  311. failed 15/20: up 179.45. request failed
  312. failed 16/20: up 191.85. request failed
  313. failed 17/20: up 204.14. request failed
  314. failed 18/20: up 216.41. request failed
  315. failed 19/20: up 228.79. request failed
  316. failed 20/20: up 241.07. request failed
  317. failed to read iid from metadata. tried 20
  318. no results found for mode=net. up 253.35. searched: nocloud configdrive ec2
  319. failed to get instance-id of datasource
  320. Starting dropbear sshd: generating rsa key... generating dsa key... OK
  321. === system information ===
  322. Platform: Red Hat KVM
  323. Container: none
  324. Arch: x86_64
  325. CPU(s): 1 @ 3390.935 MHz
  326. Cores/Sockets/Threads: 1/1/1
  327. Virt-type: AMD-V
  328. RAM Size: 995MB
  329. Disks:
  330. NAME MAJ:MIN SIZE LABEL MOUNTPOINT
  331. vda 253:0 41126400
  332. vda1 253:1 32901120 cirros-rootfs /
  333. sr0 11:0 1073741312
  334. === sshd host keys ===
  335. -----BEGIN SSH HOST KEY KEYS-----
  336. ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgl4Xw51xDUhlJtF6/Yw9tjhW4yvcVKZaqXGS4GpyenRqnuJxqkpsDD4QFehMHOV+yjs
  337. ssh-dss AAAAB3NzaC1kc3MAAACBAMuvp15NiGynOnim7Fk/P8jd2+sZMMQNm4aNiqFkARD/wgIBrFNTvapQWoJBGZNKeMafPKzueys
  338. -----END SSH HOST KEY KEYS-----
  339. === network info ===
  340. if-info: lo,up,127.0.0.1,8,::1
  341. if-info: eth0,up,192.168.122.89,24,fe80::5054:ff:fe12:3456
  342. ip-route:default via 192.168.122.1 dev eth0
  343. ip-route:192.168.122.0/24 dev eth0 src 192.168.122.89
  344. === datasource: None None ===
  345. === cirros: current=0.3.4 uptime=255.67 ===
  346. ____ ____ ____
  347. / __/ __ ____ ____ / __ \/ __/
  348. / /__ / // __// __// /_/ /\ \
  349. \___//_//_/ /_/ \____/___/
  350. http://cirros-cloud.net
  351. login as 'cirros' user. default password: 'cubswin:)'. use 'sudo' for root.
  352. cirros login: cirros
  353. Password:
  354. $ ip addr list
  355. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
  356. link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  357. inet 127.0.0.1/8 scope host lo
  358. inet6 ::1/128 scope host
  359. valid_lft forever preferred_lft forever
  360. 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
  361. link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
  362. inet 192.168.122.89/24 brd 192.168.122.255 scope global eth0
  363. inet6 fe80::5054:ff:fe12:3456/64 scope link
  364. valid_lft forever preferred_lft forever
  365. $ route -n
  366. Kernel IP routing table
  367. Destination Gateway Genmask Flags Metric Ref Use Iface
  368. 0.0.0.0 192.168.122.1 0.0.0.0 UG 0 0 0 eth0
  369. 192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
  370. # 注释:退出进入的系统(先按Ctrl+A,再按X):

 

5.主从数据库管理(40分)

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

  • 上传gpmall-repo中有mariadb子文件的文件到/root目录下:

Mysql1:

  1. [root@xiandian ~]# hostnamectl set-hostname mysql1
  2. [root@mysql1 ~]# login
  3. [root@mysql1 ~]# vim /etc/hosts
  4. 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
  5. ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
  6. 192.168.1.111 mysql1
  7. 192.168.1.112 mysql2
  8. [root@mysql1 ~]# systemctl stop firewalld
  9. [root@mysql1 ~]# systemctl disable firewalld
  10. [root@mysql1 ~]# setenforce 0
  11. [root@mysql1 ~]# vim /etc/selinux/config
  12. SELINUX=Permissive
  13. [root@mysql1~]# vim /etc/yum.repos.d/local.repo
  14. [centos]
  15. name=centos
  16. baseurl=file:///opt/centos
  17. enabled=1
  18. gpgcheck=0
  19. [mariadb]
  20. name=mariadb
  21. baseurl=file:///root/gpmall-repo
  22. enabled=1
  23. gpgcheck=0
  24. [root@mysql1 ~]# yum install -y mariadb mariadb-server
  25. [root@mysql1 ~]# systemctl restart mariadb
  26. [root@mysql1 ~]# mysql_secure_installation
  27. [root@mysql1 ~]# vim /etc/my.cnf
  28. # 注释:在[mysqld]下添加:
  29. log_bin = mysql-bin
  30. binlog_ignore_db = mysql
  31. server_id = 10
  32. [root@mysql1 ~]# mysql -uroot -p000000
  33. Welcome to the MariaDB monitor. Commands end with ; or \g.
  34. Your MariaDB connection id is 3
  35. Server version: 5.5.65-MariaDB MariaDB Server
  36. Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
  37. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  38. MariaDB [(none)]> grant all privileges on *.* to 'root'@'%' identified by '000000';
  39. Query OK, 0 rows affected (0.00 sec)
  40. # 注释:如果你不想配置上面的host文件可以不使用主机名mysql2的形式,可以直接打IP地址,用户可以随意指定,只是一个用于连接的而已
  41. MariaDB [(none)]> grant replication slave on *.* to 'user'@'mysql2' identified by '000000';
  42. Query OK, 0 rows affected (0.00 sec)

 

Mysql2:

  1. [root@xiandian ~]# hostnamectl set-hostname mysql2
  2. [root@mysql2 ~]# login
  3. [root@mysql2 ~]# vim /etc/hosts
  4. 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
  5. ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
  6. 192.168.1.111 mysql1
  7. 192.168.1.112 mysql2
  8. [root@mysql2 ~]# systemctl stop firewalld
  9. [root@mysql2 ~]# systemctl disable firewalld
  10. [root@mysql2 ~]# setenforce 0
  11. [root@mysql2 ~]# vim /etc/selinux/config
  12. SELINUX=Permissive
  13. [root@mysql2~]# vim /etc/yum.repos.d/local.repo
  14. [centos]
  15. name=centos
  16. baseurl=file:///opt/centos
  17. enabled=1
  18. gpgcheck=0
  19. [mariadb]
  20. name=mariadb
  21. baseurl=file:///root/gpmall-repo
  22. enabled=1
  23. gpgcheck=0
  24. [root@mysql2 ~]# yum install -y mariadb mariadb-server
  25. [root@mysql2 ~]# systemctl restart mariadb
  26. [root@mysql2 ~]# mysql_secure_installation
  27. [root@mysql2 ~]# vim /etc/my.cnf
  28. # 注释:在[mysqld]下添加:
  29. log_bin = mysql-bin
  30. binlog_ignore_db = mysql
  31. server_id = 20
  32. [root@mysql2 ~]# mysql -uroot -p000000
  33. Welcome to the MariaDB monitor. Commands end with ; or \g.
  34. Your MariaDB connection id is 3
  35. Server version: 5.5.65-MariaDB MariaDB Server
  36. Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
  37. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  38. # 注释:如果你不想配置上面的host文件可以不使用主机名mysql1的形式,可以直接打IP地址,这里的用户,密码必须和上面mysql1配置的user一致
  39. MariaDB [(none)]> change master to master_host='mysql1',master_user='user',master_password='000000';
  40. Query OK, 0 rows affected (0.02 sec)
  41. MariaDB [(none)]> start slave;
  42. MariaDB [(none)]> show slave status\G
  43. *************************** 1. row ***************************
  44. Slave_IO_State: Waiting for master to send event
  45. Master_Host: mysql1
  46. Master_User: user
  47. Master_Port: 3306
  48. Connect_Retry: 60
  49. Master_Log_File: mysql-bin.000003
  50. Read_Master_Log_Pos: 245
  51. Relay_Log_File: mariadb-relay-bin.000005
  52. Relay_Log_Pos: 529
  53. Relay_Master_Log_File: mysql-bin.000003
  54. Slave_IO_Running: Yes
  55. Slave_SQL_Running: Yes
  56. Replicate_Do_DB:
  57. Replicate_Ignore_DB:
  58. Replicate_Do_Table:
  59. Replicate_Ignore_Table:
  60. Replicate_Wild_Do_Table:
  61. Replicate_Wild_Ignore_Table:
  62. Last_Errno: 0
  63. Last_Error:
  64. Skip_Counter: 0
  65. Exec_Master_Log_Pos: 245
  66. Relay_Log_Space: 1256
  67. Until_Condition: None
  68. Until_Log_File:
  69. Until_Log_Pos: 0
  70. Master_SSL_Allowed: No
  71. Master_SSL_CA_File:
  72. Master_SSL_CA_Path:
  73. Master_SSL_Cert:
  74. Master_SSL_Cipher:
  75. Master_SSL_Key:
  76. Seconds_Behind_Master: 0
  77. Master_SSL_Verify_Server_Cert: No
  78. Last_IO_Errno: 0
  79. Last_IO_Error:
  80. Last_SQL_Errno: 0
  81. Last_SQL_Error:
  82. Replicate_Ignore_Server_Ids:
  83. Master_Server_Id: 30
  84. 1 row in set (0.00 sec)

 

验证结果(主从是否同步):

Mysql1:

  1. [root@mysql1 ~]# mysql -uroot -p000000
  2. Welcome to the MariaDB monitor. Commands end with ; or \g.
  3. Your MariaDB connection id is 26
  4. Server version: 5.5.65-MariaDB MariaDB Server
  5. Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
  6. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  7. MariaDB [(none)]> create database test;
  8. Query OK, 0 rows affected (0.00 sec)
  9. MariaDB [(none)]> use test;
  10. Database changed
  11. MariaDB [test]> create table demotables(id int not null primary key,name varchar(10),addr varchar(20));
  12. Query OK, 0 rows affected (0.01 sec)
  13. MariaDB [test]> insert into demotables values(1,'zhangsan','lztd');
  14. Query OK, 0 rows affected (0.00 sec)
  15. MariaDB [test]> select * from demotables;
  16. +----+----------+------+
  17. | id | name | addr |
  18. +----+----------+------+
  19. | 1 | zhangsan | lztd |
  20. +----+----------+------+
  21. 1 rows in set (0.00 sec)

 

Mysql2:

  1. [root@mysql2 ~]# mysql -uroot -p000000
  2. Welcome to the MariaDB monitor. Commands end with ; or \g.
  3. Your MariaDB connection id is 24
  4. Server version: 5.5.65-MariaDB MariaDB Server
  5. Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
  6. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  7. MariaDB [(none)]> show databases;
  8. +--------------------+
  9. | Database |
  10. +--------------------+
  11. | information_schema |
  12. | mysql |
  13. | performance_schema |
  14. | test |
  15. +--------------------+
  16. 4 rows in set (0.00 sec)
  17. MariaDB [(none)]> use test;
  18. Reading table information for completion of table and column names
  19. You can turn off this feature to get a quicker startup with -A
  20. Database changed
  21. MariaDB [test]> show tables;
  22. +----------------+
  23. | Tables_in_test |
  24. +----------------+
  25. | demotables |
  26. +----------------+
  27. 1 row in set (0.00 sec)
  28. MariaDB [test]> select * from demotables;
  29. +----+----------+------+
  30. | id | name | addr |
  31. +----+----------+------+
  32. | 1 | zhangsan | lztd |
  33. +----+----------+------+
  34. 1 rows in set (0.00 sec)

 

6.应用商城系统(40分)

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

这是gpmall上传的开源项目,如果想了解的更加深入的可以访问这个地址 https://gitee.com/mic112/gpmall

  • 将所需的zookeep,kafka和gpmall-repo的包上传到mall虚拟机:
  1. [root@mall ~]# vim /etc/hosts
  2. 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
  3. ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
  4. 192.168.1.111 mall
  5. 192.168.1.111 kafka.mall
  6. 192.168.1.111 redis.mall
  7. 192.168.1.111 mysql.mall
  8. 192.168.1.111 zookeeper.mall
  9. [root@mall ~]# vim /etc/yum.repos.d/local.repo
  10. [centos]
  11. name=centos
  12. baseurl=file:///opt/centos
  13. enabled=1
  14. gpgcheck=0
  15. [gpmall]
  16. name=gpmall
  17. baseurl=file:///root/gpmall-repo
  18. enabled=1
  19. gpgcheck=0
  20. [root@mall ~]# yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel
  21. [root@mall ~]# java -version
  22. openjdk version "1.8.0_252"
  23. OpenJDK Runtime Environment (build 1.8.0_252-b09)
  24. OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
  25. [root@mall ~]# yum install -y redis
  26. [root@mall ~]# yum install -y nginx
  27. [root@mall ~]# yum install -y mariadb mariadb-server
  28. [root@mall ~]# tar -zvxf zookeeper-3.4.14.tar.gz
  29. [root@mall ~]# cd zookeeper-3.4.14/conf
  30. [root@mall conf]# mv zoo_sample.cfg zoo.cfg
  31. [root@mall conf]# cd /root/zookeeper-3.4.14/bin/
  32. [root@mall bin]# ./zkServer.sh start
  33. [root@mall bin]# ./zkServer.sh status
  34. ZooKeeper JMX enabled by default
  35. Using config: /root/zookeeper-3.4.14/bin/../conf/zoo.cfg
  36. Mode: standalone
  37. [root@mall bin]# cd
  38. [root@mall ~]# tar -zvxf kafka_2.11-1.1.1.tgz
  39. [root@mall ~]# cd kafka_2.11-1.1.1/bin/
  40. [root@mall bin]# ./kafka-server-start.sh -daemon ../config/server.properties
  41. [root@mall bin]# jps
  42. 7249 Kafka
  43. 17347 Jps
  44. 6927 QuorumPeerMain
  45. [root@mall bin]# cd
  46. [root@mall ~]# vim /etc/my.cnf
  47. # This group is read both both by the client and the server
  48. # use it for options that affect everything
  49. #
  50. [client-server]
  51. #
  52. # include all files from the config directory
  53. #
  54. !includedir /etc/my.cnf.d
  55. [mysqld]
  56. init_connect='SET collation_connection = utf8_unicode_ci'
  57. init_connect='SET NAMES utf8'
  58. character-set-server=utf8
  59. collation-server=utf8_unicode_ci
  60. skip-character-set-client-handshake
  61. [root@mall ~]# systemctl restart mariadb
  62. [root@mall ~]# systemctl enable mariadb
  63. [root@mall ~]# mysqladmin -uroot password 123456
  64. [root@mall ~]# mysql -uroot -p123456
  65. Welcome to the MariaDB monitor. Commands end with ; or \g.
  66. Your MariaDB connection id is 9
  67. Server version: 10.3.18-MariaDB MariaDB Server
  68. Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
  69. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  70. MariaDB [(none)]> create database gpmall;
  71. Query OK, 1 row affected (0.002 sec)
  72. MariaDB [(none)]> grant all privileges on *.* to root@localhost identified by '123456' with grant option;
  73. Query OK, 0 rows affected (0.001 sec)
  74. MariaDB [(none)]> grant all privileges on *.* to root@'%' identified by '123456' with grant option;
  75. Query OK, 0 rows affected (0.001 sec)
  76. MariaDB [(none)]> use gpmall;
  77. Database changed
  78. MariaDB [gpmall]> source /root/gpmall-xiangmubao-danji/gpmall.sql
  79. MariaDB [gpmall]> Ctrl-C -- exit!
  80. [root@mall ~]# vim /etc/redis.conf
  81. 将bind 127.0.0.1这一行注释掉;将protected-mode yes 改为 protected-mode no
  82. #bind 127.0.0.1
  83. Protected-mode no
  84. [root@mall ~]# systemctl restart redis
  85. [root@mall ~]# systemctl enable redis
  86. Created symlink from /etc/systemd/system/multi-user.target.wants/redis.service to /usr/lib/systemd/system/redis.service.
  87. [root@mall ~]# rm -rf /usr/share/nginx/html/*
  88. [root@mall ~]# cp -rf gpmall-xiangmubao-danji/dist/* /usr/share/nginx/html/
  89. [root@mall ~]# vim /etc/nginx/conf.d/default.conf
  90. # 注释:在server块中添加三个location
  91. server {
  92. ...
  93. location /user {
  94. proxy_pass http://127.0.0.1:8082;
  95. }
  96. location /shopping {
  97. proxy_pass http://127.0.0.1:8081;
  98. }
  99. location /cashier {
  100. proxy_pass http://127.0.0.1:8083;
  101. }
  102. ...
  103. }
  104. [root@mall ~]# systemctl restart nginx
  105. [root@mall ~]# systemctl enable nginx
  106. Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.
  107. [root@mall ~]# cd gpmall-xiangmubao-danji/
  108. [root@mall gpmall-xiangmubao-danji]# nohup java -jar shopping-provider-0.0.1-SNAPSHOT.jar &
  109. [1] 3531
  110. [root@mall gpmall-xiangmubao-danji]# nohup: ignoring input and appending output to ‘nohup.out’
  111. [root@mall gpmall-xiangmubao-danji]# nohup java -jar user-provider-0.0.1-SNAPSHOT.jar &
  112. [2] 3571
  113. [root@mall gpmall-xiangmubao-danji]# nohup: ignoring input and appending output to ‘nohup.out’
  114. [root@mall gpmall-xiangmubao-danji]# nohup java -jar gpmall-shopping-0.0.1-SNAPSHOT.jar &
  115. [3] 3639
  116. [root@mall gpmall-xiangmubao-danji]# nohup: ignoring input and appending output to ‘nohup.out’
  117. [root@mall gpmall-xiangmubao-danji]# nohup java -jar gpmall-user-0.0.1-SNAPSHOT.jar &
  118. [4] 3676
  119. [root@mall gpmall-xiangmubao-danji]# nohup: ignoring input and appending output to ‘nohup.out’
  120. [root@mall gpmall-xiangmubao-danji]# jobs
  121. [1] Running nohup java -jar shopping-provider-0.0.1-SNAPSHOT.jar &
  122. [2] Running nohup java -jar user-provider-0.0.1-SNAPSHOT.jar &
  123. [3]- Running nohup java -jar gpmall-shopping-0.0.1-SNAPSHOT.jar &
  124. [4]+ Running nohup java -jar gpmall-user-0.0.1-SNAPSHOT.jar &
  125. [root@mall gpmall-xiangmubao-danji]# curl http://192.168.1.111/#/home
  126. <!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{
  127. min-width:1250px;}</style>

 

7. swift管理(40分)

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

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

 

8. cinder管理(40分)

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

  1. [root@controller ~]# vgs
  2. VG #PV #LV #SN Attr VSize VFree
  3. centos 1 2 0 wz--n- 39.00g 4.00m
  4. cinder-volumes 1 0 0 wz--n- 5.00g 5.00g
  5. [root@controller ~]# lvcreate -L +2G -n BlockVolume cinder-volumes
  6. Logical volume "BlockVolume" created.
  7. [root@controller ~]# lvs
  8. LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
  9. root centos -wi-ao---- 35.00g
  10. swap centos -wi-ao---- 4.00g
  11. BlockVolume cinder-volumes -wi-a----- 2.00g
  12. [root@controller ~]# lvdisplay /dev/mapper/cinder--volumes-BlockVolume
  13. --- Logical volume ---
  14. LV Path /dev/cinder-volumes/BlockVolume
  15. LV Name BlockVolume
  16. VG Name cinder-volumes
  17. LV UUID Ifbpgh-QOe5-3EjU-YHcH-avNW-KLYd-D8AD9M
  18. LV Write Access read/write
  19. LV Creation host, time controller, 2020-05-15 13:34:51 -0400
  20. LV Status available
  21. # open 0
  22. LV Size 2.00 GiB
  23. Current LE 512
  24. Segments 1
  25. Allocation inherit
  26. Read ahead sectors auto
  27. - currently set to 8192
  28. Block device 253:2

 

9. Ceilometer管理(40分)

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

  1. [root@controller ~]# ceilometer meter-list
  2. +---------------------------------+------------+-----------+-----------------------------------------------------------------------+----------------------------------+----------------------------------+
  3. | Name | Type | Unit | Resource ID | User ID | Project ID |
  4. +---------------------------------+------------+-----------+-----------------------------------------------------------------------+----------------------------------+----------------------------------+
  5. | compute.instance.booting.time | gauge | sec | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  6. | cpu | cumulative | ns | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  7. | cpu.delta | delta | ns | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  8. | cpu_util | gauge | % | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  9. | disk.allocation | gauge | B | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  10. | disk.capacity | gauge | B | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  11. | disk.device.allocation | gauge | B | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c-vda | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  12. | disk.device.capacity | gauge | B | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c-vda | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  13. | disk.device.read.bytes | cumulative | B | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c-vda | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  14. | disk.device.read.bytes.rate | gauge | B/s | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c-vda | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  15. | disk.device.read.requests | cumulative | request | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c-vda | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  16. | disk.device.read.requests.rate | gauge | request/s | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c-vda | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  17. | disk.device.usage | gauge | B | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c-vda | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  18. | disk.device.write.bytes | cumulative | B | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c-vda | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  19. | disk.device.write.bytes.rate | gauge | B/s | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c-vda | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  20. | disk.device.write.requests | cumulative | request | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c-vda | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  21. | disk.device.write.requests.rate | gauge | request/s | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c-vda | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  22. | disk.ephemeral.size | gauge | GB | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  23. | disk.read.bytes | cumulative | B | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  24. | disk.read.bytes.rate | gauge | B/s | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  25. | disk.read.requests | cumulative | request | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  26. | disk.read.requests.rate | gauge | request/s | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  27. | disk.root.size | gauge | GB | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  28. | disk.usage | gauge | B | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  29. | disk.write.bytes | cumulative | B | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  30. | disk.write.bytes.rate | gauge | B/s | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  31. | disk.write.requests | cumulative | request | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  32. | disk.write.requests.rate | gauge | request/s | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  33. | image | gauge | image | 90707f15-f87c-44a4-b916-5a06306a5c88 | None | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  34. | image | gauge | image | 935a7ac5-a6dd-4cb4-94b3-941d1b2ddd23 | None | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  35. | image.download | delta | B | 90707f15-f87c-44a4-b916-5a06306a5c88 | None | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  36. | image.serve | delta | B | 90707f15-f87c-44a4-b916-5a06306a5c88 | None | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  37. | image.size | gauge | B | 90707f15-f87c-44a4-b916-5a06306a5c88 | None | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  38. | image.size | gauge | B | 935a7ac5-a6dd-4cb4-94b3-941d1b2ddd23 | None | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  39. | instance | gauge | instance | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  40. | ip.floating | gauge | ip | 00a17375-f37c-4cf4-a183-e8bbc39d8075 | None | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  41. | ip.floating | gauge | ip | 9d2da4df-e2a9-4cc2-837c-eb0196b65fe1 | None | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  42. | memory | gauge | MB | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  43. | memory.resident | gauge | MB | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  44. | memory.usage | gauge | MB | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  45. | network.incoming.bytes | cumulative | B | instance-00000001-e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c-tap92e5f34b-5a | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  46. | network.incoming.bytes.rate | gauge | B/s | instance-00000001-e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c-tap92e5f34b-5a | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  47. | network.incoming.packets | cumulative | packet | instance-00000001-e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c-tap92e5f34b-5a | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  48. | network.incoming.packets.rate | gauge | packet/s | instance-00000001-e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c-tap92e5f34b-5a | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  49. | network.outgoing.bytes | cumulative | B | instance-00000001-e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c-tap92e5f34b-5a | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  50. | network.outgoing.bytes.rate | gauge | B/s | instance-00000001-e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c-tap92e5f34b-5a | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  51. | network.outgoing.packets | cumulative | packet | instance-00000001-e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c-tap92e5f34b-5a | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  52. | network.outgoing.packets.rate | gauge | packet/s | instance-00000001-e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c-tap92e5f34b-5a | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  53. | storage.objects | gauge | object | c88f5a1b7619420dadb4309743e53f1a | 0f980d5fefa6448a9c52f5c0ae5813a5 | c88f5a1b7619420dadb4309743e53f1a |
  54. | storage.objects | gauge | object | e14b3dabf5594684913f3868669f35af | 0f980d5fefa6448a9c52f5c0ae5813a5 | c88f5a1b7619420dadb4309743e53f1a |
  55. | storage.objects | gauge | object | f9ff39ba9daa4e5a8fee1fc50e2d2b34 | 0f980d5fefa6448a9c52f5c0ae5813a5 | c88f5a1b7619420dadb4309743e53f1a |
  56. | storage.objects.containers | gauge | container | c88f5a1b7619420dadb4309743e53f1a | 0f980d5fefa6448a9c52f5c0ae5813a5 | c88f5a1b7619420dadb4309743e53f1a |
  57. | storage.objects.containers | gauge | container | e14b3dabf5594684913f3868669f35af | 0f980d5fefa6448a9c52f5c0ae5813a5 | c88f5a1b7619420dadb4309743e53f1a |
  58. | storage.objects.containers | gauge | container | f9ff39ba9daa4e5a8fee1fc50e2d2b34 | 0f980d5fefa6448a9c52f5c0ae5813a5 | c88f5a1b7619420dadb4309743e53f1a |
  59. | storage.objects.outgoing.bytes | delta | B | c88f5a1b7619420dadb4309743e53f1a | 0f980d5fefa6448a9c52f5c0ae5813a5 | c88f5a1b7619420dadb4309743e53f1a |
  60. | storage.objects.outgoing.bytes | delta | B | e14b3dabf5594684913f3868669f35af | 0f980d5fefa6448a9c52f5c0ae5813a5 | c88f5a1b7619420dadb4309743e53f1a |
  61. | storage.objects.outgoing.bytes | delta | B | f9ff39ba9daa4e5a8fee1fc50e2d2b34 | 0f980d5fefa6448a9c52f5c0ae5813a5 | c88f5a1b7619420dadb4309743e53f1a |
  62. | storage.objects.size | gauge | B | c88f5a1b7619420dadb4309743e53f1a | 0f980d5fefa6448a9c52f5c0ae5813a5 | c88f5a1b7619420dadb4309743e53f1a |
  63. | storage.objects.size | gauge | B | e14b3dabf5594684913f3868669f35af | 0f980d5fefa6448a9c52f5c0ae5813a5 | c88f5a1b7619420dadb4309743e53f1a |
  64. | storage.objects.size | gauge | B | f9ff39ba9daa4e5a8fee1fc50e2d2b34 | 0f980d5fefa6448a9c52f5c0ae5813a5 | c88f5a1b7619420dadb4309743e53f1a |
  65. | vcpus | gauge | vcpu | e1e52ae3-1f3e-4d62-bc21-d8b19055ab5c | 0befa70f767848e39df8224107b71858 | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  66. +---------------------------------+------------+-----------+-----------------------------------------------------------------------+----------------------------------+----------------------------------+

 

10. Docker安装(40分)

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

  • 先上传Docker.tar.gz到/root目录,并解压:
  1. [root@xiandian ~]# tar -zvxf Docker.tar.gz
  2. [root@xiandian ~]# vim /etc/yum.repos.d/local.repo
  3. [centos]
  4. name=centos
  5. baseurl=file:///opt/centos
  6. enabled=1
  7. gpgcheck=0
  8. [docker]
  9. name=docker
  10. baseurl=file:///root/Docker
  11. enabled=1
  12. gpgcheck=0
  13. [root@xiandian ~]# iptables -F
  14. [root@xiandian ~]# iptables -X
  15. [root@xiandian ~]# iptables -Z
  16. [root@xiandian ~]# iptables-save
  17. # Generated by iptables-save v1.4.21 on Fri May 15 02:00:29 2020
  18. *filter
  19. :INPUT ACCEPT [20:1320]
  20. :FORWARD ACCEPT [0:0]
  21. :OUTPUT ACCEPT [11:1092]
  22. COMMIT
  23. # Completed on Fri May 15 02:00:29 2020
  24. [root@xiandian ~]# vim /etc/selinux/config
  25. SELINUX=disabled
  26. # 注释:关闭交换分区:
  27. [root@xiandian ~]# vim /etc/fstab
  28. #/dev/mapper/centos-swap swap swap defaults 0 0
  29. [root@xiandian ~]# free -m
  30. total used free shared buff/cache available
  31. Mem: 1824 95 1591 8 138 1589
  32. Swap: 0 0 0
  33. # 注释:在配置路由转发前,先升级系统并重启,不然会有两条规则可能报错:
  34. [root@xiandian ~]# yum upgrade -y
  35. [root@xiandian ~]# reboot
  36. [root@xiandian ~]# vim /etc/sysctl.conf
  37. net.ipv4.ip_forward = 1
  38. net.bridge.bridge-nf-call-ip6tables = 1
  39. net.bridge.bridge-nf-call-iptables = 1
  40. [root@xiandian ~]# modprobe br_netfilter
  41. [root@xiandian ~]# sysctl -p
  42. net.ipv4.ip_forward = 1
  43. net.bridge.bridge-nf-call-ip6tables = 1
  44. net.bridge.bridge-nf-call-iptables = 1
  45. [root@xiandian ~]# yum install -y yum-utils device-mapper-persistent-data
  46. [root@xiandian ~]# yum install -y docker-ce-18.09.6 docker-ce-cli-18.09.6 containerd.io
  47. [root@xiandian ~]# systemctl daemon-reload
  48. [root@xiandian ~]# systemctl restart docker
  49. [root@xiandian ~]# systemctl enable docker
  50. Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
  51. [root@xiandian ~]# docker info
  52. Containers: 0
  53. Running: 0
  54. Paused: 0
  55. Stopped: 0
  56. Images: 0
  57. Server Version: 18.09.6
  58. Storage Driver: devicemapper
  59. Pool Name: docker-253:0-100765090-pool
  60. Pool Blocksize: 65.54kB
  61. Base Device Size: 10.74GB
  62. Backing Filesystem: xfs
  63. Udev Sync Supported: true
  64. Data file: /dev/loop0
  65. Metadata file: /dev/loop1
  66. Data loop file: /var/lib/docker/devicemapper/devicemapper/data
  67. Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
  68. Data Space Used: 11.73MB
  69. Data Space Total: 107.4GB
  70. Data Space Available: 24.34GB
  71. Metadata Space Used: 17.36MB
  72. Metadata Space Total: 2.147GB
  73. Metadata Space Available: 2.13GB
  74. Thin Pool Minimum Free Space: 10.74GB
  75. Deferred Removal Enabled: true
  76. Deferred Deletion Enabled: true
  77. Deferred Deleted Device Count: 0
  78. Library Version: 1.02.164-RHEL7 (2019-08-27)
  79. Logging Driver: json-file
  80. Cgroup Driver: cgroupfs
  81. Plugins:
  82. Volume: local
  83. Network: bridge host macvlan null overlay
  84. Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
  85. Swarm: inactive
  86. Runtimes: runc
  87. Default Runtime: runc
  88. Init Binary: docker-init
  89. containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
  90. runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
  91. init version: fec3683
  92. Security Options:
  93. seccomp
  94. Profile: default
  95. Kernel Version: 3.10.0-1127.8.2.el7.x86_64
  96. Operating System: CentOS Linux 7 (Core)
  97. OSType: linux
  98. Architecture: x86_64
  99. CPUs: 2
  100. Total Memory: 1.777GiB
  101. Name: xiandian
  102. ID: OUR6:6ERV:3UCH:WJCM:TDLL:5ATV:E7IQ:HLAR:JKQB:OBK2:HZ7G:JC3Q
  103. Docker Root Dir: /var/lib/docker
  104. Debug Mode (client): false
  105. Debug Mode (server): false
  106. Registry: https://index.docker.io/v1/
  107. Labels:
  108. Experimental: false
  109. Insecure Registries:
  110. 127.0.0.0/8
  111. Live Restore Enabled: false
  112. Product License: Community Engine
  113. WARNING: the devicemapper storage-driver is deprecated, and will be removed in a future release.
  114. WARNING: devicemapper: usage of loopback devices is strongly discouraged for production use.
  115. Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.

 

11. Docker Harbor安装(40分)

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

  • 之前安装docker-cd时解压Docker.tar.gz时会产生有一个image.sh的脚本(是一个自动上传镜像到本地仓库的脚本)
  1. [root@zookeeper1 ~]# ./image.sh
  2. [root@zookeeper1 ~]# mkdir -p /data/ssl
  3. [root@zookeeper1 ~]# cd /data/ssl/
  4. [root@zookeeper1 ssl]# which openssl
  5. /usr/bin/openssl
  6. [root@zookeeper1 ssl]# openssl req -newkey rsa:4096 -nodes -sha256 -keyout ca.key -x509 -days 2.235 -out ca.crt
  7. Generating a 4096 bit RSA private key
  8. ...................................................................................................................++
  9. ............................................................................................................................................++
  10. writing new private key to 'ca.key'
  11. -----
  12. You are about to be asked to enter information that will be incorporated
  13. into your certificate request.
  14. What you are about to enter is what is called a Distinguished Name or a DN.
  15. There are quite a few fields but you can leave some blank
  16. For some fields there will be a default value,
  17. If you enter '.', the field will be left blank.
  18. -----
  19. Country Name (2 letter code) [XX]:CN # 国家
  20. State or Province Name (full name) []:Guangxi # 地区(州或省名)
  21. Locality Name (eg, city) [Default City]:Liuzhou # 城市
  22. Organization Name (eg, company) [Default Company Ltd]:lztd # 公司名称
  23. Organizational Unit Name (eg, section) []:xxjsxy # 单位名称
  24. Common Name (eg, your name or your server's hostname) []: # 服务器主机名,域名
  25. Email Address []: # 邮箱地址
  26. [root@zookeeper1 ssl]# openssl req -newkey rsa:4096 -nodes -sha256 -keyout www.yidaoyun.com.key -out www.yidaoyun.com.csr
  27. Generating a 4096 bit RSA private key
  28. .........................................................++
  29. ......++
  30. writing new private key to 'www.yidaoyun.com.key'
  31. -----
  32. You are about to be asked to enter information that will be incorporated
  33. into your certificate request.
  34. What you are about to enter is what is called a Distinguished Name or a DN.
  35. There are quite a few fields but you can leave some blank
  36. For some fields there will be a default value,
  37. If you enter '.', the field will be left blank.
  38. -----
  39. Country Name (2 letter code) [XX]:CN # 国家
  40. State or Province Name (full name) []:LGuangxi # 地区(州或省名)
  41. Locality Name (eg, city) [Default City]:Liuzhou # 城市
  42. Organization Name (eg, company) [Default Company Ltd]:lztd # 公司名称
  43. Organizational Unit Name (eg, section) []:xxjsxy # 单位名称
  44. Common Name (eg, your name or your server's hostname) []:www.yidaoyun.com # 服务器主机名,域名
  45. Email Address []: # 邮箱地址
  46. Please enter the following 'extra' attributes
  47. to be sent with your certificate request
  48. A challenge password []:
  49. An optional company name []:
  50. [root@zookeeper1 ssl]# openssl x509 -req -days 2.235 -in www.yidaoyun.com.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out www.yidaoyun.com.crt
  51. Signature ok
  52. subject=/C=CN/ST=Guangxi/L=Liuzhou/O=lztd/OU=xxjsxy/CN=www.yidaoyun.com
  53. Getting CA Private Key
  54. [root@zookeeper1 ssl]# cp -rvf www.yidaoyun.com.crt /etc/pki/ca-trust/source/anchors/
  55. ‘www.yidaoyun.com.crt’ ->/etc/pki/ca-trust/source/anchors/www.yidaoyun.com.crt
  56. [root@zookeeper1 ssl]# update-ca-trust enable
  57. [root@zookeeper1 ssl]# update-ca-trust extract
  58. # 注释:上传docker-compose-Linux-x86_64.64并重命名docker-compose:
  59. [root@zookeeper1 ~]# mv docker-compose-Linux-x86_64.64 /usr/local/bin/
  60. [root@zookeeper1 ~]# mv /usr/local/bin/docker-compose-Linux-x86_64.64 /usr/local/bin/docker-compose
  61. [root@zookeeper1 ~]# chmod +x /usr/local/bin/docker-compose
  62. [root@zookeeper1 ~]# docker-compose --version
  63. docker-compose version 1.26.0-rc4, build d279b7a8
  64. [root@zookeeper1 opt]# tar -zvxf harbor-offline-installer-v1.5.3.tgz -C /opt/
  65. [root@zookeeper1 opt]# ll
  66. total 1097260
  67. drwxr-xr-x. 8 root root 4096 May 14 08:03 centos
  68. drwx--x--x 4 root root 26 May 19 23:16 containerd
  69. -rw-r--r--. 1 root root 1123583789 May 15 04:26 Docker.tar.gz
  70. drwxr-xr-x 4 root root 4096 May 20 03:55 harbor
  71. [root@zookeeper1 opt]# cd harbor/
  72. [root@zookeeper1 harbor]# ll
  73. total 895708
  74. drwxr-xr-x 3 root root 22 May 20 03:55 common
  75. -rw-r--r-- 1 root root 1185 Sep 12 2018 docker-compose.clair.yml
  76. -rw-r--r-- 1 root root 1725 Sep 12 2018 docker-compose.notary.yml
  77. -rw-r--r-- 1 root root 3596 Sep 12 2018 docker-compose.yml
  78. drwxr-xr-x 3 root root 150 Sep 12 2018 ha
  79. -rw-r--r-- 1 root root 6956 Sep 12 2018 harbor.cfg
  80. -rw-r--r-- 1 root root 915878468 Sep 12 2018 harbor.v1.5.3.tar.gz
  81. -rwxr-xr-x 1 root root 5773 Sep 12 2018 install.sh
  82. -rw-r--r-- 1 root root 10764 Sep 12 2018 LICENSE
  83. -rw-r--r-- 1 root root 482 Sep 12 2018 NOTICE
  84. -rw-r--r-- 1 root root 1247461 Sep 12 2018 open_source_license
  85. -rwxr-xr-x 1 root root 27840 Sep 12 2018 prepare
  86. [root@zookeeper1 harbor]# vim harbor.cfg
  87. # 注释:修改配置文件内容:
  88. hostname = 192.168.1.111
  89. ui_url_protocol = https
  90. ssl_cert = /data/ssl/www.yidaoyun.com.crt
  91. ssl_cert_key = /data/ssl/www.yidaoyun.com.key
  92. harbor_admin_password = 000000
  93. [root@zookeeper1 harbor]# ./prepare
  94. Generated and saved secret to file: /data/secretkey
  95. Generated configuration file: ./common/config/nginx/nginx.conf
  96. Generated configuration file: ./common/config/adminserver/env
  97. Generated configuration file: ./common/config/ui/env
  98. Generated configuration file: ./common/config/registry/config.yml
  99. Generated configuration file: ./common/config/db/env
  100. Generated configuration file: ./common/config/jobservice/env
  101. Generated configuration file: ./common/config/jobservice/config.yml
  102. Generated configuration file: ./common/config/log/logrotate.conf
  103. Generated configuration file: ./common/config/jobservice/config.yml
  104. Generated configuration file: ./common/config/ui/app.conf
  105. Generated certificate, key file: ./common/config/ui/private_key.pem, cert file: ./common/config/registry/root.crt
  106. The configuration files are ready, please use docker-compose to start the service.
  107. [root@zookeeper1 harbor]# ./install.sh --with-notary --with-clair
  108. [Step 0]: checking installation environment ...
  109. Note: docker version: 18.09.6
  110. Note: docker-compose version: 1.26.0
  111. [Step 1]: loading Harbor images ...
  112. dba693fc2701: Loading layer 133.4MB/133.4MB
  113. 5773887c4c41: Loading layer 30.09MB/30.09MB
  114. 6fc2abbcae42: Loading layer 15.37MB/15.37MB
  115. d85f176a11ec: Loading layer 15.37MB/15.37MB
  116. Loaded image: vmware/harbor-adminserver:v1.5.3
  117. 462b14c85230: Loading layer 410.1MB/410.1MB
  118. c2e0c8cb2903: Loading layer 9.216kB/9.216kB
  119. 11bdb24cded2: Loading layer 9.216kB/9.216kB
  120. 5d8f974b49ef: Loading layer 7.68kB/7.68kB
  121. ee04f13f4147: Loading layer 1.536kB/1.536kB
  122. 799db4dfe41a: Loading layer 11.78kB/11.78kB
  123. f7d813585bdd: Loading layer 2.56kB/2.56kB
  124. 6300bbdbd7ab: Loading layer 3.072kB/3.072kB
  125. Loaded image: vmware/harbor-db:v1.5.3
  126. 1d7516778a05: Loading layer 30.09MB/30.09MB
  127. f7ec8d1b47d0: Loading layer 20.91MB/20.91MB
  128. 22b0ad749c21: Loading layer 20.91MB/20.91MB
  129. Loaded image: vmware/harbor-jobservice:v1.5.3
  130. 2d449d67c05a: Loading layer 89.58MB/89.58MB
  131. 0bfd4e706575: Loading layer 3.072kB/3.072kB
  132. 6100e173c230: Loading layer 59.9kB/59.9kB
  133. 86fe093d1358: Loading layer 61.95kB/61.95kB
  134. Loaded image: vmware/redis-photon:v1.5.3
  135. Loaded image: photon:1.0
  136. 3bf3086a6569: Loading layer 30.09MB/30.09MB
  137. 641d0f77d675: Loading layer 10.95MB/10.95MB
  138. 89efbaabea87: Loading layer 17.3MB/17.3MB
  139. 1276e51f4dc2: Loading layer 15.87kB/15.87kB
  140. 49e187d04e78: Loading layer 3.072kB/3.072kB
  141. e62fbfea411d: Loading layer 28.24MB/28.24MB
  142. Loaded image: vmware/notary-signer-photon:v0.5.1-v1.5.3
  143. Loaded image: vmware/mariadb-photon:v1.5.3
  144. 201f6ade61d8: Loading layer 102.5MB/102.5MB
  145. 81221fbb5879: Loading layer 6.656kB/6.656kB
  146. 2268e3c9e521: Loading layer 2.048kB/2.048kB
  147. 9fca06f4b193: Loading layer 7.68kB/7.68kB
  148. Loaded image: vmware/postgresql-photon:v1.5.3
  149. 11d6e8a232c9: Loading layer 30.09MB/30.09MB
  150. 42650b04d53d: Loading layer 24.41MB/24.41MB
  151. a1cd8af19e29: Loading layer 7.168kB/7.168kB
  152. 4b1cda90ba19: Loading layer 10.56MB/10.56MB
  153. 1351f0f3006a: Loading layer 24.4MB/24.4MB
  154. Loaded image: vmware/harbor-ui:v1.5.3
  155. e335f4c3af7d: Loading layer 79.93MB/79.93MB
  156. 2aea487bc2c4: Loading layer 3.584kB/3.584kB
  157. d2efec3de68b: Loading layer 3.072kB/3.072kB
  158. d0d71a5ce1dd: Loading layer 4.096kB/4.096kB
  159. 19930367abf0: Loading layer 3.584kB/3.584kB
  160. 03e5b7640db5: Loading layer 9.728kB/9.728kB
  161. Loaded image: vmware/harbor-log:v1.5.3
  162. 5aebe8cc938c: Loading layer 11.97MB/11.97MB
  163. Loaded image: vmware/nginx-photon:v1.5.3
  164. ede6a57cbd7e: Loading layer 30.09MB/30.09MB
  165. 4d6dd4fc1d87: Loading layer 2.56kB/2.56kB
  166. c86a69f49f60: Loading layer 2.56kB/2.56kB
  167. 0cf6e04c5927: Loading layer 2.048kB/2.048kB
  168. 6fbff4fe9739: Loading layer 22.8MB/22.8MB
  169. 6f527a618092: Loading layer 22.8MB/22.8MB
  170. Loaded image: vmware/registry-photon:v2.6.2-v1.5.3
  171. e29a8834501b: Loading layer 12.16MB/12.16MB
  172. aaf67f1da2c7: Loading layer 17.3MB/17.3MB
  173. 8d5718232133: Loading layer 15.87kB/15.87kB
  174. fc89aca1dd12: Loading layer 3.072kB/3.072kB
  175. 076eb5a76f6d: Loading layer 29.46MB/29.46MB
  176. Loaded image: vmware/notary-server-photon:v0.5.1-v1.5.3
  177. 454c81edbd3b: Loading layer 135.2MB/135.2MB
  178. e99db1275091: Loading layer 395.4MB/395.4MB
  179. 051e4ee23882: Loading layer 9.216kB/9.216kB
  180. 6cca4437b6f6: Loading layer 9.216kB/9.216kB
  181. 1d48fc08c8bc: Loading layer 7.68kB/7.68kB
  182. 0419724fd942: Loading layer 1.536kB/1.536kB
  183. 543c0c1ee18d: Loading layer 655.2MB/655.2MB
  184. 4190aa7e89b8: Loading layer 103.9kB/103.9kB
  185. Loaded image: vmware/harbor-migrator:v1.5.0
  186. 45878c64fc3c: Loading layer 165.3MB/165.3MB
  187. fc3d407ce98f: Loading layer 10.93MB/10.93MB
  188. d7a0785bb902: Loading layer 2.048kB/2.048kB
  189. a17e0f23bc84: Loading layer 48.13kB/48.13kB
  190. 57c7181f2336: Loading layer 10.97MB/10.97MB
  191. Loaded image: vmware/clair-photon:v2.0.5-v1.5.3
  192. [Step 2]: preparing environment ...
  193. Clearing the configuration file: ./common/config/adminserver/env
  194. Clearing the configuration file: ./common/config/ui/env
  195. Clearing the configuration file: ./common/config/ui/app.conf
  196. Clearing the configuration file: ./common/config/ui/private_key.pem
  197. Clearing the configuration file: ./common/config/db/env
  198. Clearing the configuration file: ./common/config/jobservice/env
  199. Clearing the configuration file: ./common/config/jobservice/config.yml
  200. Clearing the configuration file: ./common/config/registry/config.yml
  201. Clearing the configuration file: ./common/config/registry/root.crt
  202. Clearing the configuration file: ./common/config/nginx/cert/www.yidaoyun.com.crt
  203. Clearing the configuration file: ./common/config/nginx/cert/www.yidaoyun.com.key
  204. Clearing the configuration file: ./common/config/nginx/nginx.conf
  205. Clearing the configuration file: ./common/config/log/logrotate.conf
  206. loaded secret from file: /data/secretkey
  207. Generated configuration file: ./common/config/nginx/nginx.conf
  208. Generated configuration file: ./common/config/adminserver/env
  209. Generated configuration file: ./common/config/ui/env
  210. Generated configuration file: ./common/config/registry/config.yml
  211. Generated configuration file: ./common/config/db/env
  212. Generated configuration file: ./common/config/jobservice/env
  213. Generated configuration file: ./common/config/jobservice/config.yml
  214. Generated configuration file: ./common/config/log/logrotate.conf
  215. Generated configuration file: ./common/config/jobservice/config.yml
  216. Generated configuration file: ./common/config/ui/app.conf
  217. Generated certificate, key file: ./common/config/ui/private_key.pem, cert file: ./common/config/registry/root.crt
  218. Copying sql file for notary DB
  219. Generated certificate, key file: ./cert_tmp/notary-signer-ca.key, cert file: ./cert_tmp/notary-signer-ca.crt
  220. Generated certificate, key file: ./cert_tmp/notary-signer.key, cert file: ./cert_tmp/notary-signer.crt
  221. Copying certs for notary signer
  222. Copying notary signer configuration file
  223. Generated configuration file: ./common/config/notary/server-config.json
  224. Copying nginx configuration file for notary
  225. Generated configuration file: ./common/config/nginx/conf.d/notary.server.conf
  226. Generated and saved secret to file: /data/defaultalias
  227. Generated configuration file: ./common/config/notary/signer_env
  228. Generated configuration file: ./common/config/clair/postgres_env
  229. Generated configuration file: ./common/config/clair/config.yaml
  230. Generated configuration file: ./common/config/clair/clair_env
  231. The configuration files are ready, please use docker-compose to start the service.
  232. [Step 3]: checking existing instance of Harbor ...
  233. [Step 4]: starting Harbor ...
  234. Creating network "harbor_harbor" with the default driver
  235. Creating network "harbor_harbor-clair" with the default driver
  236. Creating network "harbor_harbor-notary" with the default driver
  237. Creating network "harbor_notary-mdb" with the default driver
  238. Creating network "harbor_notary-sig" with the default driver
  239. Creating harbor-log ... done
  240. Creating redis ... done
  241. Creating clair-db ... done
  242. Creating notary-db ... done
  243. Creating harbor-db ... done
  244. Creating registry ... done
  245. Creating harbor-adminserver ... done
  246. Creating notary-signer ... done
  247. Creating clair ... done
  248. Creating harbor-ui ... done
  249. Creating notary-server ... done
  250. Creating nginx ... done
  251. Creating harbor-jobservice ... done
  252. ✔ ----Harbor has been installed and started successfully.----
  253. Now you should be able to visit the admin portal at https://192.168.1.111.
  254. For more details, please visit https://github.com/vmware/harbor .

 

12. Docker Compose安装(40分)

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

  • 上传docker-compose-Linux-x86_64.64并重命名docker-compose:
  1. [root@zookeeper1 ~]# mv docker-compose-Linux-x86_64.64 /usr/local/bin/
  2. [root@zookeeper1 ~]# mv /usr/local/bin/docker-compose-Linux-x86_64.64 /usr/local/bin/docker-compose
  3. [root@zookeeper1 ~]# chmod +x /usr/local/bin/docker-compose
  4. [root@zookeeper1 ~]# docker-compose --version
  5. docker-compose version 1.26.0-rc4, build d279b7a8

 

13. Dockerfile编写(40分)

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

  1. [root@localhost ~]# mkdir jr
  2. [root@localhost ~]# cd jr/
  3. [root@localhost jr]# vim Dockerfile
  4. # 注释:构建时用到的基础镜像
  5. FROM python:3.5-alpine
  6. # 注释:将该目录下的所有文件(点表示当前工作路径,也可以写路径)复制到/code
  7. ADD . /code
  8. # 注释:切换工作目录为/code
  9. WORKDIR /code
  10. # 注释:在容器启动时执行的命令
  11. CMD ["python", "app.py"]

 

  • 构建Dockerfile的镜像(注意后面有个点,表示文件路径我就在这个文件里面了所有用点表示,当然也可以把点换成路径):
  1. [root@localhost jr]# docker build -t test .
  2. Sending build context to Docker daemon 2.048kB
  3. Step 1/4 : FROM python:3.5-alpine
  4. 3.5-alpine: Pulling from library/python
  5. cbdbe7a5bc2a: Pull complete
  6. 26ebcd19a4e3: Pull complete
  7. 5040824fb16c: Pull complete
  8. ee2aa99e2e5f: Pull complete
  9. 09d2ba251239: Pull complete
  10. Digest: sha256:add585692cb3ed53427cd423b6e87c976c3a760e00165026f038a5822c1e22fd
  11. Status: Downloaded newer image for python:3.5-alpine
  12. ---> 5f618d8888ec
  13. Step 2/4 : ADD . /code
  14. ---> 60a93c53612e
  15. Step 3/4 : WORKDIR /code
  16. ---> Running in 67ee14645e5c
  17. Removing intermediate container 67ee14645e5c
  18. ---> 6fc0e4a0d1d1
  19. Step 4/4 : CMD ["python", "app.py"]
  20. ---> Running in 797dfc62af22
  21. Removing intermediate container 797dfc62af22
  22. ---> 3a92c182aca3
  23. Successfully built 3a92c182aca3
  24. Successfully tagged test:latest

 

14. Shell脚本补全(40分)

下面有一段脚本,作用是自动配置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 }

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

 

15. Python脚本补全(40分)

下面有一段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

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

 

©版权声明

著作权归作者所有:如需转载,请注明出处,谢谢。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/306842
推荐阅读
相关标签
  

闽ICP备14008679号