Auto expanded replicas to – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 2.3-2.3

Briefly, this error occurs when Elasticsearch automatically expands the number of replicas due to the auto_expand_replicas setting. This setting is useful for high availability, but can cause issues if there’s insufficient disk space or cluster capacity. To resolve this, you can disable auto_expand_replicas in the index settings, or ensure your cluster has enough capacity to handle the additional replicas. Alternatively, you can manually control the number of replicas based on your application’s read and write load.

This guide will help you check for common problems that cause the log ” [{}] auto expanded replicas to [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: cluster, metadata and settings.

Log Context

Log “[{}] auto expanded replicas to [{}]” classname is MetaDataUpdateSettingsService.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 
                updateSettings(updateRequest; new ActionListener() {
                    
Override
                    public void onResponse(ClusterStateUpdateResponse response) {
                        for (String index : indices) {
                            logger.info("[{}] auto expanded replicas to [{}]"; index; fNumberOfReplicas);
                        }
                    }

                    
Override
                    public void onFailure(Throwable t) {


 

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?