简体   繁体   中英

Elasticsearch plugin on Kubernetes

I need to restart the Elasticsearch node after installing the injest-attachment plugin on Kubernetes Engine on Google Cloud Platform. I have deployed Elasticsearch on a pod. What is the best way to restart the Elasticsearch nodes?

If Elasticsearch is running directly on the VM:

systemctl restart elasticsearch

If Elasticsearch is running as a container on docker:

docker restart <container-id>

If Elasticsearch is running as a Kubernetes pod (deployed through a Kubernetes manifest):

  • update the image tag in the manifest if needed, and do kubectl apply
  • Or use kubectl replace or kubectl edit commands

On Kubernetes, ideally, you should use the declarative way of updating the manifests and then do a 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.

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.

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.

[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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM