reaching zen in elasticsearch's cluster coordination · "master not discovered yet, this...
Embed Size (px)
TRANSCRIPT
![Page 1: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/1.jpg)
Reaching Zen in Elasticsearch'sCluster Coordination
Philipp Krenn̴̴̴̴̴@xeraa
![Page 2: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/2.jpg)
![Page 3: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/3.jpg)
Developer !
![Page 4: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/4.jpg)
Cluster Coordination?
![Page 5: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/5.jpg)
Cluster State?
![Page 6: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/6.jpg)
Cluster MetadataCluster SettingsIndex Metadata
Lots more
![Page 7: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/7.jpg)
GET _cluster/stateOnly move forward
Do not lose data
![Page 8: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/8.jpg)
{ "cluster_name" : "docker-cluster", "cluster_uuid" : "n0Hcm7Q3R5yMN5z1PoG6UQ", "version" : 29, "state_uuid" : "Of1zG0noRaGgIfYw_w58MA", "master_node" : "P9UHiA-YSkesOfR7-G50_Q", "blocks" : { }, "nodes" : { "P9UHiA-YSkesOfR7-G50_Q" : { "name" : "elasticsearch3", "ephemeral_id" : "MdWyvnTfRCuhzD9ftWt0Dw", "transport_address" : "172.21.0.3:9300", "attributes" : { ...
![Page 9: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/9.jpg)
Main ComponentsDiscovery
Master ElectionCluster State Publication
![Page 10: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/10.jpg)
ZenZen to Zen2
Not pluggable
![Page 11: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/11.jpg)
![Page 12: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/12.jpg)
Whyhttps://www.elastic.co/guide/en/elasticsearch/resiliency/current/index.html
Repeated network partitions can cause cluster state updates to be lost
(STATUS: DONE, v7.0.0)
![Page 13: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/13.jpg)
Howhttps://github.com/elastic/elasticsearch-formal-models
TLA+ specificationTLC model checking
![Page 14: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/14.jpg)
https://github.com/elastic/elasticsearch-formal-models/blob/master/cluster/isabelle/Preliminaries.thy
text \<open>It works correctly on finite and nonempty sets as follows:\<close>
theorem fixes S :: "Term set" assumes finite: "finite S" shows maxTerm_mem: "S \<noteq> {} \<Longrightarrow> maxTerm S \<in> S" and maxTerm_max: "\<And> t'. t' \<in> S \<Longrightarrow> t' \<le> maxTerm S"proof - presume "S \<noteq> {}" with assms obtain t where t: "t \<in> S" "\<And> t'. t' \<in> S \<Longrightarrow> t' \<le> t" proof (induct arbitrary: thesis) case empty then show ?case by simp ...
![Page 15: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/15.jpg)
DiscoveryWhere are master-eligible nodes?
Is there a master already?
![Page 16: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/16.jpg)
![Page 17: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/17.jpg)
Settingsdiscovery.zen.ping.unicast.hosts → discovery.seed_hosts
static
discovery.zen.hosts_provider → discovery.seed_providers
dynamic (file, EC2, GCE,...)
![Page 18: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/18.jpg)
Master ElectionAgree which node should be master
Form a cluster
![Page 19: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/19.jpg)
![Page 20: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/20.jpg)
discovery.zen. minimum_master_node
sTrust users?
Scaling up or down?
![Page 21: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/21.jpg)
Three Node Cluster
![Page 22: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/22.jpg)
discovery.zen.minimum_master_nodes: ~
![Page 23: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/23.jpg)
discovery.zen.minimum_master_nodes: 2
![Page 24: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/24.jpg)
discovery.zen.minimum_master_nodes: 2
![Page 25: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/25.jpg)
discovery.zen.minimum_master_nodes: 2
![Page 26: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/26.jpg)
discovery.zen.minimum_master_nodes: 2
![Page 27: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/27.jpg)
discovery.zen.minimum_master_nodes: 2
![Page 28: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/28.jpg)
cluster. initial_master_node
sList of node names for the very first
election
![Page 29: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/29.jpg)
OKto set on multiple nodes as long as
they are all consistent
![Page 30: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/30.jpg)
Ignoredonce node has joined a cluster even if
restarted
![Page 31: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/31.jpg)
Unnecessarywhen joining new node to existing
cluster
![Page 32: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/32.jpg)
Upgrade 6 to 7Full cluster restart: Set
cluster.initial_master_nodes
Rolling upgrade: cluster.initial_master_nodes not
required
![Page 33: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/33.jpg)
Fresh ClusterEmpty cluster.initial_master_nodes
elasticsearch2 | {"type": "server", "timestamp": "2019-05-24T14:02:51,173+0000", "level": "WARN", "component": "o.e.c.c.ClusterFormationFailureHelper", "cluster.name": "docker-cluster", "node.name": "elasticsearch2", "message":
![Page 34: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/34.jpg)
"master not discovered yet,this node has not previously joined a bootstrapped (v7+) cluster,and [cluster.initial_master_nodes] is empty on this node:have discovered [ {elasticsearch1}{pSUJ60tSRWSrcWkRevLfyA}{_jIaabgyTQOHAOjcwUruIQ} {192.168.112.3}{192.168.112.3:9300} {ml.machine_memory=1073741824, ml.max_open_jobs=20, xpack.installed=true}, {elasticsearch3}{ngaTCze8QHSHydCXsttXyw}{mbIad-A4SLOJvP7Ava5dEw} {192.168.112.4}{192.168.112.4:9300} {ml.machine_memory=1073741824, ml.max_open_jobs=20, xpack.installed=true}];
![Page 35: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/35.jpg)
discovery will continue using [192.168.112.3:9300, 192.168.112.4:9300] from hosts providers and [ {elasticsearch2}{iANt64LESxqjJv8tHV5KKw}{K0bYEuQ2TnamsiOefTUXgQ} {192.168.112.2}{192.168.112.2:9300} {ml.machine_memory=1073741824, xpack.installed=true, ml.max_open_jobs=20}]from last-known cluster state;node term 0, last-accepted version 0 in term 0"
![Page 36: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/36.jpg)
Dynamic Cluster Scaling
Master-ineligible: as beforeAdding master-eligible: Just do it
Removing master-eligible: Just do itAs long as you remove less than half of them at once
![Page 37: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/37.jpg)
Cluster State Publication
Agree on cluster state updatesBroadcast updates to all nodes
![Page 38: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/38.jpg)
![Page 39: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/39.jpg)
![Page 40: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/40.jpg)
Conclusion
![Page 41: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/41.jpg)
Demohttps://github.com/xeraa/elastic-docker/tree/master/rolling_upgrade elasticsearch1: image: docker.elastic.co/elasticsearch/elasticsearch:$ELASTIC_VERSION environment: - node.name=elasticsearch1 - ES_JAVA_OPTS=-Xms512m -Xmx512m - discovery.zen.ping.unicast.hosts=elasticsearch2,elasticsearch3 - discovery.zen.minimum_master_nodes=2 #- discovery.seed_hosts=elasticsearch2,elasticsearch3 #- cluster.initial_master_nodes=elasticsearch1,elasticsearch2,elasticsearch3 volumes: - esdata_upgrade1:/usr/share/elasticsearch/data ports: - 9201:9200 networks: - esnet
![Page 42: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/42.jpg)
Zen to Zen2Faster, safer, more debuggable
![Page 43: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/43.jpg)
Tonight: Elasticsearch Meetup @Camunda
https://www.meetup.com/Elasticsearch-Berlin/
![Page 44: Reaching Zen in Elasticsearch's Cluster Coordination · "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes]](https://reader032.vdocument.in/reader032/viewer/2022013117/5d66bd8288c993f8668bd77d/html5/thumbnails/44.jpg)
Reaching Zen in Elasticsearch'sCluster Coordination
Philipp Krenn̴̴̴̴̴@xeraa