簡體   English   中英

Kubernetes 上的 Elasticsearch 插件

[英]Elasticsearch plugin on Kubernetes

在 Google Cloud Platform 上的 Kubernetes Engine 上安裝 injest-attachment 插件后,我需要重新啟動 Elasticsearch 節點。 我已經在 pod 上部署了 Elasticsearch。 重啟 Elasticsearch 節點的最佳方法是什么?

如果 Elasticsearch 直接在 VM 上運行:

systemctl restart elasticsearch

如果 Elasticsearch 作為 docker 上的容器運行:

docker restart <container-id>

如果 Elasticsearch 作為 Kubernetes pod 運行(通過 Kubernetes 清單部署):

  • 如果需要,更新清單中的圖像標簽,並執行kubectl apply
  • 或者使用kubectl replacekubectl edit命令

在 Kubernetes 上,理想情況下,您應該使用更新清單的聲明方式,然后執行kubectl apply -f

如果您使用復制集部署了 elasticsearch,Kubernetes 將自動強制執行所需 pod 的數量,因此您可以簡單地殺死現有的 pod 並創建一個新的 pod。

kubectl delete pods example-pod-1812877987

在 Elasticsearch 的 Minikube 部署上安裝 ltr 插件時,我遇到了同樣的問題。

按照使用 initContainer 安裝插件的說明 [1] 不起作用,因為我無法弄清楚如何在插件安裝后重新啟動 Elasticsearch,因為我無法獲得對 elasticsearch pod 的 root 訪問權限。

但是,按照有關如何構建包含插件的自定義圖像的說明 [2] 確實解決了我的問題,因為在啟動 elasticsearch 之前以這種方式安裝了插件。

[1] https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-bundles-plugins.html

[2] https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-custom-images.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM