背景説明
大家好,我是凌虛。
我於 2024 年 3 月 14 日參加了 Elastic Certified Engineer(ECE)認證考試,並與 18 日收到了考試通過的郵件。本文將會回顧我的考試過程、考試真題、個人感受。
ECE 認證
一手資料請一定要閲讀官方考試説明文檔。
- 目前考試使用的是 Elasticsearch v8.1 版本。
- 考試費用 500 美元(漲價過了),需要用支持美元支付的信用卡購買,可以用別人的卡代付。
- 只有一次考試機會,沒有補考,沒有官方模擬考和模擬題。
- 考試內容是 10 個題目,都是實操題,可以使用 Kibana。
考試大綱
-
Data Management(數據管理)Define an index that satisfies a given set of requirements(按要求定義 index)Define and use an index template for a given pattern that satisfies a given set of requirements(按要求定義和使用index template)Define and use a dynamic template that satisfies a given set of requirements(按要求定義和使用dynamic template)Define an Index Lifecycle Management policy for a time-series index(為時序索引定義ILM策略)Define an index template that creates a new data stream(定義一個 index template 讓其創建一個新的data stream)
-
Searching Data(搜索數據)Write and execute a search query for terms and/or phrases in one or more fields of an index(為索引的一個或多個字段中的 terms 和/或 phrases 編寫並執行搜索 query)Write and execute a search query that is a Boolean combination of multiple queries and filters(編寫並執行一個由多個 query 和 filter 進行 bool 組合而成的查詢)Write an asynchronous search(編寫異步搜索)Write and execute metric and bucket aggregations(編寫並執行 metric 和 bucket 聚合)Write and execute aggregations that contain sub-aggregations(編寫並執行包含子聚合的聚合)Write and execute a query that searches across multiple clusters(編寫並執行跨集羣搜索的查詢)Write and execute a search that utilizes a runtime field(編寫並執行利用運行時字段的搜索)
-
Developing Search Applications(開發搜索應用)Highlight the search terms in the response of a query(高亮查詢響應中的搜索詞)Sort the results of a query by a given set of requirements(按要求對搜索結果進行排序)Implement pagination of the results of a search query(實現搜索結果的分頁)Define and use index aliases(定義和使用索引別名)Define and use a search template(定義和使用搜索模板)
-
Data Processing(數據處理)Define a mapping that satisfies a given set of requirements(按要求定義 mapping)Define and use a custom analyzer that satisfies a given set of requirements(按要求定義和使用 custom analyzer)Define and use multi-fields with different data types and/or analyzers(定義和使用具有不同數據類型和/或 analyzer 的多字段)Use the Reindex API and Update By Query API to reindex and/or update documents(使用 Reindex API 和 Update By Query API 重建索引和/或更新文檔)Define and use an ingest pipeline that satisfies a given set of requirements, including the use of Painless to modify documents(按要求定義和使用 ingest pipeline,包括使用 Painless 修改文檔)Define runtime fields to retries custom values using Painless scripting(使用 Painless 腳本定義運行時字段以檢索自定義值)
-
Cluster Management(集羣管理)Diagnose shard issues and repair a cluster's health(診斷分片問題並修復集羣健康)Backup and restore a cluster and/or specific indices(備份和恢復集羣和/或特定索引)Configure a snapshot to be searchable(將快照配置為可搜索)Configure a cluster for cross-cluster search(配置集羣以進行跨集羣搜索)Implement cross-cluster replication(實現跨集羣複製)
考試內容完完全全就是按照考試大綱裏的考點來的,但是每個題目都會涉及到多個考點。
考試真題
以下是我這次考試的題目。
1. data stream + index template + ilm
按要求創建一個 ilm policy ,數據索引後 5 分鐘內在 hot 節點,之後翻滾至 warm 節點,3分鐘後轉換到 cold 節點,翻滾之後 6 分鐘刪除。
然後創建一個 data stream 的 index template :
- 按要求設置 index_patterns
- 關聯上面的 ilm policy (我第一遍複製粘貼官方文檔的代碼然後忘了改 settings 裏的 index.lifecycle.name )
- 由於題目要求數據要先到 hot 節點上,所以按照我的理解 settings 中還應該加 "index.routing.allocation.include._tier_preference": "data_hot"
最後複製粘貼題目給的請求寫入一個文檔,從而把這個 data stream 創建出來。
2. reindex + custom analyzer
給了某個 index 和搜索請求,用 the 去搜索 title 字段的時候會匹配很多文檔,要求 reindex 為另外的 index(一般名稱都是要求你使用 task2 這種跟題目編號一致的命名方式),然後在新的索引上用 the 搜索不到任務文檔。需要注意的是他明確要求你保留原索引的數據結構和類型(也就是要先查原索引的 mappings 並複製粘貼過來),然後在 mappings 中的 title 字段中定義 analyzer 去處理這個 the(這道題 tokenizer 用 standard ,character filter 用 stop 就可以了)。
3. upadte_by_query + ingest pipeline
要求給某個索引增加一個新的字段,新字段是已有四個字段的值拼接而成,注意拼接的時候字段之間加空格(題目給的正確文檔示例是有加空格的)。
看到 update 這種操作建議先 reindex 一下原索引然後測試一下,免得原索引改錯了找不回來。
4. runtime field + aggregations
定義一個 runtime field ,值是已有兩個字段的值相減,然後在這個 field 上面做 range aggregation 。
5. multi-match
要求搜索三個字段,其中一個字段權重乘2,最終得分為每個字段得分相加(也就是設置 type 為 most_fields)。
6. cross-cluster search 跨集羣搜索
題目明確告訴你不需要配置 remote cluster,環境已經配好了,只要寫一個跨集羣的 query 就行了,query 的內容也很簡單,裏面會有一個 sort 排序。
7. aggregations
結果填空,不是填搜索請求。
要求找出來平均飛行里程最大的 airline 航班。
其實就是先按照 airline 航班做一遍 terms 分桶(bucket aggregation),然後在每個 bucket 裏再用 avg(metrics aggregation)做一個子聚合求值,最後用 pipeline aggregation 裏的 max bucket 取出來 avg 最大的這個 bucket。最後的答案是 AS 。
8. snapshot
要求先註冊一個 shared file system repository 類型的 repository(用 Kibana 操作就行了),然後創建一個 snapshot (要求只包含特定的某個 index),去 rest API 文檔下面看一下 snapshot API 就行了。
9. search template + highlight + sort
自己創建一個 search template(只需要單個 params 參數),要求查詢裏有 highlight 和 sort ,查詢條件很簡單,最後要求在 movie_data 這個索引上使用這個 search template 進行查詢。題目只要求粘貼最後使用 search template 進行實際查詢的請求(但是 search template 需要你先創建好)。
10. async search + aggregations
寫一個異步搜索,針對航班數據索引進行聚合,填完整的請求。內容是查詢每週的某個 metrics 指標(具體是啥我忘了,反正就是先做 date_histogram 然後再做 metrics),題目有另外要求 size 為 0 。
最後,你會發現我考試的這十道題除了集羣管理裏有幾個考點沒考,其餘大綱裏所有考點基本都覆蓋到了。
我踩的坑
- 考前 15 分鐘之內才能開始考試,太早了沒用(我考 CKA 的時候提前半個小時就進了,但是 ECE 不行)。
- 一定要用大屏考試,不然考試體驗會很痛苦(這是我之前考 CKA 的體會)。
- 我是筆記本電腦外接了顯示器和攝像頭,但是外接的攝像頭看不清護照上的名字(考試結束後問了賣家才知道買的攝像頭是定焦的,大家一定要買變焦的),然後我跟當時的印度監考官折騰了好久,她中間也是離開了一會兒,估計是諮詢同事這種情況要怎麼辦,後來她讓我把手機拿過來拍個照再放大了給攝像頭看(其實還是有點不清晰,但是監考官沒找我茬,讓我繼續考試了)。
- 複製鍵鍵位衝突。MacBook 都是 option+c,考試環境説是 ctrl + c ,但是我用 ctrl + c 在考試環境裏卻是喚起瀏覽器的調試欄,最後沒辦法只能用鼠標右擊複製,這點會影響答題速度但不致命。
- 考試環境並不是很流暢,有時候會卡一下,這個其實影響也沒有很大,保持一個好心態。我最後整個考試只花費了一個小時二十分鐘,官方給的三個小時的考試時間是綽綽有餘的。
個人感受
我最開始在備考的時候想的很簡單,找幾套真題做做就行了,但是後來發現行不通。一方面,考試涉及到的部分內容是 7.x 版本新增的特性,而我由於換公司的原因這幾年基本沒玩 ES 了,且我之前玩的 ES 還是 6.x 版本,也就是説其實我需要重新學一遍。另一方面,網上基本找不到 8.1 的考試真題,考試相關的資源被幾個大佬搞成了付費增值服務的一部分,説到底還是 ES 的圈子太小了,沒啥辦法。
最後,考試難不難?一點都不難,做題的整個流程基本就是:1、理解題目內容,提煉考點;2、找到考點對應的官方文檔,複製粘貼文檔裏的代碼;3、按題目要求修改代碼最後提交(某些步驟可以直接用 Kibana 可視化操作,代碼都不用敲)。只要你理解了每個考點,能快速找到每個考點的文檔位置,你一定能過。
總結
這種實操類的 IT 考試其實都不難,就是考察的基本功,像我這種幾年不玩 ES 的複習兩週也能過,大家不要害怕,對自己要有信心。