主頁 >  其他 > 1+X云計算平臺運維與開發認證(中級)樣卷B-實操程序

1+X云計算平臺運維與開發認證(中級)樣卷B-實操程序

2020-12-17 10:16:44 其他

個人博客地址:http://www.mwbdtth.club/

選擇題可能有些題目有點小問題,請酌情參考,主要還是以實操為主

單選題(200分):

1.下面關于軟體專案開發程序,敘述錯誤的是?(10分)
A、敏捷開發從需求、計劃、開發、測驗,直到專案結束,整個周期一直在迭代中
B、敏捷開發中開發、測驗、發布又可以單獨迭代多次
C、瀑布式模型分為計劃、分析、設計、程式開發、測驗、修改和整合,一個階段結束,另一個階段接著開始
D、瀑布式模型著重迭代式開發,分析、設計、開發、測驗和發布(正確答案)

2.敏捷開發從需求、計劃、開發、測驗,直到專案結束,整個周期一直在迭代中,而其中可以單獨迭代多次的不包括哪個程序?(10分)
A、開發
B、測驗
C、計劃(正確答案)
D、發布

3.以下關于STP協議的描述中,哪項是正確的? (10分)
A、STP運行在交換機和網橋設備上
B、STP協議是一個二層鏈路管理協議
C、STP在選定根網橋,讓一些埠進入阻塞作業模式,這些被阻塞埠沒有被激活(正確答案)
D、STP的主要功能是在保證網路中沒有回路的基礎上,允許在第二層鏈路中提供冗余路徑

4.以下哪個狀態不是RSTP的作業狀態? (10分)
A、監聽狀態(正確答案)
B、丟棄狀態
C、轉發狀態
D、學習狀態

5.在常用的資料庫表單管理命令當中,“use 資料庫;”名稱的作用是?(10分)
A、描述表單
B、指定使用的資料庫(正確答案)
C、顯示當前已有的資料庫
D、更新表單中的資料

6.在mysqldump備份命令當中,引數-u的作用是?(10分)
A、資料庫的用戶名稱(正確答案)
B、密碼提示符
C、只匯出表結構
D、備份完成后將不再允許修改資料

7.basic paxos流程中server的主要功能是什么?(10分)
A、對投票結果進行統計(正確答案)
B、進行投票
C、篩選無用的投票
D、無任何功能

8.選完Leader以后,ZooKeeper就進入狀態同步程序,具體方式如下:① Leader等待Server連接;② Follower連接Leader,將最大的zxid發送給Leader;③ Leader根據Follower的zxid確定同步點;④ 完成同步后通知Follower已經成為uptodate狀態;⑤ Follower收到uptodate訊息后,又可以重新接受client的請求進行服務了,請問正確的順序是什么?(10分)
A、12345(正確答案)
B、13245
C、12435
D、21345

9.Keystone為OpenStack平臺提供了什么服務?(10分)
A、認證服務(正確答案)
B、存盤服務
C、鏡像服務
D、計算服務

10.什么是私有云計算基礎架構的基石?(10分)
A、虛擬化(正確答案)
B、分布式
C、并行
D、集中式

11.Swift將Object存盤在節點(Node)上,每個節點都是由多個硬碟組成的,并保證物件在多個節點上有備份,默認情況下,Swift會給所有資料保存多少個副本?(10分)
A、1
B、2
C、3(正確答案)
D、4

12.以下關于行業云的描述中,錯誤的是哪項?(10分)
A、能為行業的業務作專門的優化
B、能進一步方便用戶
C、能進一步降低成本
D、可同時支持的范圍較大,如金融云、政務云、醫療云、衛生云等(正確答案)

13.以下哪個不是小微企業使用云計算可以帶來的好處?(10分)
A、省下基礎設施投資
B、省去底層人才投資
C、隨時可用最新的資源
D、獲得大量的機房管理經驗(正確答案)

14.下列關于彈性伸縮服務中,描述正確的是?(10分)
A、彈性伸縮服務中的服務器采用特殊軟性材質生產
B、彈性伸縮的收費形式包括按需付費和包年包月兩種
C、彈性伸縮是一種可以根據服務器壓力的不同自動增加或減少實體的服務(正確答案)
D、以上皆為錯誤

15.以下關于不同租戶間網路描述正確的是?(10分)
A、在騰訊云中,不同租戶之間可以設定沖突的IP地址(正確答案)
B、在騰訊云中,不同租戶之間不可以設定沖突的IP地址
C、不同租戶間網路默認可以互相通信
D、不同租戶間無法通信

16.下面哪個是Docker用到的命名空間?(10分)
A、 PID命名空間
B、 NET命名空間
C、 IPC命名空間
D、以上都是(正確答案)

17.在Docker的描述檔案Dockerfile中,RUN的含義是?(10分)
A、 定義基礎鏡像
B、 作者或者維護者
C、 運行的Linux命令(正確答案)
D、 增加檔案或目錄

18.用戶按照Shell語言規范撰寫程式并將其保存為?(10分)
A、檔案(正確答案)
B、目錄
C、壓縮包
D、圖片

19.Ansible的引數中inventory檔案的位置在哪個目錄下_,(10分)
A、/etc/ansible.cfg
B、/etc/ansible
C、/etc/ansible/hosts(正確答案)
D、 /var/log/ansible

20.Python模塊,是一個Python檔案,它的后綴是以_結尾,(10分)
A、.yml
B、.py(正確答案)
C、.cpp
D、.dll

多選題(200分):

1.下面對專案需求階段表述正確的是?(10分)
A、在軟體需求階段,要分析客戶的業務活動,確定系統的目的、范圍、定義和功能(正確答案)
B、求的調研、挖掘和整理必須由專案經理牽頭,由產品經理負責收集客戶需求(正確答案)
C、測驗人員也需要參與需求分析、評審和總結(正確答案)
D、需求也是專案的靈魂,有了需求才有專案開展的可能(正確答案)

2.關于變更階段下面敘述錯誤的是?(10分)
A、在整個軟體開發程序中,需求變更會帶來不確定性,但是是可以避免的(正確答案)
B、按照變更的影響程度和客戶投入,可以分為關鍵性需求、后續關鍵性需求、后續重要需求、改良型需求和可選性需求等,在時間優先級上進行管理和控制,
C、對一個需求分析做得很好的專案來說,需求規格說明書定義的范圍越詳細越清晰,用戶跟專案經理提出需求變更的幾率就越小,
D、合作雙方在簽訂協議之初,書面約定不需要撰寫修改要求和執行程序,(正確答案)

3.WLAN中常用的加密方式有? (10分)
A、wap(正確答案)
B、wep(正確答案)
C、wep2(正確答案)
D、tkip

4.交換網路中的冗余鏈路會產生? (10分)
A、廣播風暴(正確答案)
B、MAC地址表不穩定(正確答案)
C、多幀復制(正確答案)
D、交換機無法作業

5.下列有關Nginx組態檔nginx.conf的敘述正確的是?(10分)
A、nginx行程數設定為CPU總核心數最佳(正確答案)
B、虛擬主機配置多個域名時,各域名間應用逗號隔開
C、sendfile on;表示為開啟高效檔案傳輸模式,對于執行下載操作等相關應用時,應設定為on
D、設定作業模式與連接數上限時,應考慮單個行程最大連接數(最大連接數=連接數*行程數)(正確答案)

6.Linux系統上,下面哪些檔案是與用戶管理相關的組態檔?(10分)
A、/etc/passwd(正確答案)
B、/etc/shadow(正確答案)
C、/etc/group(正確答案)
D、/etc/password

7.下面哪些是Swift物件存盤的特點?(10分)
A、彈性可伸縮(正確答案)
B、高可用(正確答案)
C、分布式(正確答案)
D、集群式

8.下列選項當中,哪些不是Glance查看鏡像串列的命令?(10分)
A、glance iamges-show(正確答案)
B、glance image-list
C、glance images-list(正確答案)
D、glance image-show(正確答案)

9.下列選項當中,哪些說法是正確的?(10分)
A、nova start是創建云主機
B、nova restart是重啟云主機(正確答案)
C、nova boot是啟動云主機
D、nova reset是重建云主機(正確答案)

10.AP注冊失敗的原因? (10分)
A、AP沒有上電(正確答案)
B、AP連接的網線存在問題(正確答案)
C、AP設備提供的資訊不匹配(正確答案)
D、交換機設備不通(正確答案)

11.塊存盤服務(cinder)為實體提供塊存盤,存盤的分配和消耗是由塊存盤驅動器,或者多后端配置的驅動器決定的,下面那些是可用的驅動程式,(10分)
A、NAS/SAN(正確答案)
B、NFS(正確答案)
C、NTFS
D、Ceph(正確答案)

12.下列選項當中,哪些不是Glance查看鏡像串列的命令(10分)
A、glance iamges-show(正確答案)
B、glance image-list
C、glance images-list(正確答案)
D、glance image-show(正確答案)

13.關于openstack組件的描述以下正確的是?(10分)
A、Heat是一個基于模板來編排復合云應用的服務,(正確答案)
B、Cinder的核心功能是對卷的管理,允許對卷、卷的型別、快照進行處理,(正確答案)
C、Neutron網路服務是OpenStack管理所有的網路方面的物理網路基礎設施和訪問層方面的虛擬網路基礎設施
D、網路也支持安全組,安全組允許管理員在組內定義防火墻規則,(正確答案)

14.騰訊云服務器分為上一代實體、當前一代實體、最新一代實體,若無特殊需求,一般建議新建實體時使用當前一代實體型別,下列哪些屬于當前一代實體?(10分)
A、高IO型I2(正確答案)
B、計算型C2(正確答案)
C、標準型 S1
D、記憶體型 M3

15.下列關于專用宿主機與黑石物理服務器的描述正確的是?(10分)
A、專用宿主機是基于虛擬化技術的云服務器,黑石物理服務器屬于裸金屬架構(正確答案)
B、黑石物理服務器提供的是可以按需購買、按量付費的物理服務器租賃服務(正確答案)
C、專用宿主機是提供以獨享宿主機資源的方式購買、創建云主機的服務(正確答案)
D、專用宿主機無法和云服務器互相通信

16.相較于傳統IDC,云計算具有哪些優勢?(10分)
A、沒有硬體購買和運維成本(正確答案)
B、無需部署和配置物體硬體,資源交付時效性高(正確答案)
C、資源可在短時間內按需彈性分配,減少資源閑置和浪費(正確答案)
D、無需部署和維護用戶自己開發的軟體

