# Elastic search not able to synch to each other in statefulset

**URL:** <https://discuss.elastic.co/t/elastic-search-not-able-to-synch-to-each-other-in-statefulset/203182>\
**Category:** Elasticsearch\
**Created:** [October 11, 2019, 8:36am UTC](https://discuss.elastic.co/t/elastic-search-not-able-to-synch-to-each-other-in-statefulset/203182 "2019-10-11T08:36:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kshreyas](https://avatars.discourse-cdn.com/v4/letter/k/e0b2c6/32.png) [@kshreyas](https://discuss.elastic.co/u/kshreyas)\
**Post date:** [October 11, 2019, 8:36am UTC](https://discuss.elastic.co/t/elastic-search-not-able-to-synch-to-each-other-in-statefulset/203182/1 "2019-10-11T08:36:11Z")

</div>

zHm-bZyQ}{10.244.6.47}{10.244.6.47:9300}{dim}{xpack.installed=true}] from last-known cluster state; node term 0, last-accepted version 0 in term 0" }  
{"type": "server", "timestamp": "2019-10-11T08:34:10,627+0000", "level": "WARN", "component": "o.e.c.c.ClusterFormationFailureHelper", "cluster.name": "k8s-logs", "node.name": "elasticsearch-0", "message": "master not discovered or elected yet, an election requires two nodes with ids [7nQvPXmtRdOvxNhmTQF1GQ, 0aDXLaYSS0-iGv35oOFMbg], have discovered [{elasticsearch-0}{7nQvPXmtRdOvxNhmTQF1GQ}{goRJAS\_8Qe60jqzHm-bZyQ}{10.244.6.47}{10.244.6.47:9300}{dim}{xpack.installed=true}, {elasticsearch-1}{0aDXLaYSS0-iGv35oOFMbg}{4w8WyyFoSyCrndi0Mdod\_Q}{10.244.1.157}{10.244.1.157:9300}{dim}{xpack.installed=true}] which is a quorum; discovery will continue using [10.244.1.157:9300] from hosts providers and [{elasticsearch-0}{7nQvPXmtRdOvxNhmTQF1GQ}{goRJAS\_8Qe60jqzHm-bZyQ}{10.244.6.47}{10.244.6.47:9300}{dim}{xpack.installed=true}] from last-known cluster state; node term 0, last-accepted version 0 in term 0" }  
[ro

Configuration

apiVersion: v1  
kind: ConfigMap  
metadata:  
name: elasticsearch  
data:

elasticsearch.yml: |  
cluster.name: "k8s-logs"  
network.host: 0.0.0.0  
xpack.monitoring.collection.enabled: true  
xpack.monitoring.elasticsearch.collection.enabled: true  
xpack.ml.enabled: false  
node.data: true  
node.master: true  
xpack.security.enabled: false

* * *

apiVersion: apps/v1  
kind: StatefulSet  
metadata:  
name: elasticsearch  
spec:  
serviceName: elasticsearch  
replicas: 2  
updateStrategy:  
type: RollingUpdate  
selector:  
matchLabels:  
component: elasticsearch  
template:  
metadata:  
labels:  
component: elasticsearch  
spec:  
containers:  
- name: elasticsearch  
image: [docker.elastic.co/elasticsearch/elasticsearch:7.3.1](http://docker.elastic.co/elasticsearch/elasticsearch:7.3.1)  
env:  
- name: discovery.type  
value: single-node  
ports:  
- containerPort: 9200  
name: http  
protocol: TCP  
- containerPort: 9300  
name: transport  
protocol: TCP  
volumeMounts:  
- name: config-volume  
mountPath: /usr/share/elasticsearch/config/elasticsearch.yml  
subPath: elasticsearch.yml  
- name: data  
mountPath: /usr/share/elasticsearch/data  
env:  
- name: cluster.name  
value: k8s-logs  
- name: node.name  
valueFrom:  
fieldRef:  
fieldPath: metadata.name  
- name: discovery.seed\_hosts  
value: "elasticsearch-0.elasticsearch,elasticsearch-1.elasticsearch"  
- name: cluster.initial\_master\_nodes  
value: "elasticsearch-0,elasticsearch-1"  
- name: ES\_JAVA\_OPTS  
value: "-Xms512m -Xmx512m"  
initContainers:  
- name: fix-permissions  
image: busybox  
command: ["sh", "-c", "chown -R 1000:1000 /usr/share/elasticsearch/data"]  
securityContext:  
privileged: true  
volumeMounts:  
- name: data  
mountPath: /usr/share/elasticsearch/data  
- name: increase-vm-max-map  
image: busybox  
command: ["sysctl", "-w", "vm.max\_map\_count=262144"]  
securityContext:  
privileged: true  
- name: increase-fd-ulimit  
image: busybox  
command: ["sh", "-c", "ulimit -n 65536"]  
securityContext:  
privileged: true  
volumes:  
- name: config-volume  
configMap:  
name: elasticsearch  
items:  
- key: elasticsearch.yml  
path: elasticsearch.yml  
volumeClaimTemplates:

- metadata:  
name: data  
spec:  
accessModes: ["ReadWriteOnce"]  
resources:  
requests:  
storage: 6Gi

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 8, 2019, 8:36am UTC](https://discuss.elastic.co/t/elastic-search-not-able-to-synch-to-each-other-in-statefulset/203182/2 "2019-11-08T08:36:13Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
