OK, I will do that, thanks!
I had the same issue on Kubernetes using StatefulSet. The fix which worked and still works for me, looks like:
# Source: elk/templates/02-elasticsearch-configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: elasticsearch-config
namespace: transactions-api
data:
elasticsearch.yml: |2+
cluster.name: "po"
cluster.initial_master_nodes:
- elasticsearch-po-0
- elasticsearch-po-1
- elasticsearch-po-2
- elasticsearch-po-3
- elasticsearch-po-4
- elasticsearch-po-5
node.name: ${HOSTNAME}
# 512Mb per shard being indexed. 2xprimary,2xreplica = 2048Mb
# https://www.elastic.co/guide/en/elasticsearch/reference/current/indexing-buffer.html
indices.memory.index_buffer_size: 25%
indices.memory.min_index_buffer_size: 96mb
indices.memory.max_index_buffer_size: 2048mb
thread_pool.write.queue_size: 400
cluster.routing.allocation.awareness.attributes: rack_id
cluster.routing.allocation.awareness.force.rack_id.values: 1,2
xpack.monitoring.collection.enabled: true
# Disabling unused x-pack components (some are disabled by default)
xpack.security.enabled: false
xpack.security.audit.enabled: false
# ML stuff enabled by default
xpack.ml.enabled: false
node.ml: false
network.host: _site_,_lo_
# TODO: dynamic configuration needed
discovery.zen.ping.unicast.hosts:
- elasticsearch-po-0.elasticsearch-po
- elasticsearch-po-1.elasticsearch-po
- elasticsearch-po-2.elasticsearch-po
- elasticsearch-po-3.elasticsearch-po
- elasticsearch-po-4.elasticsearch-po
- elasticsearch-po-5.elasticsearch-po
The issue was that ES can't resolve the hostnames like elasticsearch-po-5
, it can only resolve these: elasticsearch-po-5.elasticsearch-po
. And since node.name
is elasticsearch-po-5
it didn't work. And I was getting the similar name mismatch error. I guess it could be set up more clean than in my case.
If needed I can attach my helm template file as well.
I deployed it in Docker Swarm, to fix this issue, I separated ES into 3 coordination nodes, 3 master nodes, 3 data nodes. and then deploy 3 master nodes in 'replicated' mode instead of "global", then set "initial_master_nodes" with master service name. now it works fine.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.