Briefly, this error occurs when the Elasticsearch node, which was initially the master node during the snapshot creation process, loses its master status. This could be due to network issues, heavy load, or configuration problems causing the cluster state to change. To resolve this, ensure the stability of your network, balance the load across your nodes, and check your cluster’s health regularly. Also, consider increasing the master election timeout setting to give the master node more time to respond before a new master is elected.
This guide will help you check for common problems that cause the log ” [{}] failed to create snapshot – no longer a master ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: master, snapshot.
Log Context
Log “[{}] failed to create snapshot – no longer a master” classname is SnapshotsService.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :
@Override 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") ); }