简体   繁体   English

Kubernetes 上的 Elasticsearch 插件

[英]Elasticsearch plugin on Kubernetes

I need to restart the Elasticsearch node after installing the injest-attachment plugin on Kubernetes Engine on Google Cloud Platform.在 Google Cloud Platform 上的 Kubernetes Engine 上安装 injest-attachment 插件后,我需要重新启动 Elasticsearch 节点。 I have deployed Elasticsearch on a pod.我已经在 pod 上部署了 Elasticsearch。 What is the best way to restart the Elasticsearch nodes?重启 Elasticsearch 节点的最佳方法是什么?

If Elasticsearch is running directly on the VM:如果 Elasticsearch 直接在 VM 上运行:

systemctl restart elasticsearch

If Elasticsearch is running as a container on docker:如果 Elasticsearch 作为 docker 上的容器运行:

docker restart <container-id>

If Elasticsearch is running as a Kubernetes pod (deployed through a Kubernetes manifest):如果 Elasticsearch 作为 Kubernetes pod 运行(通过 Kubernetes 清单部署):

  • update the image tag in the manifest if needed, and do kubectl apply如果需要,更新清单中的图像标签,并执行kubectl apply
  • Or use kubectl replace or kubectl edit commands或者使用kubectl replacekubectl edit命令

On Kubernetes, ideally, you should use the declarative way of updating the manifests and then do a kubectl apply -f在 Kubernetes 上,理想情况下,您应该使用更新清单的声明方式,然后执行kubectl apply -f

如果您使用复制集部署了 elasticsearch,Kubernetes 将自动强制执行所需 pod 的数量,因此您可以简单地杀死现有的 pod 并创建一个新的 pod。

kubectl delete pods example-pod-1812877987

I ran into the same problem when installing the ltr plugin on a Minikube deployment of Elasticsearch.在 Elasticsearch 的 Minikube 部署上安装 ltr 插件时,我遇到了同样的问题。

Following the instructions of using initContainer to install the plugin [1] did not work since I could not figure out how to restart Elasticsearch after plugin installation since I was not able to get root access to the elasticsearch pod.按照使用 initContainer 安装插件的说明 [1] 不起作用,因为我无法弄清楚如何在插件安装后重新启动 Elasticsearch,因为我无法获得对 elasticsearch pod 的 root 访问权限。

However, following the instructions on how to build a custom image containig the plugin [2] did solve my problem since in that way the plugin is installed before elasticsearch is started.但是,按照有关如何构建包含插件的自定义图像的说明 [2] 确实解决了我的问题,因为在启动 elasticsearch 之前以这种方式安装了插件。

[1] https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-bundles-plugins.html [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 [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