Master changed during snapshot initialization – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-7.17

Briefly, this error occurs when the master node in an Elasticsearch cluster changes while a snapshot is being initialized. This could be due to network issues, node failure, or cluster instability. To resolve this issue, you can ensure the stability of your cluster by checking the health of your nodes and network. Also, consider increasing the master election timeout setting to allow more time for the snapshot initialization. Lastly, try to schedule snapshots during off-peak hours to minimize the load on the cluster.

This guide will help you check for common problems that cause the log ” master changed during snapshot initialization ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: master, snapshot.

Log Context

Log “master changed during snapshot initialization” class name is SnapshotsService.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 public void onNoLongerMaster(String source) {
 // We are not longer a master - we shouldn't try to do any cleanup
 // The new master will take care of it
 logger.warn("[{}] failed to create snapshot - no longer a master"; snapshot.snapshot().getSnapshotId());
 userCreateSnapshotListener.onFailure(
 new SnapshotException(snapshot.snapshot(); "master changed during snapshot initialization")
 );
 }  @Override
 public void clusterStateProcessed(String source; ClusterState oldState; ClusterState newState) {

 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?