Aws Elasticsearch 筆記 – 1 – AWS Elasticsearch 管理面板及其意義研讀

摘要

研讀 AWS Elasticsearch (現在改叫 OpenSearch 了) 管理介面中的 Monitor 面板,包含各項指標與意義,筆記於此分享出來。

Moniter 面板如下圖,在 AWS Elasticsearch 管理介面中。


Moniter 參考圖,此圖為 Blog New – Amazon Elasticsearch Service 所有,這邊只是借用示意,因為我暫時沒辦法自己開一個來 demo。

以下 Panel 順序按照 AWS 的 Panel 順序。

Overall Health


1. ClusterStatus (green/yellow/red)

參考 AWS 文件

筆記與討論

黃色叢集狀態表示已將所有索引的主要碎片分配給叢集中的節點,但至少有一個索引的複本碎片未獲分配。單一節點叢集在初始化時一定會呈現黃色叢集狀態。

1.1 red/yellow/green 顏色

顏色代表 shard 及其 replication 的分布健康狀況

  • red: 連最基本的 “主要shard” 都沒分好,代表資料有掉
  • yellow: “主要shard” 分好了,但其 replication 沒有分好
  • green: shard OK, 主要shard及其 replication 都好了

1.2 shard 知識參考

1.3 為何需要三個 Node

參考 AWS 文件

相關原文
  1. One dedicated master node means that you have no backup in the event of a failure.
  2. Two dedicated master nodes means that your cluster does not have the necessary quorum of nodes to elect a new master node in the event of a failure.
筆記與討論
  1. 一個,則連 replication 都無法做,故障時毫無辦法
  2. 兩個(或者說偶數個),則在發生問題要推舉出新的 master node 時,投票權重無法確保一定可以推舉出新 master 。

2. Cluster writes status (ClusterIndexWritesBlocked)

參考 AWS 文件 (如果頁面上沒有指標名稱,應該是 AWS 文件又換超連結了,請試著從左邊選單找到 叢集指標(Cluster Metric) 相關章節)

相關原文

  • 指示您的叢集是否要接受或封鎖外來的寫入請求。0 值表示叢集接受請求。1 值表示叢集封鎖請求。
  • 許多因素會導致叢集開始封鎖請求。一些常見因素包括: FreeStorageSpace 太低 JVMMemoryPressure 太高,或 CPUUtilization 太高。

3. MasterReachableFromNode

參考 AWS 資料 (如果頁面上沒有指標名稱,應該是 AWS 文件又換超連結了,請試著從左邊選單找到 叢集指標(Cluster Metric) 相關章節)

相關原文

  • 1 值表示行為正常。
  • 0 值表示 /_cluster/health/ 失敗。

失敗意味著主節點已停止或無法存取。這通常是網路連線問題或 AWS 依存性問題造成的結果。

4. Snapshot failure status (AutomatedSnapshotFailure)

參考 AWS 文件 (如果頁面上沒有指標名稱,應該是 AWS 文件又換超連結了,請試著從左邊選單找到 叢集指標(Cluster Metric) 相關章節)

相關原文

Failures indicate that no automated snapshot has succeeded in the past 36 hours.

5. Total nodes (Nodes)

參考 AWS 文件 (如果頁面上沒有指標名稱,應該是 AWS 文件又換超連結了,請試著從左邊選單找到 叢集指標(Cluster Metric) 相關章節)

筆記與討論

嗯… 就是節點數,這應該不用多廢話吧?

6. Total free storage space (FreeStorageSpace)

參考 AWS 文件 (如果頁面上沒有指標名稱,應該是 AWS 文件又換超連結了,請試著從左邊選單找到 叢集指標(Cluster Metric) 相關章節)

筆記與討論

  • data node 剩餘空間
  • Panel 的預設選項是 Sum – 所有節點總和

7. Kibana health status (KibanaHealthyNodes)

參考文件 (如果頁面上沒有指標名稱,應該是 AWS 文件又換超連結了,請試著從左邊選單找到 叢集指標(Cluster Metric) 相關章節)

筆記與討論

就… Kibana 的健康狀況。

8. Deleted documents (DeletedDocuments)

參考 AWS 文件 (如果頁面上沒有指標名稱,應該是 AWS 文件又換超連結了,請試著從左邊選單找到 叢集指標(Cluster Metric) 相關章節)

相關原文

The total number of documents marked for deletion across all data nodes in the cluster.

這些文件不再出現於搜尋結果中,但 Elasticsearch 在區段合併時只會從磁碟移除已刪除的文件。

此指標會在刪除請求後增加,在區段合併後降低。

筆記與討論

標記刪除的文件總數 (跨所有資料節點)

其他參考文件

9. Searchable documents (SearchableDocuments)

參考 AWS 文件 (如果頁面上沒有指標名稱,應該是 AWS 文件又換超連結了,請試著從左邊選單找到 叢集指標(Cluster Metric) 相關章節)

