Report this

What is the reason for this report?

Name or Service not known

Posted on November 12, 2020

Hola! Antes que nada quería agradecerte por un increíble trabajo que realizaste en esta guía. Mi consulta en esta ocasión es la siguiente: Estoy intentando desplegar en Kubernetes (Rancher), una solución similar a la de la guía. Pude seguir los pasos de la misma en un ambiente de desarrollo y no tuve ningún inconveniente. Al momento de subirlo al ambiente de Testing, surgió el problema de que elasticsearch no resuelve las rutas especificadas en la variable “discovery.seed_hosts”. Estoy usando la versión 7.6.1 de elasticsearch, con el paquete de seguridad activo (xpack.security). Mi configuración se resume en: metadata.name: elasticsearch replicas: 3 (Los 3 son nodos master) discovery.type: zen discovery.seed_hosts: “elasticsearch-0.elasticsearch,elasticsearch-1.elasticsearch,elasticsearch-2.elasticsearch” cluster.initial_master_nodes: “elasticsearch-0,elasticsearch-1,elasticsearch-2”

Al momento de realizar el discovery arroja el error: uknownHostexception: elasticsearch-0.elasticsearch: Name or service not known uknownHostexception: elasticsearch-1.elasticsearch: Name or service not known uknownHostexception: elasticsearch-2.elasticsearch: Name or service not known

Si me podes orientar un poco que podría ser, te lo agradecería muchisimo.

Saludos, Franco



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi Frank,

From what you’ve mentioned, it seems like there might be an issue with DNS resolution in your Kubernetes cluster. The hosts you’ve specified in discovery.seed_hosts should be the DNS names of the Elasticsearch pods, assuming that each of them has their own associated service in Kubernetes.

Here are a few things you could check:

  1. Kubernetes DNS: Is DNS resolution working correctly in your Kubernetes cluster? You can check this by running a debug pod (like busybox) and trying to ping your services’ names. Here’s an example:
kubectl run -i --tty --rm debug --image=busybox --restart=Never -- ping elasticsearch-0.elasticsearch

If that doesn’t work, then there might be a problem with your Kubernetes cluster’s DNS.

  1. Service names: Have you defined services for each Elasticsearch pod and are they exactly named “elasticsearch-0”, “elasticsearch-1”, “elasticsearch-2”? Are they all in the same namespace? If not, you need to either move them into the same namespace or specify the namespace in your discovery.seed_hosts configuration.

If none of these seem to be the issue, there could be a problem with the configuration of Elasticsearch itself. Try setting network.host: 0.0.0.0 in your Elasticsearch configuration to make sure it binds to all network interfaces.

Best.

Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.