17.以下哪些場景適合選擇預付費(包年包月)的計費方式?(10分)
A、具有較穩定的業務場景(正確答案)
B、業務發展有較大波動性,且無法進行準確預測
C、需要長期使用云資源,追求低成本(正確答案)
D、資源使用有臨時性和突發性

18.下面關于Docker容器的說法,正確的是?(10分)
A、 容器是一個鏡像的運行實體(正確答案)
B、 可以通過運行用戶指定的指令進行啟動、停止、洗掉(正確答案)
C、 通過命令分配一個偽終端可以進入容器操作(正確答案)
D、 容器都是相互可見的

19.常見的Python網頁決議技術有_,(10分)
A、正則運算式(正確答案)
B、html.parser(正確答案)
C、lxml(正確答案)
D、Beautiful Soup(正確答案)

20.以下哪些是常見的Shell的種類_,(10分)
A、Bourne Shell(正確答案)
B、Bourne-Again Shell(正確答案)
C、Korn Shell(正確答案)
D、Z Shell(正確答案)

實操題(600分):

1.交換機管理(40分)

在eNSP中使用S5700交換機進行配置,通過一條命令劃分vlan 2、vlan 3、vlan 1004,通過埠組的方式配置埠1-5為access模式,并添加至vlan2中,配置埠10為trunk模式,并放行vlan3,創建三層vlan 2,配置IP地址為:172.16.2.1/24,創建三層vlan1004,配置IP地址為:192.168.4.2/30,通過命令添加默認路由,下一跳為192.168.4.1,(使用完整命令)將上述操作命令及回傳結果以文本形式提交到答題框,

SW1配置:

<Huawei>system-view
[Huawei]sysname SW1
[SW1]vlan batch 2 3 1004
[SW1]port-group 1
[SW1-port-group-1]group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/5
[SW1-port-group-1]port link-type access
[SW1-port-group-1]port default vlan 2
[SW1]interface GigabitEthernet 0/0/10
[SW1-GigabitEthernet0/0/10]port link-type trunk
[SW1-GigabitEthernet0/0/10]port trunk allow-pass vlan 3
[SW1-GigabitEthernet0/0/10]quit
[SW1]interface Vlanif 2
[SW1-Vlanif2]ip address 172.16.2.1 24
[SW1-Vlanif2]quit
[SW1]interface Vlanif 1004
[SW1-Vlanif1004]ip address 192.168.4.2 30
[SW1-Vlanif1004]quit
[SW1]ip route-static 0.0.0.0 0 192.168.4.1

2.交換機管理(40分)

交換機配置:交換機g0/0/1埠連接R1路由器,所屬vlan1001,配置地址192.168.1.2/30,與路由器通信,配置g0/0/2連接PC1機,所屬vlan101,配置PC1機網關地址為172.16.101.254/24,配置默認路由下一跳為路由器地址,路由器配置:R1路由器g0/0/1埠配置地址12.12.12.1/30,配置埠多路復用PAT配置,R1路由器g0/0/2埠配置地址192.168.1.1/30,連接交換機,路由器配置默認路由訪問外部網路,配置靜態路由訪問PC機網路,(所有配置命令使用完整命令)將上述操作命令及回傳結果以文本形式提交到答題框,

架構圖(考試時命令對就行了,只用 一臺SW1和R1就夠了,但為了學到東西所以練習時采用完整的部署方案)

SW1配置:

system-view
[Huawei]sysname SW1
[SW1]vlan batch 101 1001
[SW1]interface GigabitEthernet 0/0/1
[SW1-GigabitEthernet0/0/1]port link-type access
[SW1-GigabitEthernet0/0/1]port default vlan 1001
[SW1-GigabitEthernet0/0/1]quit
[SW1]interface vlan 1001
[SW1-Vlanif1001]ip address 192.168.1.2 30
[SW1-Vlanif1001]quit
[SW1]interface GigabitEthernet 0/0/2
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-GigabitEthernet0/0/2]port default vlan 101
[SW1-GigabitEthernet0/0/2]quit
[SW1]interface vlan 101
[SW1-Vlanif101]ip address 172.16.101.254 24
[SW1-Vlanif101]quit
[SW1]ip route-static 0.0.0.0 0 192.168.1.1

R1配置:

system-view
[Huawei]sysname R1
[R1]acl number 2000
[R1-acl-basic-2000]rule 1 permit
[R1-acl-basic-2000]quit
[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]ip address 12.12.12.1 30
[R1-GigabitEthernet0/0/1]nat outbound 2000
[R1-GigabitEthernet0/0/1]quit
[R1]interface GigabitEthernet 0/0/2
[R1-GigabitEthernet0/0/2]ip address 192.168.1.1 30
[R1-GigabitEthernet0/0/2]quit
[R1]ip route-static 0.0.0.0 0 GigabitEthernet 0/0/1
[R1]ip route-static 172.16.101.0 255.255.255.0 192.168.1.2

結果(看一下連通性):

先查看PC1能不能ping通交換機和路由

在使用R1路由看看能不能ping通外網

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:

[root@xserver1 ~]# yum install -y vsftpd
[root@xserver1 ~]# vim /etc/vsftpd/vsftpd.conf 
anon_root=/opt
[root@xserver1 ~]# systemctl restart vsftpd
[root@xserver1 ~]# systemctl enable vsftpd
Created symlink from /etc/systemd/system/multi-user.target.wants/vsftpd.service to /usr/lib/systemd/system/vsftpd.service.
[root@xserver1 ~]# systemctl stop firewalld
[root@xserver1 ~]# systemctl disable firewalld
# 注釋:selinux防火墻,設定訪問模式(得重啟才生效):
[root@xserver1 ~]# vim /etc/selinux/config 
SELINUX=Permissive
# 注釋:配置臨時訪問模式(無需重啟):
[root@xserver1 ~]# setenforce 0
[root@xserver1 ~]# getenforce 
Permissive

Xserver2:

[root@xserver2 ~]# systemctl stop firewalld
[root@xserver2 ~]# systemctl disable firewalld
# 注釋:selinux防火墻,設定訪問模式(得重啟才生效):
[root@xserver2 ~]# vim /etc/selinux/config 
SELINUX=Permissive
# 注釋:配置臨時訪問模式(無需重啟):
[root@xserver2 ~]# setenforce 0
[root@xserver2 ~]# getenforce 
Permissive
[root@xserver2 ~]# mount -o loop CentOS-7-x86_64-DVD-1511.iso /opt/centos/
mount: /dev/loop0 is write-protected, mounting read-only
[root@xserver2 ~]# cat /etc/yum.repos.d/local.repo 
[centos]
name=centos
baseurl=file:///opt/centos
enabled=1
gpgcheck=0
[iaas]
name=iaas
baseurl=ftp://192.168.100.200/iaas
enabled=1
gpgcheck=0

4.Raid存盤管理(40分)

登錄云主機,在云主機中,存在一個大小為20G的硬碟為/dev/vdb,使用fdisk命令對該硬碟進形磁區,要求分出兩個大小為5G的磁區,使用這兩個磁區,創建名為/dev/md0、raid級別為1的磁盤陣列,創建完成后使用xfs檔案系統進形格式化,并掛載到/mnt目錄下,將mdadm -D /dev/md0命令和df -h命令回傳得結果以文本形式提交到答題框,

  • 因為我用的是CentOS7系統做的實驗所以磁盤是sdb,CentOS6磁盤是vdb:
[root@xiandian ~]# fdisk /dev/sdb 
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xb7634785.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-41943039, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): +5G
Partition 1 of type Linux and of size 5 GiB is set

Command (m for help): n
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): p
Partition number (2-4, default 2): 2
First sector (10487808-41943039, default 10487808): 
Using default value 10487808
Last sector, +sectors or +size{K,M,G} (10487808-41943039, default 41943039): +5G
Partition 2 of type Linux and of size 5 GiB is set

Command (m for help): n
Partition type:
   p   primary (2 primary, 0 extended, 2 free)
   e   extended
Select (default p): p
Partition number (3,4, default 3): 3
First sector (20973568-41943039, default 20973568): 
Using default value 20973568
Last sector, +sectors or +size{K,M,G} (20973568-41943039, default 41943039): +5G
Partition 3 of type Linux and of size 5 GiB is set

Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@xiandian ~]# yum install -y mdadm
[root@xserver1 ~]# mdadm -Cv /dev/md0 -l1 -n2 /dev/sdb[1-2]
mdadm: Note: this array has metadata at the start and
    may not be suitable as a boot device.  If you plan to
    store '/boot' on this device please ensure that
    your boot-loader understands md/v1.x metadata, or use
    --metadata=0.90
mdadm: size set to 5237760K
Continue creating array? y
mdadm: Fail create md0 when using /sys/module/md_mod/parameters/new_array
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.
# 注釋:可以查看一下進度:
[root@xserver1 ~]# cat /proc/mdstat 
Personalities : [raid1] 
md0 : active raid1 sdb2[1] sdb1[0]
      5237760 blocks super 1.2 [2/2] [UU]
      [======>..............]  resync = 30.5% (1601792/5237760) finish=0.3min speed=200224K/sec 
unused devices: <none>
[root@xserver1 ~]# mkfs.xfs /dev/md0 
meta-data=/dev/md0               isize=256    agcount=4, agsize=327360 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0        finobt=0
data     =                       bsize=4096   blocks=1309440, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@xserver1 ~]# mount /dev/md0 /mnt/
[root@xserver1 ~]# mdadm -D /dev/md0 
/dev/md0:
           Version : 1.2
     Creation Time : Thu May 14 09:15:04 2020
        Raid Level : raid1
        Array Size : 5237760 (5.00 GiB 5.36 GB)
     Used Dev Size : 5237760 (5.00 GiB 5.36 GB)
      Raid Devices : 2
     Total Devices : 2
       Persistence : Superblock is persistent
       Update Time : Thu May 14 09:20:57 2020
             State : clean 
    Active Devices : 2
   Working Devices : 2
    Failed Devices : 0
     Spare Devices : 0
Consistency Policy : unknown
              Name : xserver1:0  (local to host xserver1)
              UUID : 8440d04c:3cf2e84a:4d524020:1072f7b4
            Events : 17
    Number   Major   Minor   RaidDevice State
       0       8       17        0      active sync   /dev/sdb1
       1       8       18        1      active sync   /dev/sdb2
[root@xserver1 ~]# df -h
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root   32G  5.2G   27G  17% /
devtmpfs                 903M     0  903M   0% /dev
tmpfs                    913M     0  913M   0% /dev/shm
tmpfs                    913M  8.6M  904M   1% /run
tmpfs                    913M     0  913M   0% /sys/fs/cgroup
/dev/sda1                509M  125M  384M  25% /boot
/dev/mapper/centos-home  4.0G   33M  4.0G   1% /home
tmpfs                    183M     0  183M   0% /run/user/0
/dev/md0                 5.0G   33M  5.0G   1% /mnt

5.主從資料庫管理(40分)

使用提供的兩臺虛擬機,在虛擬機上安裝mariadb資料庫,并配置為主從資料庫,實作兩個資料庫的主從同步,配置完畢后,請在從節點上的資料庫中執行“show slave status \G”命令查詢從節點復制狀態,將查詢到的結果以文本形式提交到答題框,

  • 上傳gpmall-repo中有mariadb子檔案的檔案到/root目錄下:

Mysql1:

[root@xiandian ~]# hostnamectl set-hostname mysql1
[root@mysql1 ~]# login
[root@mysql1 ~]# vim /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.111    mysql1
192.168.1.112    mysql2
[root@mysql1 ~]# systemctl stop firewalld
[root@mysql1 ~]# systemctl disable firewalld
[root@mysql1 ~]# setenforce 0
[root@mysql1 ~]# vim /etc/selinux/config 
SELINUX=Permissive
[root@mysql1~]# vim /etc/yum.repos.d/local.repo 
[centos]
name=centos
baseurl=file:///opt/centos
enabled=1
gpgcheck=0
[mariadb]
name=mariadb
baseurl=file:///root/gpmall-repo
enabled=1
gpgcheck=0
[root@mysql1 ~]# yum install -y mariadb mariadb-server
[root@mysql1 ~]# systemctl restart mariadb
[root@mysql1 ~]# mysql_secure_installation
[root@mysql1 ~]# vim /etc/my.cnf
# 注釋:在[mysqld]下添加:
log_bin = mysql-bin
binlog_ignore_db = mysql
server_id = 10
[root@mysql1 ~]# mysql -uroot -p000000
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 5.5.65-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> grant all privileges on *.* to 'root'@'%' identified by '000000';
Query OK, 0 rows affected (0.00 sec)

# 注釋:如果你不想配置上面的host檔案可以不使用主機名mysql2的形式,可以直接打IP地址,用戶可以隨意指定,只是一個用于連接的而已
MariaDB [(none)]> grant replication slave on *.* to 'user'@'mysql2' identified by '000000';
Query OK, 0 rows affected (0.00 sec)

Mysql2:

[root@xiandian ~]# hostnamectl set-hostname mysql2
[root@mysql2 ~]# login
[root@mysql2 ~]# vim /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.111   mysql1
192.168.1.112   mysql2
[root@mysql2 ~]# systemctl stop firewalld
[root@mysql2 ~]# systemctl disable firewalld
[root@mysql2 ~]# setenforce 0
[root@mysql2 ~]# vim /etc/selinux/config 
SELINUX=Permissive
[root@mysql2~]# vim /etc/yum.repos.d/local.repo 
[centos]
name=centos
baseurl=file:///opt/centos
enabled=1
gpgcheck=0
[mariadb]
name=mariadb
baseurl=file:///root/gpmall-repo
enabled=1
gpgcheck=0
[root@mysql2 ~]# yum install -y mariadb mariadb-server
[root@mysql2 ~]# systemctl restart mariadb
[root@mysql2 ~]# mysql_secure_installation
[root@mysql2 ~]# vim /etc/my.cnf
# 注釋:在[mysqld]下添加:
log_bin = mysql-bin
binlog_ignore_db = mysql
server_id = 20
[root@mysql2 ~]# mysql -uroot -p000000
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 5.5.65-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

# 注釋:如果你不想配置上面的host檔案可以不使用主機名mysql1的形式,可以直接打IP地址,這里的用戶,密碼必須和上面mysql1配置的user一致
MariaDB [(none)]> change master to master_host='mysql1',master_user='user',master_password='000000';
Query OK, 0 rows affected (0.02 sec)
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)

驗證結果(主從是否同步):

Mysql1:

[root@mysql1 ~]# mysql -uroot -p000000
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 26
Server version: 5.5.65-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database test;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> use test;
Database changed
MariaDB [test]> create table demotables(id int not null primary key,name varchar(10),addr varchar(20));
Query OK, 0 rows affected (0.01 sec)
MariaDB [test]> insert into demotables values(1,'zhangsan','lztd');
Query OK, 0 rows affected (0.00 sec)
MariaDB [test]> select * from demotables;
+----+----------+------+
| id | name     | addr |
+----+----------+------+
|  1 | zhangsan | lztd |
+----+----------+------+
1 rows in set (0.00 sec)

Mysql2:

[root@mysql2 ~]# mysql -uroot -p000000
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 24
Server version: 5.5.65-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)
MariaDB [(none)]> use test;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [test]> show tables;
+----------------+
| Tables_in_test |
+----------------+
| demotables     |
+----------------+
1 row in set (0.00 sec)
MariaDB [test]> select * from demotables;
+----+----------+------+
| id | name     | addr |
+----+----------+------+
|  1 | zhangsan | lztd |
+----+----------+------+
1 rows in set (0.00 sec)

6.讀寫分離資料庫管理(40分)

使用提供的虛擬機與軟體包,基于上一題構建的主從資料庫,進一步完成Mycat讀寫分離資料庫的配置安裝,需要用的組態檔schema.xml檔案如下所示(server.xml檔案不再給出): select user() 配置讀寫分離資料庫完畢后,使用netstat -ntpl命令查詢埠啟動情況,最后將netstat -ntpl命令的回傳結果以文本形式提交到答題框,

Mycat & Mysql1 & Mysql2都執行以下操作:

# 注釋:這個其實配不配都可以,看個人喜歡用主機名還是IP地址咯
[root@mycat ~]# vim /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.111    mysql1
192.168.1.112    mysql2
192.168.1.113    mycat

Mycat:

  • 上傳gpmall-repo中有mariadb子檔案的檔案和Mycat-server-1.6-RELEASE-20161028204710-linux.gz到/root目錄下,并配置yum源:
[root@mycat ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.111   mysql1
192.168.1.112   mysql2
192.168.1.113   mycat
[root@mycat~]# vim /etc/yum.repos.d/local.repo 
[centos]
name=centos
baseurl=file:///opt/centos
enabled=1
gpgcheck=0
[mariadb]
name=mariadb
baseurl=file:///root/gpmall-repo
enabled=1
gpgcheck=0
[root@mycat ~]# yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel
[root@mycat ~]# tar -zvxf Mycat-server-1.6-RELEASE-20161028204710-linux.gz -C /usr/local/
[root@mycat ~]# chown -R 777 /usr/local/mycat/
[root@mycat ~]# vim /etc/profile
export MYCAT_HOME=/usr/local/mycat/
[root@mycat ~]# source /etc/profile
[root@mycat ~]# vim /usr/local/mycat/conf/schema.xml
<?xml version='1.0'?>
<!DOCTYPE mycat:schema SYSTEM "schema.dtd">
<mycat:schema xmlns:mycat="http://io.mycat/">
<!--注釋:name=USERDB指的是邏輯資料庫,在后面添加一個dataNode="dn1",dn1上系結的是真是資料庫-->
<schema name="USERDB" checkSQLschema="true" sqlMaxLimit="100" 
dataNode="dn1"></schema>
<!--注釋:name="dn1"上面與邏輯資料庫參考的名稱,database="test"真實資料庫名字-->
<dataNode name="dn1" dataHost="localhost1" database="test" />
<dataHost name="localhost1" maxCon="1000" minCon="10" balance="3" dbType="mysql" 
dbDriver="native" writeType="0" switchType="1" slaveThreshold="100">
 <heartbeat>select user()</heartbeat>
 <writeHost host="hostM1" url="192.168.1.111:3306" user="root" password="000000">
 <readHost host="hostS1" url="192.168.1.112:3306" user="root" password="000000" />
 </writeHost>
</dataHost>
</mycat:schema>
[root@mycat ~]# chown root:root /usr/local/mycat/conf/schema.xml
# 注釋:修改root用戶的訪問密碼與資料庫
[root@mycat ~]# vim /usr/local/mycat/conf/server.xml
        <user name="root">
                <property name="password">000000</property>
                <property name="schemas">USERDB</property>

                <!-- 表級 DML 權限設定 -->
                <!--            
                <privileges check="false">
                        <schema name="TESTDB" dml="0110" >
                                <table name="tb01" dml="0000"></table>
                                <table name="tb02" dml="1111"></table>
                        </schema>
                </privileges>           
                 -->
        </user>
# 注釋:洗掉之后的<user name="user"></user>的標簽與內容
[root@mycat ~]# /bin/bash /usr/local/mycat/bin/mycat start
Starting Mycat-server...
[root@mycat ~]# netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1114/sshd           
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1992/master         
tcp        0      0 127.0.0.1:32000         0.0.0.0:*               LISTEN      3988/java           
tcp6       0      0 :::45929                :::*                    LISTEN      3988/java           
tcp6       0      0 :::9066                 :::*                    LISTEN      3988/java           
tcp6       0      0 :::40619                :::*                    LISTEN      3988/java           
tcp6       0      0 :::22                   :::*                    LISTEN      1114/sshd           
tcp6       0      0 ::1:25                  :::*                    LISTEN      1992/master         
tcp6       0      0 :::1984                 :::*                    LISTEN      3988/java           
tcp6       0      0 :::8066                 :::*                    LISTEN      3988/java   
# 注釋:驗證結果(讀寫分離是否成功):
[root@mycat ~]# yum install -y MariaDB-client
# 注釋:查看邏輯庫
[root@mycat ~]# mysql -h 127.0.0.1 -P8066 -uroot -p000000
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.003 sec)

MySQL [(none)]> use USERDB
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MySQL [USERDB]> show tables;
+----------------+
| Tables_in_test |
+----------------+
| demotables     |
+----------------+
1 row in set (0.007 sec)

MySQL [USERDB]> select * from demotables;
+----+----------+------+
| id | name     | addr |
+----+----------+------+
|  1 | zhangsan | lztd |
|  2 | xiaohong | lztd |
|  3 | xiaoli   | lztd |
|  4 | lihua    | nnzy |
+----+----------+------+
4 rows in set (0.060 sec)

MySQL [USERDB]> insert into demotables values(5,'tomo','hfdx');
Query OK, 1 row affected (0.013 sec)

MySQL [USERDB]> select * from demotables;
+----+----------+------+
| id | name     | addr |
+----+----------+------+
|  1 | zhangsan | lztd |
|  2 | xiaohong | lztd |
|  3 | xiaoli   | lztd |
|  4 | lihua    | nnzy |
|  5 | tomo     | hfdx |
+----+----------+------+
5 rows in set (0.004 sec)

MySQL [USERDB]> exit;
Bye
# 注釋:查詢對資料庫讀寫操作的分離資訊
[root@mycat ~]# mysql -h 127.0.0.1 -P9066 -uroot -p000000 -e 'show @@datasource;'
+----------+--------+-------+---------------+------+------+--------+------+------+---------+-----------+------------+
| DATANODE | NAME   | TYPE  | HOST          | PORT | W/R  | ACTIVE | IDLE | SIZE | EXECUTE | READ_LOAD | WRITE_LOAD |
+----------+--------+-------+---------------+------+------+--------+------+------+---------+-----------+------------+
| dn1      | hostM1 | mysql | 192.168.1.111 | 3306 | W    |      0 |   10 | 1000 |      45 |         0 |          1 |
| dn1      | hostS1 | mysql | 192.168.1.112 | 3306 | R    |      0 |    6 | 1000 |      43 |         4 |          0 |
+----------+--------+-------+---------------+------+------+--------+------+------+---------+-----------+------------+

一些引數注釋:

sqlMaxLimit 配置默認查詢數量
database 為真實資料庫名
balance="0" 不開啟讀寫分離機制,所有讀操作都發送到當前可用的writeHost上
balance="1" 全部的readHost與stand by writeHost參與select陳述句的負載均衡,簡單來說,當雙主雙從模式(M1->S1,M2->S2,并且M1與M2互為主備),正常情況下,M2、S1、S2都參與select陳述句的負載均衡
balance="2" 所有讀操作都隨機的在writeHost、readhost上分發
balance="3" 所有讀請求隨機地分發到wiriterHost對應的readhost執行,writerHost不負擔讀壓力,注意balance=3只在1.4及其以后版本有,1.3版本沒有
writeType="0" 所有寫操作發送到配置的第一個writeHost,第一個掛了需要切換到還生存的第二個writeHost,重新啟動后已切換后的為準,切換記錄在組態檔dnindex.properties中
writeType="1" 所有寫操作都隨機的發送到配置的writeHost

7.Zookeeper集群(40分)

使用提供的三臺虛擬機和軟體包,完成Zookeeper集群的安裝與配置,配置完成后,在相應的目錄使用./zkServer.sh status命令查看三個Zookeeper節點的狀態,將三個節點的狀態以文本形式提交到答題框,

Zookeeper1:

[root@xiandian ~]# hostnamectl set-hostname zookeeper1
[root@xiandian ~]# bash
[root@zookeeper1 ~]# vim /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.10    zookeeper1
192.168.1.20    zookeeper2
192.168.1.30    zookeeper3
# 注釋:在zookeeper1節點上傳gpmall-repo,然后做vsftp進行共享,我上傳到/opt
[root@zookeeper1 ~]# vim /etc/yum.repos.d/local.repo 
[centos]
name=centos
baseurl=file:///opt/centos
enabled=1
gpgcheck=0
[gpmall]
name=gpmall
baseurl=file:///opt/gpmall-repo
enabled=1
gpgcheck=0
[root@zookeeper1 ~]# yum repolist
[root@zookeeper1 ~]# yum install -y vsftpd
[root@zookeeper1 ~]# vim /etc/vsftpd/vsftpd.conf 
# 注釋:添加:
anon_root=/opt
[root@zookeeper1 ~]# systemctl restart vsftpd
[root@zookeeper1 ~]# yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel
[root@zookeeper1 ~]# java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
# 注釋:將zookeeper-3.4.14.tar.gz上傳至三個節點或者設定nfs進行共享
[root@zookeeper1 ~]# tar -zvxf zookeeper-3.4.14.tar.gz
[root@zookeeper1 ~]# cd zookeeper-3.4.14/conf/
[root@zookeeper1 conf]# mv zoo_sample.cfg zoo.cfg
[root@zookeeper1 conf]# vim zoo.cfg 
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the 
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
server.1=192.168.1.10:2888:3888
server.2=192.168.1.20:2888:3888
server.3=192.168.1.30:2888:3888
[root@zookeeper1 conf]# grep -n '^'[a-Z] zoo.cfg 
2:tickTime=2000
5:initLimit=10
8:syncLimit=5
12:dataDir=/tmp/zookeeper
14:clientPort=2181
29:server.1=192.168.1.10:2888:3888
30:server.2=192.168.1.20:2888:3888
31:server.3=192.168.1.30:2888:3888
[root@zookeeper1 conf]# cd 
[root@zookeeper1 ~]# mkdir /tmp/zookeeper
[root@zookeeper1 ~]# vim /tmp/zookeeper/myid
1
[root@zookeeper1 ~]# cat /tmp/zookeeper/myid 
1
[root@zookeeper1 ~]# cd zookeeper-3.4.14/bin/
[root@zookeeper1 bin]# ./zkServer.sh start
zookeeper JMX enabled by default
Using config: /root/zookeeper-3.4.14/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@zookeeper1 bin]# ./zkServer.sh status
zookeeper JMX enabled by default
Using config: /root/zookeeper-3.4.14/bin/../conf/zoo.cfg
Mode: follower

Zookeeper2:

[root@xiandian ~]# hostnamectl set-hostname zookeeper2
[root@xiandian ~]# bash
[root@zookeeper2 ~]# vim /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.10    zookeeper1
192.168.1.20    zookeeper2
192.168.1.30    zookeeper3
[root@zookeeper2 ~]# vim /etc/yum.repos.d/local.repo 
[centos]
name=centos
baseurl=file:///opt/centos
enabled=1
gpgcheck=0
[gpmall]
name=gpmall
baseurl=ftp://zookeeper1/gpmall-repo
enabled=1
gpgcheck=0
[root@zookeeper2 ~]# yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel
[root@zookeeper2 ~]# java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
# 注釋:將zookeeper-3.4.14.tar.gz上傳至三個節點或者設定nfs進行共享
[root@zookeeper2 ~]# tar -zvxf zookeeper-3.4.14.tar.gz
[root@zookeeper2 ~]# cd zookeeper-3.4.14/conf/
[root@zookeeper2 conf]# mv zoo_sample.cfg zoo.cfg
[root@zookeeper2 conf]# vim zoo.cfg 
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the 
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
server.1=192.168.1.10:2888:3888
server.2=192.168.1.20:2888:3888
server.3=192.168.1.30:2888:3888
[root@zookeeper2 conf]# grep -n '^'[a-Z] zoo.cfg 
2:tickTime=2000
5:initLimit=10
8:syncLimit=5
12:dataDir=/tmp/zookeeper
14:clientPort=2181
29:server.1=192.168.1.10:2888:3888
30:server.2=192.168.1.20:2888:3888
31:server.3=192.168.1.30:2888:3888
[root@zookeeper2 conf]# cd 
[root@zookeeper2 ~]# mkdir /tmp/zookeeper
[root@zookeeper2 ~]# vim /tmp/zookeeper/myid
2
[root@zookeeper1 ~]# cat /tmp/zookeeper/myid 
2
[root@zookeeper2 ~]# cd zookeeper-3.4.14/bin/
[root@zookeeper2 bin]# ./zkServer.sh start
zookeeper JMX enabled by default
Using config: /root/zookeeper-3.4.14/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@zookeeper2 bin]# ./zkServer.sh status
zookeeper JMX enabled by default
Using config: /root/zookeeper-3.4.14/bin/../conf/zoo.cfg
Mode: leader

Zookeeper3:

[root@xiandian ~]# hostnamectl set-hostname zookeeper3
[root@xiandian ~]# bash
[root@zookeeper3 ~]# vim /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.10    zookeeper1
192.168.1.20    zookeeper2
192.168.1.30    zookeeper3
[root@zookeeper3 ~]# vim /etc/yum.repos.d/local.repo 
[centos]
name=centos
baseurl=file:///opt/centos
enabled=1
gpgcheck=0
[gpmall]
name=gpmall
baseurl=ftp://zookeeper1/gpmall-repo
enabled=1
gpgcheck=0
[root@zookeeper3 ~]# yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel
[root@zookeeper3 ~]# java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
# 注釋:將zookeeper-3.4.14.tar.gz上傳至三個節點或者設定nfs進行共享
[root@zookeeper3 ~]# tar -zvxf zookeeper-3.4.14.tar.gz
[root@zookeeper3 ~]# cd zookeeper-3.4.14/conf/
[root@zookeeper3 conf]# mv zoo_sample.cfg zoo.cfg
[root@zookeeper3 conf]# vim zoo.cfg 
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the 
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
server.1=192.168.1.10:2888:3888
server.2=192.168.1.20:2888:3888
server.3=192.168.1.30:2888:3888
[root@zookeeper3 conf]# grep -n '^'[a-Z] zoo.cfg 
2:tickTime=2000
5:initLimit=10
8:syncLimit=5
12:dataDir=/tmp/zookeeper
14:clientPort=2181
29:server.1=192.168.1.10:2888:3888
30:server.2=192.168.1.20:2888:3888
31:server.3=192.168.1.30:2888:3888
[root@zookeeper3 conf]# cd 
[root@zookeeper3 ~]# mkdir /tmp/zookeeper
[root@zookeeper3 ~]# vim /tmp/zookeeper/myid
3
[root@zookeeper3 ~]# cat /tmp/zookeeper/myid 
3
[root@zookeeper3 ~]# cd zookeeper-3.4.14/bin/
[root@zookeeper3 bin]# ./zkServer.sh start
zookeeper JMX enabled by default
Using config: /root/zookeeper-3.4.14/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@zookeeper3 bin]# ./zkServer.sh status
zookeeper JMX enabled by default
Using config: /root/zookeeper-3.4.14/bin/../conf/zoo.cfg
Mode: follower

8.Kafka集群(40分)

使用提供的三臺虛擬機和軟體包,完成Kafka集群的安裝與配置,配置完成后,在相應的目錄使用 ./kafka-topics.sh --create --zookeeper 你的IP:2181 --replication-factor 1 --partitions 1 --topic test創建topic,將輸入命令后的回傳結果以文本形式提交到答題框,

  • 將kafka_2.11-1.1.1.tgz上傳至三個節點:(可以在上體的基礎上做kafka,因為kafka依賴于zookeeper)

Zookeeper1:

[root@zookeeper1 ~]# tar -zvxf kafka_2.11-1.1.1.tgz
[root@zookeeper1 ~]# cd kafka_2.11-1.1.1/config/
[root@zookeeper1 config]# vim server.properties
把broker.id=0和zookeeper.connect=localhost:2181使用#注釋掉可以使用在vim中/加要搜索的名字,來查找,并添加三行新的內容:
#broker.id=0
#zookeeper.connect=localhost:2181
broker.id = 1
zookeeper.connect = 192.168.1.10:2181,192.168.1.20:2181,192.168.1.30:2181
listeners = PLAINTEXT://192.168.1.10:9092