相關原文

The total number of searchable documents across all data nodes in the cluster.

可搜尋的 documents 總數 (叢集中跨所有資料節點)

第二部分 Key performance indicators


10. Indexing rate (IndexingRate)

參考 AWS 文件 (如果頁面上沒有指標名稱,應該是 AWS 文件又換超連結了,請試著從左邊選單找到 叢集指標(Cluster Metric) 相關章節)

相關原文

The number of indexing operations per minute.

每分鐘進行的索引操作次數。

11. Search rate (SearchRate)

參考 AWS 文件 (如果頁面上沒有指標名稱,應該是 AWS 文件又換超連結了,請試著從左邊選單找到 叢集指標(Cluster Metric) 相關章節)

相關原文

The total number of search requests per minute for all shards on a data node.

資料節點上, 每分鐘 對所有『shards』發出『搜尋請求』的總次數。

筆記與討論

以 shards 為單位,因此對 N 的 shards 發出呼叫,就會得到 N 的數值,即使這些 shards 都在同一個 Node 上

12. Indexing latency (IndexingLatency)

參考 AWS 文件 (如果頁面上沒有指標名稱,應該是 AWS 文件又換超連結了,請試著從左邊選單找到 叢集指標(Cluster Metric) 相關章節)

相關原文

The average time, in milliseconds, that it takes a shard to complete an indexing operation.

一個碎片,完成一次索引編製操作 ,所需的平均時間 (單位為毫秒)。

筆記與討論

平均每個 shard 完成一次索引編制的時間 (milliseconds)

13. Search latency (SearchLatency)

參考 AWS 文件 (如果頁面上沒有指標名稱,應該是 AWS 文件又換超連結了,請試著從左邊選單找到 叢集指標(Cluster Metric) 相關章節)

相關原文

The average time, in milliseconds, that it takes a shard on a data node to complete a search operation.

資料節點上,一個碎片,完成一次搜尋操作,所需的平均時間 (單位為毫秒)。

筆記與討論

平均每個 shard 完成一次搜尋的時間 (milliseconds)

14. HTTP requests by response code (2xx, 3xx, 4xx, 5xx)

參考 AWS 文件 (如果頁面上沒有指標名稱,應該是 AWS 文件又換超連結了,請試著從左邊選單找到 叢集指標(Cluster Metric) 相關章節)

相關原文

The number of requests to the domain that resulted in the given HTTP response code (2xx, 3xx, 4xx,
5xx).

筆記與討論

request 數量 (to domain),不同顏色是以其 response 的 http status code 來分

15. Invalid host header requests (InvalidHostHeaderRequests)

參考 AWS 文件 (如果頁面上沒有指標名稱,應該是 AWS 文件又換超連結了,請試著從左邊選單找到 叢集指標(Cluster Metric) 相關章節)

相關原文

InvalidHostHeaderRequests

The number of HTTP requests made to the Elasticsearch cluster that included an invalid (or missing) host header.

ElasticsearchRequests

The number of requests made to the Elasticsearch cluster.

筆記與討論

對 cluster 發的 request 總數,以及其中包含無效 header 的數量

15.1 延伸討論 – ElasticsearchRequests 圖形跟 HTTP requests by response code (2xx, 3xx, 4xx, 5xx) 乍看之下不符的討論

依照直觀、字面意義,他們不是應該要大致相同嗎?可是看起來有點不太像?

依據觀察統計數據,作出如下推斷:

  1. 一個是對 domain, 一個是對 cluster
  2. 細看兩者,應該是圖形的統計基準有差異
    1. 兩者都調整為 SUM、五分鐘間隔、過去3或者6小時,此時圖形趨勢相同,但時間上差了大約 5 分鐘。(也就是有相位差XD)
    2. 或,可以直接從 Cloud Watch 看 Elasticsearch Requests Sum 圖,也可以用來比對。
  3. 推測不必看 1 分鐘間隔的數據,很可能低於儲存的 sampling rate, 至少免費版本這邊給出來的 sampling rate 有可能是五分鐘

Data Nodes


16. Maximum CPU utilization (CPUUtilization)

參考 AWS 文件 (如果頁面上沒有指標名稱,應該是 AWS 文件又換超連結了,請試著從左邊選單找到 叢集指標(Cluster Metric) 相關章節)

相關原文

The percentage of CPU usage for data nodes in the cluster.

筆記與討論

  • max: 所有節點中,最高的 CPU loading
  • average: 所有節點的平均 CPU loading

17. Minimum free storage space (FreeStorageSpace)

筆記與討論

  • 所有 data node 中,最低的 free storage space

18. Maximum memory utilization (SysMemoryUtilization)

參考文件: 執行個體指標

相關原文

已使用執行個體記憶體的百分比。此測量結果的高值是正常的,通常不代表叢集的問題。如需有關潛在效能和穩定性問題的更佳指標,請參閱 JVMMemoryPressure 指標。

18.1 關於 SysMemoryUtilization 總是很高的討論

筆記與討論
  • JVM 記憶體可概分為 heap 與 off-heap 兩種
  • heap 是 Java 程式(i.e. Elasticserach)可用的部分,監控指標為 JVMMemoryPressure
  • off-heap 的部分,大部分會被 Lucene 用到, Lucene 會執行很多 Segment 的處理,這用到 os 的 filesystem cache,故讓大量的 System RAM 呈現 used
參考資料
摘自 elastic cloud serivce 文件 heap-sizing and swapping 關於 Lucene 描述

Lucene is designed to leverage the underlying OS for caching in-memory data structures. Lucene segments are stored in individual files. Because segments are immutable, these files never change. This makes them very cache friendly, and the underlying OS will happily keep hot segments resident in memory for faster access. These segments include both the inverted index (for fulltext search) and doc values (for aggregations).

摘自 elastic 討論區 ES vs. Lucene memory

nik9000 Nik EverettElastic Team Member Nov 2014

Lucene runs in the same JVM as Elasticsearch but (by default) it mmaps files and then iterates over their content inteligently. That means most of its actual storage is “off heap” (its a java buzz-phrase). Anyway, Linux will serve reads from mmaped files from its page cache. That is why you want to leave linux a whole bunch of unused memory.

參考 elastic cloud serivce 文件 heap-sizing and swapping ,配置建議

The standard recommendation is to give 50% of the available memory to Elasticsearch heap, while leaving the other 50% free. It won’t go unused; Lucene will happily gobble up whatever is left over.

19. Maximum JVM memory pressure (JVMMemoryPressure)

參考文件 Cluster Metrics

相關原文

max percentage of the Java heap used for all data nodes in the cluster Amazon ES uses half of an instance’s RAM for the
Java heap, up to a heap size of 32 GiB.

筆記與討論

  • JVM heap 的 memeory 使用率、預設是所有節點中的 max 值。
  • > 75%時,會啟動 GC 機制,如果大於此值太久,可能會開始慢慢遇到問題,例如 ClusterBlockException, JVMOutOfMemoryError 等等。
  • JVM heap 建議 ~ 實體 RAM 的 50% ,且不要超過 32 G

其他參考文件

Elasticsearch JVM garbage collection


20. Young collection (JVMGCYoungCollectionCount)

參考文件 執行個體指標

相關原文

The number of times that “young generation” garbage collection has run.
大量、持續擴增的執行次數是叢集操作的正常情況。

21. Young collection time (JVMGCYoungCollectionTime)

參考文件 執行個體指標

相關原文

The amount of time, in milliseconds, that the cluster has spent performing “young generation” garbage collection.

22. Old collection (JVMGCOldCollectionCount)

參考文件 執行個體指標

相關原文

The number of times that “old generation” garbage collection has run.

23. Old collection (JVMGCOldCollectionCount)

參考文件 執行個體指標

相關原文

The amount of time, in milliseconds, that the cluster has spent performing “old generation” garbage collection.

其他參考文件

Elasticsearch JVM thread pool


參考文件 Elastic thread pools

相關原文

A node uses several thread pools to manage memory consumption. Queues associated with many of the thread pools enable pending requests to be held instead of discarded.

24. Write thread pool (ThreadpoolWriteThreads)

The size of the write thread pool.

25. Index thread pool (ThreadpoolIndexThreads)

The size of the index thread pool.

26. Search thread pool (ThreadpoolSearchThreads)

The size of the search thread pool.

27. Merge thread pool (ThreadpoolForce_mergeThreads)

The size of the force merge thread pool.

Cross-cluster search connections


跨叢集的相關指標,參考文件 跨叢集搜尋指標

28. Cross cluster inbound requests (CrossClusterInboundRequests)

相關原文

Number of incoming connection requests received from the source domain.

從來源網域收到的傳入連線請求數。

29. Cross cluster outbound requests (CrossClusterOutboundRequests)

相關原文

傳送至目的地網域的搜尋請求數。用來檢查跨叢集搜尋請求的負載是否佔用網域,將此指標中的任何尖峰與任何 JVM/CPU 尖峰相互關聯。

30. Cross cluster outbound connections (CrossClusterOutboundConnections)

相關原文

  • 連線節點數。
  • 如果回應包含一或多個略過的網域,請使用此指標以追蹤任何運作狀態不良的連線。如果這個數字掉到 0,則表示連線運作狀態不良。

參考文件


  1. Monitoring Cluster Metrics with Amazon CloudWatch (各種指標的概要說明)
  2. Amazon Elasticsearch Service Developer Guide (操作手冊&故障概要)

You Might Also Like

Leave a Reply

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料