@DavidTurner Thanks again. The situation I encountered is different from what you described, I will add some information now.
It is the first time i start the cluster,i have configed discovery.seed_hosts
and cluster.initial_master_nodes
as follow,I configured these two configuration items on all master and node, and never modified.
discovery.seed_hosts: ipOfMaster1:9300,ipOfMaster2:9300,ipOfMaster3:9300
cluster.initial_master_nodes:nameOfMaster1,nameOfMaster2,nameOfMaster3
The key logs are as follows:
Node1:
[2020-04-22T15:06:25,345][INFO ][main][o.e.n.Node ] [Node1] starting ...
[2020-04-22T15:06:26,373][INFO ][main][o.e.c.c.Coordinator ] [Node1] cluster UUID [KjQI8jWoRUusEg9NEhXtFg]
[2020-04-22T15:06:27,830][INFO ][elasticsearch[Node1][transport_worker][T#2]][o.e.c.c.JoinHelper ] [Node1] failed to join {Master3}{7mv14SBoSvmNkgmi2FYQFQ}{aAnNhNbXTje6qJKSgSZWsg}{m} with JoinRequest{sourceNode={Node1}{nj0tbhakR32h5NAT3ZCJ5Q}{G-_NanniR-Ww4iOJBCXdGg}{{d}, optionalJoin=Optional.empty}
Caused by: org.elasticsearch.cluster.coordination.CoordinationStateRejectedException: join validation on cluster state with a different cluster uuid dxsFw3OlT9izvLFXvAGBAw than local cluster uuid KjQI8jWoRUusEg9NEhXtFg, rejecting
Master1:
[2020-04-22T15:06:24,300][INFO ][main][o.e.d.DiscoveryModule ] [Master1] using discovery type [zen] and seed hosts providers [settings]
[2020-04-22T15:06:25,305][INFO ][main][o.e.n.Node ] [Master1] starting ...
[2020-04-22T15:06:26,419][INFO ][main][o.e.c.c.Coordinator ] [Master1] cluster UUID [KjQI8jWoRUusEg9NEhXtFg]
[2020-04-22T15:06:27,536][INFO ][elasticsearch[Master1][transport_worker][T#14]][o.e.c.c.JoinHelper ] [Master1] failed to join {Master3}{7mv14SBoSvmNkgmi2FYQFQ}{aAnNhNbXTje6qJKSgSZWsg}{}{}{m} with JoinRequest{sourceNode={Master1}{zp_Ep4ADSAS0EQnMLwCkoA}{3QCCQEV6QyOHBfIXykwJEA}{}{}{m}, optionalJoin=Optional.empty}
Caused by: org.elasticsearch.cluster.coordination.CoordinationStateRejectedException: join validation on cluster state with a different cluster uuid dxsFw3OlT9izvLFXvAGBAw than local cluster uuid KjQI8jWoRUusEg9NEhXtFg, rejecting
Master2:
[2020-04-22T15:06:24,255][INFO ][main][o.e.d.DiscoveryModule ] [Master2] using discovery type [zen] and seed hosts providers [settings]
[2020-04-22T15:06:25,270][INFO ][main][o.e.n.Node ] [Master2] starting ...
[2020-04-22T15:06:26,979][INFO ][elasticsearch[Master2][generic][T#4]][o.e.c.c.Coordinator ] [Master2] setting initial configuration to VotingConfiguration{{bootstrap-placeholder}-Master1,7mv14SBoSvmNkgmi2FYQFQ,S4WT_EGjQri1PFaPpundsg}
[2020-04-22T15:06:27,345][INFO ][elasticsearch[Master2][generic][T#4]][o.e.c.c.CoordinationState] [Master2] cluster UUID set to [dxsFw3OlT9izvLFXvAGBAw]
[2020-04-22T15:06:27,452][INFO ][elasticsearch[Master2][clusterApplierService#updateTask][T#1]][o.e.c.s.ClusterApplierService]
[Master2] master node changed {previous [], current [{Master3}{7mv14SBoSvmNkgmi2FYQFQ}{aAnNhNbXTje6qJKSgSZWsg}{ip}{ip:port}{m}]},
added {{Master3}{7mv14SBoSvmNkgmi2FYQFQ}{aAnNhNbXTje6qJKSgSZWsg}{}{}{m}}, term: 1, version: 1, reason: ApplyCommitRequest{term=1, version=1, sourceNode={Master3}{7mv14SBoSvmNkgmi2FYQFQ}{aAnNhNbXTje6qJKSgSZWsg}{}{}{m}}
Master3:
[2020-04-22T15:06:20,175][INFO ][main][o.e.n.Node ] [Master3] starting ...
[2020-04-22T15:06:27,031][INFO ][elasticsearch[EsMaster@10.162.146.158][masterService#updateTask][T#1]][o.e.c.s.MasterService ] [Master3] elected-as-master ([2] nodes joined)[Master2}{S4WT_EGjQri1PFaPpundsg}{lRib4l65SuCWTCwxqNampg}{}{}{m} elect leader,{Master3}{7mv14SBoSvmNkgmi2FYQFQ}{aAnNhNbXTje6qJKSgSZWsg}{}{}{m} elect leader, _BECOME_MASTER_TASK_, _FINISH_ELECTION_], term: 1, version: 1, delta: master node changed {previous [], current [{Master3}{7mv14SBoSvmNkgmi2FYQFQ}{aAnNhNbXTje6qJKSgSZWsg}{}{}{m}]},added {{Master2}{S4WT_EGjQri1PFaPpundsg}{lRib4l65SuCWTCwxqNampg}{}{}{m}}