[root@zookeeper1 config]# cd /root/kafka_2.11-1.1.1/bin/
[root@zookeeper1 bin]# ./kafka-server-start.sh -daemon ../config/server.properties 
[root@zookeeper1 bin]# jps
17645 QuorumPeerMain
18029 Kafka
18093 Jps
# 注釋:創建topic(下面的IP請設定為自己節點的IP):
[root@zookeeper1 bin]# ./kafka-topics.sh --create --zookeeper 192.168.1.10:2181 --replication-factor 1 --partitions 1 --topic test
Created topic "test".
# 注釋:測驗結果:
[root@zookeeper1 bin]# ./kafka-topics.sh --list --zookeeper 192.168.1.10:2181
test

Zookeeper2:

[root@zookeeper2 ~]# tar -zvxf kafka_2.11-1.1.1.tgz
[root@zookeeper2 ~]# cd kafka_2.11-1.1.1/config/
[root@zookeeper2 config]# vim server.properties
# 注釋:把broker.id=0和zookeeper.connect=localhost:2181使用#注釋掉可以使用在vim中/加要搜索的名字,來查找,并添加三行新的內容:
#broker.id=0
#zookeeper.connect=localhost:2181
broker.id = 2
zookeeper.connect = 192.168.1.10:2181,192.168.1.20:2181,192.168.1.30:2181
listeners = PLAINTEXT://192.168.1.20:9092

[root@zookeeper2config]# cd /root/kafka_2.11-1.1.1/bin/
[root@zookeeper2 bin]# ./kafka-server-start.sh -daemon ../config/server.properties 
[root@zookeeper2 bin]# jps
3573 Kafka
3605 Jps
3178 QuorumPeerMain
# 注釋:測驗結果:
[root@zookeeper2 bin]# ./kafka-topics.sh --list --zookeeper 192.168.1.20:2181
test

Zookeeper3:

[root@zookeeper3 ~]# tar -zvxf kafka_2.11-1.1.1.tgz
[root@zookeeper3 ~]# cd kafka_2.11-1.1.1/config/
[root@zookeeper3 config]# vim server.properties
# 注釋:把broker.id=0和zookeeper.connect=localhost:2181使用#注釋掉可以使用在vim中/加要搜索的名字,來查找,并添加三行新的內容:
#broker.id=0
#zookeeper.connect=localhost:2181
broker.id = 3
zookeeper.connect = 192.168.1.10:2181,192.168.1.20:2181,192.168.1.30:2181
listeners = PLAINTEXT://192.168.1.30:9092

[root@zookeeper3 config]# cd /root/kafka_2.11-1.1.1/bin/
[root@zookeeper3 bin]# ./kafka-server-start.sh -daemon ../config/server.properties 
[root@zookeeper3 bin]# jps 
3904 QuorumPeerMain
4257 Kafka
4300 Jps
# 注釋:測驗結果:
[root@zookeeper3 bin]# ./kafka-topics.sh --list --zookeeper 192.168.1.30:2181
test

9.應用商城系統(40分)

繼續使用上題的三臺虛擬機,使用提供的軟體包,基于集群應用系統部署,部署完成后,進行登錄,(訂單中填寫的識訓地址填寫自己學校的地址,識訓人填寫自己的實際聯系方式)最后使用curl命令去獲取商城首頁的回傳資訊,將curl http://你自己的商城IP/#/home獲取到的結果以文本形式提交到答題框,

  • 將所需的zookeep,kafka和gpmall-repo的包上傳到mall虛擬機(按題目要求的答案,其實單節點也一樣,推薦單節點部署,集群部署,看大家是否需要,需要的話評論一下,我到時候更新集群部署):
[root@mall ~]# vim /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.111   mall
192.168.1.111   kafka.mall
192.168.1.111   redis.mall
192.168.1.111   mysql.mall
192.168.1.111   zookeeper.mall
[root@mall ~]# vim /etc/yum.repos.d/local.repo 
[centos]
name=centos
baseurl=file:///opt/centos
enabled=1
gpgcheck=0
[gpmall]
name=gpmall
baseurl=file:///root/gpmall-repo
enabled=1
gpgcheck=0 
[root@mall ~]# yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel
[root@mall ~]# java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
[root@mall ~]# yum install -y redis
[root@mall ~]# yum install -y nginx
[root@mall ~]# yum install -y mariadb mariadb-server
[root@mall ~]# tar -zvxf zookeeper-3.4.14.tar.gz
[root@mall ~]# cd zookeeper-3.4.14/conf
[root@mall conf]# mv zoo_sample.cfg zoo.cfg
[root@mall conf]# cd /root/zookeeper-3.4.14/bin/
[root@mall bin]# ./zkServer.sh start
[root@mall bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /root/zookeeper-3.4.14/bin/../conf/zoo.cfg
Mode: standalone
[root@mall bin]# cd
[root@mall ~]# tar -zvxf kafka_2.11-1.1.1.tgz
[root@mall ~]# cd kafka_2.11-1.1.1/bin/
[root@mall bin]# ./kafka-server-start.sh -daemon ../config/server.properties
[root@mall bin]# jps 
7249 Kafka
17347 Jps
6927 QuorumPeerMain
[root@mall bin]# cd
[root@mall ~]# vim /etc/my.cnf
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
[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
[root@mall ~]# systemctl restart mariadb
[root@mall ~]# systemctl enable mariadb
[root@mall ~]# mysqladmin -uroot password 123456
[root@mall ~]# mysql -uroot -p123456
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.3.18-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> create database gpmall;
Query OK, 1 row affected (0.002 sec)
MariaDB [(none)]> grant all privileges on *.* to root@localhost identified by '123456' with grant option;
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> grant all privileges on *.* to root@'%' identified by '123456' with grant option;
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> use gpmall;
Database changed
MariaDB [gpmall]> source /root/gpmall-xiangmubao-danji/gpmall.sql
MariaDB [gpmall]> Ctrl-C -- exit!
[root@mall ~]# vim /etc/redis.conf
# 注釋:將bind 127.0.0.1這一行注釋掉;將protected-mode yes 改為 protected-mode no
#bind 127.0.0.1
Protected-mode no
[root@mall ~]# systemctl restart redis
[root@mall ~]# systemctl enable redis
Created symlink from /etc/systemd/system/multi-user.target.wants/redis.service to /usr/lib/systemd/system/redis.service.
[root@mall ~]# rm -rf /usr/share/nginx/html/*
[root@mall ~]# cp -rf gpmall-xiangmubao-danji/dist/* /usr/share/nginx/html/
[root@mall ~]# vim /etc/nginx/conf.d/default.conf
# 注釋:在server塊中添加三個location塊
server {
...
    location /user {
        proxy_pass http://127.0.0.1:8082;
    }   

    location /shopping {
        proxy_pass http://127.0.0.1:8081;
    }

    location /cashier {
        proxy_pass http://127.0.0.1:8083;
    }
...
}
[root@mall ~]# systemctl restart nginx
[root@mall ~]# systemctl enable nginx
Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.
[root@mall ~]# cd gpmall-xiangmubao-danji/
[root@mall gpmall-xiangmubao-danji]# nohup java -jar shopping-provider-0.0.1-SNAPSHOT.jar &
[1] 3531
[root@mall gpmall-xiangmubao-danji]# nohup: ignoring input and appending output to ‘nohup.out’

[root@mall gpmall-xiangmubao-danji]# nohup java -jar user-provider-0.0.1-SNAPSHOT.jar &
[2] 3571
[root@mall gpmall-xiangmubao-danji]# nohup: ignoring input and appending output to ‘nohup.out’

[root@mall gpmall-xiangmubao-danji]# nohup java -jar gpmall-shopping-0.0.1-SNAPSHOT.jar &
[3] 3639
[root@mall gpmall-xiangmubao-danji]# nohup: ignoring input and appending output to ‘nohup.out’

[root@mall gpmall-xiangmubao-danji]# nohup java -jar gpmall-user-0.0.1-SNAPSHOT.jar &
[4] 3676
[root@mall gpmall-xiangmubao-danji]# nohup: ignoring input and appending output to ‘nohup.out’

[root@mall gpmall-xiangmubao-danji]# jobs
[1]   Running          nohup java -jar shopping-provider-0.0.1-SNAPSHOT.jar &
[2]   Running          nohup java -jar user-provider-0.0.1-SNAPSHOT.jar &
[3]-   Running          nohup java -jar gpmall-shopping-0.0.1-SNAPSHOT.jar &
[4]+  Running          nohup java -jar gpmall-user-0.0.1-SNAPSHOT.jar &
[root@mall gpmall-xiangmubao-danji]# curl http://192.168.1.111/#/home
<!DOCTYPE html><html><head><meta charset=utf-8><title>1+x-示例專案</title><meta name=keywords content=""><meta name=description content=""><meta http-equiv=X-UA-Compatible content="IE=Edge"><meta name=wap-font-scale content=no><link rel="shortcut icon " type=images/x-icon href=/static/images/favicon.ico><link href=/static/css/app.8d4edd335a61c46bf5b6a63444cd855a.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.2d17a82764acff8145be.js></script><script type=text/javascript src=/static/js/vendor.4f07d3a235c8a7cd4efe.js></script><script type=text/javascript src=/static/js/app.81180cbb92541cdf912f.js></script></body></html><style>body{
min-width:1250px;}</style>

10.Keystone管理(40分)

使用提供的“all-in-one”虛擬機,在keystone中創建用戶testuser,密碼為password,創建好之后,查看testuser的詳細資訊,以文本形式提交以上操作命令到答題框,

[root@xiandian~]# source /etc/keystone/admin-openrc.sh
[root@xiandian~]# openstack user create  --domain xiandian  --password password testuser
+-----------+----------------------------------+
| Field     | Value                            |
+-----------+----------------------------------+
| domain_id | 5a486c51bc8e4dffa4a181f6c54e0938 |
| enabled   | True                             |
| id        | ec6d67cdb3ac4b3ca827587c14be0a3e |
| name      | testuser                         |
+-----------+----------------------------------+
[root@xiandian~]# openstack user show testuser
+-----------+----------------------------------+
| Field     | Value                            |
+-----------+----------------------------------+
| domain_id | 639e7d52170d4759b5438e3b29bbf339 |
| enabled   | True                             |
| id        | df8ca15f17a8435d8889987b4b78c7a2 |
| name      | testuser                         |
+-----------+----------------------------------+ 

11.物件存盤管理(40分)

使用提供的“all-in-one”虛擬機,使用openstack命令,創建名為examtest的容器并查詢,上傳一個aaa.txt(可自行創建)檔案到這個容器中并查詢,依次將操作命令和回傳結果以文本形式提交到答題框,

[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 |
+---------+

12.Glance管理(40分)

登錄“all-in-one”節點,使用crt的傳輸工具將提供的cirros-0.3.4-x86_64-disk.img鏡像上傳至“all-in-one”節點的/root目錄下;使用glance命令將鏡像上傳,并命名為mycirros,最后使用glance命令查看該鏡像的詳細資訊,將上述所有操作命令和回傳結果以文本形式提交到答題框,

[root@xiandian ~]# source /etc/keystone/admin-openrc.sh
[root@xiandian ~]# glance image-create  --name mycirros  --disk-format qcow2  --container-format bare  --progress  <  cirros-0.3.4-x86_64-disk.img
[=============================>] 100%
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
| checksum         | ee1eca47dc88f4879d8a229cc70a07c6     |
| container_format | bare                                 |
| created_at       | 2019-10-24T10:16:52Z                 |
| disk_format      | qcow2                                |
| id               | d3663be2-3ebf-443a-b3fc-b3e39bda8783 |
| min_disk         | 0                                    |
| min_ram          | 0                                    |
| name             | mycirros                             |
| owner            | 0ab2dbde4f754b699e22461426cd0774     |
| protected        | False                                |
| size             | 13287936                             |
| status           | active                               |
| tags             | []                                   |
| updated_at       | 2019-10-24T10:16:52Z                 |
| virtual_size     | None                                 |
| visibility       | private                              |
+------------------+--------------------------------------+
[root@xiandian ~]# glance image-show d3663be2-3ebf-443a-b3fc-b3e39bda8783
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
| checksum         | ee1eca47dc88f4879d8a229cc70a07c6     |
| container_format | bare                                 |
| created_at       | 2019-10-24T10:16:52Z                 |
| disk_format      | qcow2                                |
| id               | d3663be2-3ebf-443a-b3fc-b3e39bda8783 |
| min_disk         | 0                                    | 
| min_ram          | 0                                    |
| name             | mycirros                             |
| owner            | 0ab2dbde4f754b699e22461426cd0774     |
| protected        | False                                |
| size             | 13287936                             |
| status           | active                               |
| tags             | []                                   |
| updated_at       | 2019-10-24T10:16:52Z                 |
| virtual_size     | None                                 |
| visibility       | private                              |
+------------------+--------------------------------------+

13.Docker安裝(40分)

使用提供的虛擬機和軟體包,自行配置YUM源,安裝docker-ce服務,安裝完畢后執行docker info命令的回傳結果以文本形式提交到答題框,

  • 先上傳Docker.tar.gz到/root目錄,并解壓:
[root@xiandian ~]# tar -zvxf Docker.tar.gz
[root@xiandian ~]# vim /etc/yum.repos.d/local.repo 
[centos]
name=centos
baseurl=file:///opt/centos
enabled=1
gpgcheck=0
[docker]
name=docker
baseurl=file:///root/Docker
enabled=1
gpgcheck=0
[root@xiandian ~]# iptables -F
[root@xiandian ~]# iptables -X
[root@xiandian ~]# iptables -Z
[root@xiandian ~]# iptables-save 
# Generated by iptables-save v1.4.21 on Fri May 15 02:00:29 2020
*filter
:INPUT ACCEPT [20:1320]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [11:1092]
COMMIT
# Completed on Fri May 15 02:00:29 2020
[root@xiandian ~]# vim /etc/selinux/config 
SELINUX=disabled
# 注釋:關閉交換磁區:
[root@xiandian ~]# vim /etc/fstab 
#/dev/mapper/centos-swap swap            swap    defaults        0 0
[root@xiandian ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:           1824          95        1591           8         138        1589
Swap:             0           0           0
# 注釋:在配置路由轉發前,先升級系統并重啟,不然會有兩條規則可能報錯:
[root@xiandian ~]# yum upgrade -y
[root@xiandian ~]# reboot
[root@xiandian ~]# vim /etc/sysctl.conf
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
[root@xiandian ~]# modprobe br_netfilter
[root@xiandian ~]# sysctl -p
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
[root@xiandian ~]# yum install -y yum-utils device-mapper-persistent-data
[root@xiandian ~]# yum install -y docker-ce-18.09.6 docker-ce-cli-18.09.6 containerd.io
[root@xiandian ~]# systemctl daemon-reload
[root@xiandian ~]# systemctl restart docker
[root@xiandian ~]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@xiandian ~]# docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 18.09.6
Storage Driver: devicemapper
 Pool Name: docker-253:0-100765090-pool
 Pool Blocksize: 65.54kB
 Base Device Size: 10.74GB
 Backing Filesystem: xfs
 Udev Sync Supported: true
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Data Space Used: 11.73MB
 Data Space Total: 107.4GB
 Data Space Available: 24.34GB
 Metadata Space Used: 17.36MB
 Metadata Space Total: 2.147GB
 Metadata Space Available: 2.13GB
 Thin Pool Minimum Free Space: 10.74GB
 Deferred Removal Enabled: true
 Deferred Deletion Enabled: true
 Deferred Deleted Device Count: 0
 Library Version: 1.02.164-RHEL7 (2019-08-27)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
init version: fec3683
Security Options:
 seccomp
  Profile: default
Kernel Version: 3.10.0-1127.8.2.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.777GiB
Name: xiandian
ID: OUR6:6ERV:3UCH:WJCM:TDLL:5ATV:E7IQ:HLAR:JKQB:OBK2:HZ7G:JC3Q
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
WARNING: the devicemapper storage-driver is deprecated, and will be removed in a future release.
WARNING: devicemapper: usage of loopback devices is strongly discouraged for production use.
         Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.

14.Docker Harbor安裝(40分)

使用提供的虛擬機與軟體包,部署Docker Harbor鏡像倉庫服務,安裝完畢后,將執行./install.sh --with-notary --with-clair命令回傳結果中的[step4]的內容以文本形式提交到答題框,
之前安裝docker-cd時解壓Docker.tar.gz時會產生有一個image.sh的腳本(是一個自動上傳鏡像到本地倉庫的腳本):

[root@zookeeper1 ~]# ./image.sh
[root@zookeeper1 ~]# mkdir  -p  /data/ssl
[root@zookeeper1 ~]# cd /data/ssl/
[root@zookeeper1 ssl]# which openssl
/usr/bin/openssl
[root@zookeeper1 ssl]# openssl  req  -newkey rsa:4096  -nodes  -sha256  -keyout ca.key  -x509  -days 2.235  -out  ca.crt
Generating a 4096 bit RSA private key
...................................................................................................................++
............................................................................................................................................++
writing new private key to 'ca.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:CN		# 國家
State or Province Name (full name) []:Guangxi	# 地區(州或省名)
Locality Name (eg, city) [Default City]:Liuzhou 	# 城市
Organization Name (eg, company) [Default Company Ltd]:lztd	# 公司名稱
Organizational Unit Name (eg, section) []:xxjsxy	# 單位名稱
Common Name (eg, your name or your server's hostname) []:	# 服務器主機名,域名
Email Address []:		# 郵箱地址

[root@zookeeper1 ssl]# openssl req -newkey rsa:4096 -nodes -sha256 -keyout www.yidaoyun.com.key  -out www.yidaoyun.com.csr
Generating a 4096 bit RSA private key
.........................................................++
......++
writing new private key to 'www.yidaoyun.com.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:CN		# 國家
State or Province Name (full name) []:LGuangxi	# 地區(州或省名)
Locality Name (eg, city) [Default City]:Liuzhou 	# 城市
Organization Name (eg, company) [Default Company Ltd]:lztd	# 公司名稱
Organizational Unit Name (eg, section) []:xxjsxy	# 單位名稱
Common Name (eg, your name or your server's hostname) []:www.yidaoyun.com	# 服務器主機名,域名
Email Address []:		# 郵箱地址

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
[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
Signature ok
subject=/C=CN/ST=Guangxi/L=Liuzhou/O=lztd/OU=xxjsxy/CN=www.yidaoyun.com
Getting CA Private Key
[root@zookeeper1 ssl]# cp -rvf www.yidaoyun.com.crt /etc/pki/ca-trust/source/anchors/
‘www.yidaoyun.com.crt’ -> ‘/etc/pki/ca-trust/source/anchors/www.yidaoyun.com.crt’
[root@zookeeper1 ssl]# update-ca-trust enable
[root@zookeeper1 ssl]# update-ca-trust extract
# 注釋:上傳docker-compose-Linux-x86_64.64并重命名docker-compose:
[root@zookeeper1 ~]# mv docker-compose-Linux-x86_64.64  /usr/local/bin/
[root@zookeeper1 ~]# mv /usr/local/bin/docker-compose-Linux-x86_64.64 /usr/local/bin/docker-compose
[root@zookeeper1 ~]# chmod +x /usr/local/bin/docker-compose
[root@zookeeper1 ~]# docker-compose --version
docker-compose version 1.26.0-rc4, build d279b7a8
[root@zookeeper1 opt]# tar  -zvxf  harbor-offline-installer-v1.5.3.tgz  -C  /opt/
[root@zookeeper1 opt]# ll
total 1097260
drwxr-xr-x. 8 root root       4096 May 14 08:03 centos
drwx--x--x  4 root root         26 May 19 23:16 containerd
-rw-r--r--. 1 root root 1123583789 May 15 04:26 Docker.tar.gz
drwxr-xr-x  4 root root       4096 May 20 03:55 harbor
[root@zookeeper1 opt]# cd harbor/
[root@zookeeper1 harbor]# ll
total 895708
drwxr-xr-x 3 root root        22 May 20 03:55 common
-rw-r--r-- 1 root root      1185 Sep 12  2018 docker-compose.clair.yml
-rw-r--r-- 1 root root      1725 Sep 12  2018 docker-compose.notary.yml
-rw-r--r-- 1 root root      3596 Sep 12  2018 docker-compose.yml
drwxr-xr-x 3 root root       150 Sep 12  2018 ha
-rw-r--r-- 1 root root      6956 Sep 12  2018 harbor.cfg
-rw-r--r-- 1 root root 915878468 Sep 12  2018 harbor.v1.5.3.tar.gz
-rwxr-xr-x 1 root root      5773 Sep 12  2018 install.sh
-rw-r--r-- 1 root root     10764 Sep 12  2018 LICENSE
-rw-r--r-- 1 root root       482 Sep 12  2018 NOTICE
-rw-r--r-- 1 root root   1247461 Sep 12  2018 open_source_license
-rwxr-xr-x 1 root root     27840 Sep 12  2018 prepare
[root@zookeeper1 harbor]# vim harbor.cfg
# 注釋:修改組態檔內容:
hostname = 192.168.1.111
ui_url_protocol = https
ssl_cert = /data/ssl/www.yidaoyun.com.crt
ssl_cert_key = /data/ssl/www.yidaoyun.com.key
harbor_admin_password = 000000
[root@zookeeper1 harbor]# ./prepare 
Generated and saved secret to file: /data/secretkey
Generated configuration file: ./common/config/nginx/nginx.conf
Generated configuration file: ./common/config/adminserver/env
Generated configuration file: ./common/config/ui/env
Generated configuration file: ./common/config/registry/config.yml
Generated configuration file: ./common/config/db/env
Generated configuration file: ./common/config/jobservice/env
Generated configuration file: ./common/config/jobservice/config.yml
Generated configuration file: ./common/config/log/logrotate.conf
Generated configuration file: ./common/config/jobservice/config.yml
Generated configuration file: ./common/config/ui/app.conf
Generated certificate, key file: ./common/config/ui/private_key.pem, cert file: ./common/config/registry/root.crt
The configuration files are ready, please use docker-compose to start the service.
[root@zookeeper1 harbor]# ./install.sh --with-notary --with-clair
[Step 0]: checking installation environment ...
Note: docker version: 18.09.6
Note: docker-compose version: 1.26.0

[Step 1]: loading Harbor images ...
dba693fc2701: Loading layer  133.4MB/133.4MB
5773887c4c41: Loading layer  30.09MB/30.09MB
6fc2abbcae42: Loading layer  15.37MB/15.37MB
d85f176a11ec: Loading layer  15.37MB/15.37MB
Loaded image: vmware/harbor-adminserver:v1.5.3
462b14c85230: Loading layer  410.1MB/410.1MB
c2e0c8cb2903: Loading layer  9.216kB/9.216kB
11bdb24cded2: Loading layer  9.216kB/9.216kB
5d8f974b49ef: Loading layer   7.68kB/7.68kB
ee04f13f4147: Loading layer  1.536kB/1.536kB
799db4dfe41a: Loading layer  11.78kB/11.78kB
f7d813585bdd: Loading layer   2.56kB/2.56kB
6300bbdbd7ab: Loading layer  3.072kB/3.072kB
Loaded image: vmware/harbor-db:v1.5.3
1d7516778a05: Loading layer  30.09MB/30.09MB
f7ec8d1b47d0: Loading layer  20.91MB/20.91MB
22b0ad749c21: Loading layer  20.91MB/20.91MB
Loaded image: vmware/harbor-jobservice:v1.5.3
2d449d67c05a: Loading layer  89.58MB/89.58MB
0bfd4e706575: Loading layer  3.072kB/3.072kB
6100e173c230: Loading layer   59.9kB/59.9kB
86fe093d1358: Loading layer  61.95kB/61.95kB
Loaded image: vmware/redis-photon:v1.5.3
Loaded image: photon:1.0
3bf3086a6569: Loading layer  30.09MB/30.09MB
641d0f77d675: Loading layer  10.95MB/10.95MB
89efbaabea87: Loading layer   17.3MB/17.3MB
1276e51f4dc2: Loading layer  15.87kB/15.87kB
49e187d04e78: Loading layer  3.072kB/3.072kB
e62fbfea411d: Loading layer  28.24MB/28.24MB
Loaded image: vmware/notary-signer-photon:v0.5.1-v1.5.3
Loaded image: vmware/mariadb-photon:v1.5.3
201f6ade61d8: Loading layer  102.5MB/102.5MB
81221fbb5879: Loading layer  6.656kB/6.656kB
2268e3c9e521: Loading layer  2.048kB/2.048kB
9fca06f4b193: Loading layer   7.68kB/7.68kB
Loaded image: vmware/postgresql-photon:v1.5.3
11d6e8a232c9: Loading layer  30.09MB/30.09MB
42650b04d53d: Loading layer  24.41MB/24.41MB
a1cd8af19e29: Loading layer  7.168kB/7.168kB
4b1cda90ba19: Loading layer  10.56MB/10.56MB
1351f0f3006a: Loading layer   24.4MB/24.4MB
Loaded image: vmware/harbor-ui:v1.5.3
e335f4c3af7d: Loading layer  79.93MB/79.93MB
2aea487bc2c4: Loading layer  3.584kB/3.584kB
d2efec3de68b: Loading layer  3.072kB/3.072kB
d0d71a5ce1dd: Loading layer  4.096kB/4.096kB
19930367abf0: Loading layer  3.584kB/3.584kB
03e5b7640db5: Loading layer  9.728kB/9.728kB
Loaded image: vmware/harbor-log:v1.5.3
5aebe8cc938c: Loading layer  11.97MB/11.97MB
Loaded image: vmware/nginx-photon:v1.5.3
ede6a57cbd7e: Loading layer  30.09MB/30.09MB
4d6dd4fc1d87: Loading layer   2.56kB/2.56kB
c86a69f49f60: Loading layer   2.56kB/2.56kB
0cf6e04c5927: Loading layer  2.048kB/2.048kB
6fbff4fe9739: Loading layer   22.8MB/22.8MB
6f527a618092: Loading layer   22.8MB/22.8MB
Loaded image: vmware/registry-photon:v2.6.2-v1.5.3
e29a8834501b: Loading layer  12.16MB/12.16MB
aaf67f1da2c7: Loading layer   17.3MB/17.3MB
8d5718232133: Loading layer  15.87kB/15.87kB
fc89aca1dd12: Loading layer  3.072kB/3.072kB
076eb5a76f6d: Loading layer  29.46MB/29.46MB
Loaded image: vmware/notary-server-photon:v0.5.1-v1.5.3
454c81edbd3b: Loading layer  135.2MB/135.2MB
e99db1275091: Loading layer  395.4MB/395.4MB
051e4ee23882: Loading layer  9.216kB/9.216kB
6cca4437b6f6: Loading layer  9.216kB/9.216kB
1d48fc08c8bc: Loading layer   7.68kB/7.68kB
0419724fd942: Loading layer  1.536kB/1.536kB
543c0c1ee18d: Loading layer  655.2MB/655.2MB
4190aa7e89b8: Loading layer  103.9kB/103.9kB
Loaded image: vmware/harbor-migrator:v1.5.0
45878c64fc3c: Loading layer  165.3MB/165.3MB
fc3d407ce98f: Loading layer  10.93MB/10.93MB
d7a0785bb902: Loading layer  2.048kB/2.048kB
a17e0f23bc84: Loading layer  48.13kB/48.13kB
57c7181f2336: Loading layer  10.97MB/10.97MB
Loaded image: vmware/clair-photon:v2.0.5-v1.5.3

[Step 2]: preparing environment ...
Clearing the configuration file: ./common/config/adminserver/env
Clearing the configuration file: ./common/config/ui/env
Clearing the configuration file: ./common/config/ui/app.conf
Clearing the configuration file: ./common/config/ui/private_key.pem
Clearing the configuration file: ./common/config/db/env
Clearing the configuration file: ./common/config/jobservice/env
Clearing the configuration file: ./common/config/jobservice/config.yml
Clearing the configuration file: ./common/config/registry/config.yml
Clearing the configuration file: ./common/config/registry/root.crt
Clearing the configuration file: ./common/config/nginx/cert/www.yidaoyun.com.crt
Clearing the configuration file: ./common/config/nginx/cert/www.yidaoyun.com.key
Clearing the configuration file: ./common/config/nginx/nginx.conf
Clearing the configuration file: ./common/config/log/logrotate.conf
loaded secret from file: /data/secretkey
Generated configuration file: ./common/config/nginx/nginx.conf
Generated configuration file: ./common/config/adminserver/env
Generated configuration file: ./common/config/ui/env
Generated configuration file: ./common/config/registry/config.yml
Generated configuration file: ./common/config/db/env
Generated configuration file: ./common/config/jobservice/env
Generated configuration file: ./common/config/jobservice/config.yml
Generated configuration file: ./common/config/log/logrotate.conf
Generated configuration file: ./common/config/jobservice/config.yml
Generated configuration file: ./common/config/ui/app.conf
Generated certificate, key file: ./common/config/ui/private_key.pem, cert file: ./common/config/registry/root.crt
Copying sql file for notary DB
Generated certificate, key file: ./cert_tmp/notary-signer-ca.key, cert file: ./cert_tmp/notary-signer-ca.crt
Generated certificate, key file: ./cert_tmp/notary-signer.key, cert file: ./cert_tmp/notary-signer.crt
Copying certs for notary signer
Copying notary signer configuration file
Generated configuration file: ./common/config/notary/server-config.json
Copying nginx configuration file for notary
Generated configuration file: ./common/config/nginx/conf.d/notary.server.conf
Generated and saved secret to file: /data/defaultalias
Generated configuration file: ./common/config/notary/signer_env
Generated configuration file: ./common/config/clair/postgres_env
Generated configuration file: ./common/config/clair/config.yaml
Generated configuration file: ./common/config/clair/clair_env
The configuration files are ready, please use docker-compose to start the service.

[Step 3]: checking existing instance of Harbor ...

[Step 4]: starting Harbor ...
Creating network "harbor_harbor" with the default driver
Creating network "harbor_harbor-clair" with the default driver
Creating network "harbor_harbor-notary" with the default driver
Creating network "harbor_notary-mdb" with the default driver
Creating network "harbor_notary-sig" with the default driver
Creating harbor-log ... done
Creating redis              ... done
Creating clair-db           ... done
Creating notary-db          ... done
Creating harbor-db          ... done
Creating registry           ... done
Creating harbor-adminserver ... done
Creating notary-signer      ... done
Creating clair              ... done
Creating harbor-ui          ... done
Creating notary-server      ... done
Creating nginx              ... done
Creating harbor-jobservice  ... done
? ----Harbor has been installed and started successfully.----
Now you should be able to visit the admin portal at https://192.168.1.111. 
For more details, please visit https://github.com/vmware/harbor .

15.Shell腳本補全(40分)

下面有一段腳本,作用是自動配置nginx服務,由于工程師的失誤,將腳本中的某些代碼洗掉了,但注釋還在,請根據注釋,填寫代碼,最后將填寫的代碼按照順序以文本形式提交至答題框, nginx(){ cd #洗掉默認專案路徑下的檔案 rm -rf /usr/share/nginx/html/* #將提供的dist靜態檔案復制到nginx專案目錄 cp -rvf /root/dist/* /usr/share/nginx/html #修改nginx組態檔如下 cat > /etc/nginx/conf.d/default.conf << EOF server { listen 80; server_name localhost; #charset koi8-r; #access_log /var/log/nginx/host.access.log main; location / { root /usr/share/nginx/html; index index.html index.htm; } location /user { (此處需要填寫) } location /shopping { proxy_pass http://127.0.0.1:8081; } location /cashier { proxy_pass http://127.0.0.1:8083; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } } EOF #啟動nginx服務 systemctl start nginx #設定nginx開機自啟 (此處需填寫) #檢查nginx服務是否成功啟動 if [ $? -eq 0 ] then sleep 3 echo -e "\033[36m==========nginx啟動成功==========\033[0m" else echo -e "\033[31mnginx啟動失敗,請檢查\033[0m" exit 1 fi sleep 2 }

proxy_pass http://127.0.0.1:8082;
systemctl enable nginx

?著作權宣告

著作權歸作者所有:如需轉載,請注明出處,謝謝,

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/235999.html

標籤:其他

上一篇:【SunRTC】一款為保險應用場景量身打造的實時音視頻產品

下一篇:基于Ubuntu在Hadoop的環境下呼叫MapReduce對檔案中各個單詞出現次數進行統計

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • 網閘典型架構簡述

    網閘架構一般分為兩種:三主機的三系統架構網閘和雙主機的2+1架構網閘。 三主機架構分別為內端機、外端機和仲裁機。三機無論從軟體和硬體上均各自獨立。首先從硬體上來看,三機都用各自獨立的主板、記憶體及存盤設備。從軟體上來看,三機有各自獨立的作業系統。這樣能達到完全的三機獨立。對于“2+1”系統,“2”分為 ......

    uj5u.com 2020-09-10 02:00:44 more
  • 如何從xshell上傳檔案到centos linux虛擬機里

    如何從xshell上傳檔案到centos linux虛擬機里及:虛擬機CentOs下執行 yum -y install lrzsz命令,出現錯誤:鏡像無法找到軟體包 前言 一、安裝lrzsz步驟 二、上傳檔案 三、遇到的問題及解決方案 總結 前言 提示:其實很簡單,往虛擬機上安裝一個上傳檔案的工具 ......

    uj5u.com 2020-09-10 02:00:47 more
  • 一、SQLMAP入門

    一、SQLMAP入門 1、判斷是否存在注入 sqlmap.py -u 網址/id=1 id=1不可缺少。當注入點后面的引數大于兩個時。需要加雙引號, sqlmap.py -u "網址/id=1&uid=1" 2、判斷文本中的請求是否存在注入 從文本中加載http請求,SQLMAP可以從一個文本檔案中 ......

    uj5u.com 2020-09-10 02:00:50 more
  • Metasploit 簡單使用教程

    metasploit 簡單使用教程 浩先生, 2020-08-28 16:18:25 分類專欄: kail 網路安全 linux 文章標簽: linux資訊安全 編輯 著作權 metasploit 使用教程 前言 一、Metasploit是什么? 二、準備作業 三、具體步驟 前言 Msfconsole ......

    uj5u.com 2020-09-10 02:00:53 more
  • 游戲逆向之驅動層與用戶層通訊

    驅動層代碼: #pragma once #include <ntifs.h> #define add_code CTL_CODE(FILE_DEVICE_UNKNOWN,0x800,METHOD_BUFFERED,FILE_ANY_ACCESS) /* 更多游戲逆向視頻www.yxfzedu.com ......

    uj5u.com 2020-09-10 02:00:56 more
  • 北斗電力時鐘(北斗授時服務器)讓網路資料更精準

    北斗電力時鐘(北斗授時服務器)讓網路資料更精準 北斗電力時鐘(北斗授時服務器)讓網路資料更精準 京準電子科技官微——ahjzsz 近幾年,資訊技術的得了快速發展,互聯網在逐漸普及,其在人們生活和生產中都得到了廣泛應用,并且取得了不錯的應用效果。計算機網路資訊在電力系統中的應用,一方面使電力系統的運行 ......

    uj5u.com 2020-09-10 02:01:03 more
  • 【CTF】CTFHub 技能樹 彩蛋 writeup

    ?碎碎念 CTFHub:https://www.ctfhub.com/ 筆者入門CTF時時剛開始刷的是bugku的舊平臺,后來才有了CTFHub。 感覺不論是網頁UI設計,還是題目質量,賽事跟蹤,工具軟體都做得很不錯。 而且因為獨到的金幣制度的確讓人有一種想去刷題賺金幣的感覺。 個人還是非常喜歡這個 ......

    uj5u.com 2020-09-10 02:04:05 more
  • 02windows基礎操作

    我學到了一下幾點 Windows系統目錄結構與滲透的作用 常見Windows的服務詳解 Windows埠詳解 常用的Windows注冊表詳解 hacker DOS命令詳解(net user / type /md /rd/ dir /cd /net use copy、批處理 等) 利用dos命令制作 ......

    uj5u.com 2020-09-10 02:04:18 more
  • 03.Linux基礎操作

    我學到了以下幾點 01Linux系統介紹02系統安裝,密碼啊破解03Linux常用命令04LAMP 01LINUX windows: win03 8 12 16 19 配置不繁瑣 Linux:redhat,centos(紅帽社區版),Ubuntu server,suse unix:金融機構,證券,銀 ......

    uj5u.com 2020-09-10 02:04:30 more
  • 05HTML

    01HTML介紹 02頭部標簽講解03基礎標簽講解04表單標簽講解 HTML前段語言 js1.了解代碼2.根據代碼 懂得挖掘漏洞 (POST注入/XSS漏洞上傳)3.黑帽seo 白帽seo 客戶網站被黑帽植入劫持代碼如何處理4.熟悉html表單 <html><head><title>TDK標題,描述 ......

    uj5u.com 2020-09-10 02:04:36 more
最新发布
  • 2023年最新微信小程式抓包教程

    01 開門見山 隔一個月發一篇文章,不過分。 首先回顧一下《微信系結手機號資料庫被脫庫事件》,我也是第一時間得知了這個訊息,然后跟蹤了整件事情的經過。下面是這起事件的相關截圖以及近日流出的一萬條資料樣本: 個人認為這件事也沒什么,還不如關注一下之前45億快遞資料查詢渠道疑似在近日復活的訊息。 訊息是 ......

    uj5u.com 2023-04-20 08:48:24 more
  • web3 產品介紹:metamask 錢包 使用最多的瀏覽器插件錢包

    Metamask錢包是一種基于區塊鏈技術的數字貨幣錢包,它允許用戶在安全、便捷的環境下管理自己的加密資產。Metamask錢包是以太坊生態系統中最流行的錢包之一,它具有易于使用、安全性高和功能強大等優點。 本文將詳細介紹Metamask錢包的功能和使用方法。 一、 Metamask錢包的功能 數字資 ......

    uj5u.com 2023-04-20 08:47:46 more
  • vulnhub_Earth

    前言 靶機地址->>>vulnhub_Earth 攻擊機ip:192.168.20.121 靶機ip:192.168.20.122 參考文章 https://www.cnblogs.com/Jing-X/archive/2022/04/03/16097695.html https://www.cnb ......

    uj5u.com 2023-04-20 07:46:20 more
  • 從4k到42k,軟體測驗工程師的漲薪史,給我看哭了

    清明節一過,盲猜大家已經無心上班,在數著日子準備過五一,但一想到銀行卡里的余額……瞬間心情就不美麗了。最近,2023年高校畢業生就業調查顯示,本科畢業月平均起薪為5825元。調查一出,便有很多同學表示自己又被平均了。看著這一資料,不免讓人想到前不久中國青年報的一項調查:近六成大學生認為畢業10年內會 ......

    uj5u.com 2023-04-20 07:44:00 more
  • 最新版本 Stable Diffusion 開源 AI 繪畫工具之中文自動提詞篇

    🎈 標簽生成器 由于輸入正向提示詞 prompt 和反向提示詞 negative prompt 都是使用英文,所以對學習母語的我們非常不友好 使用網址:https://tinygeeker.github.io/p/ai-prompt-generator 這個網址是為了讓大家在使用 AI 繪畫的時候 ......

    uj5u.com 2023-04-20 07:43:36 more
  • 漫談前端自動化測驗演進之路及測驗工具分析

    隨著前端技術的不斷發展和應用程式的日益復雜,前端自動化測驗也在不斷演進。隨著 Web 應用程式變得越來越復雜,自動化測驗的需求也越來越高。如今,自動化測驗已經成為 Web 應用程式開發程序中不可或缺的一部分,它們可以幫助開發人員更快地發現和修復錯誤,提高應用程式的性能和可靠性。 ......

    uj5u.com 2023-04-20 07:43:16 more
  • CANN開發實踐:4個DVPP記憶體問題的典型案例解讀

    摘要:由于DVPP媒體資料處理功能對存放輸入、輸出資料的記憶體有更高的要求(例如,記憶體首地址128位元組對齊),因此需呼叫專用的記憶體申請介面,那么本期就分享幾個關于DVPP記憶體問題的典型案例,并給出原因分析及解決方法。 本文分享自華為云社區《FAQ_DVPP記憶體問題案例》,作者:昇騰CANN。 DVPP ......

    uj5u.com 2023-04-20 07:43:03 more
  • msf學習

    msf學習 以kali自帶的msf為例 一、msf核心模塊與功能 msf模塊都放在/usr/share/metasploit-framework/modules目錄下 1、auxiliary 輔助模塊,輔助滲透(埠掃描、登錄密碼爆破、漏洞驗證等) 2、encoders 編碼器模塊,主要包含各種編碼 ......

    uj5u.com 2023-04-20 07:42:59 more
  • Halcon軟體安裝與界面簡介

    1. 下載Halcon17版本到到本地 2. 雙擊安裝包后 3. 步驟如下 1.2 Halcon軟體安裝 界面分為四大塊 1. Halcon的五個助手 1) 影像采集助手:與相機連接,設定相機引數,采集影像 2) 標定助手:九點標定或是其它的標定,生成標定檔案及內參外參,可以將像素單位轉換為長度單位 ......

    uj5u.com 2023-04-20 07:42:17 more
  • 在MacOS下使用Unity3D開發游戲

    第一次發博客,先發一下我的游戲開發環境吧。 去年2月份買了一臺MacBookPro2021 M1pro(以下簡稱mbp),這一年來一直在用mbp開發游戲。我大致分享一下我的開發工具以及使用體驗。 1、Unity 官網鏈接: https://unity.cn/releases 我一般使用的Apple ......

    uj5u.com 2023-04-20 07:40:19 more