How To Solve Issues Related to Log – Has a wrong value ; defaulting to indices_all_active

Get an Elasticsearch Check-Up

Check if your ES issues are caused from misconfigured settings
(Free 2 min process)

Check-Up

Last update: Jan-20

Elasticsearch Error Guide In Page Navigation (click to jump) :

Troubleshooting Background – start here to get the full picture       
Related Issues – selected resources on related issues  
Log Context – usefull for experts
About Opster – offering a diffrent approach to troubleshoot Elasticsearch

Check Your Elasticsearch Settings for Painfull Mistakes 


Troubleshooting background

To troubleshoot Elasticsearch log “Has a wrong value ; defaulting to indices_all_active” it’s important to know common problems related to Elasticsearch concepts: allocation, cluster, rebalance, routing. See below-detailed explanations complete with common problems, examples and useful tips.

Cluster in Elasticsearch

What is it

In Elasticsearch a cluster is a collection of one or more nodes (servers / VMs). A cluster can consist of an unlimited number of nodes. The cluster provides interface for indexing and storing data and search capability across all of the data which is stored in the data nodes

Each cluster has a single master node that is elected by the master eligible nodes. In cases where the master is not available the other connected master eligible nodes elect a new master. Clusters are identified by a unique name, which defaults to “Elasticsearch”.

Elasticsearch Rebalance

What it is

Cluster rebalancing is the process by which an Elasticsearch cluster distributes data across the nodes.  Specifically, it refers to the movement of existing data shards to another node to improve the balance across the nodes (as opposed to the allocation of new shards to nodes).  Usually, it is a completely automatic process that requires no outside intervention. However, there are a number of parameters Elasticsearch uses to regulate this process.

Examples

The command below will establish the cluster settings to enable automatic cluster rebalancing.  It is not necessary to run the command (the values used are in fact the defaults).

PUT /_cluster/settings?flat_settings=true
{
	"transient" : {
"cluster.routing.rebalance.enable": "all",
"cluster.routing.allocation.allow_rebalance":  "indices_all_active"	,
"cluster.routing.allocation.cluster_concurrent_rebalance":"2"  

	}
}
Notes and good things to know

In general, the cluster rebalances settings have sensible defaults.  It is generally not advisable to disable cluster rebalancing. It is usually most sensible to wait until indices are all active before rebalancing since we consider the highest priority to be recovering the indices rather than moving them around.  Finally, it is recommended to limit the number of concurrent rebalances to 2 (the default) since having a large number of shards moving around at a given time can use a lot of resources resource and cause instability. Increasing this number would only make sense on large clusters.

You can consider the “rebalance” process to be a tendency to spread the total number of shards across all nodes in the cluster, and also to spread the total number of shards for a given index as evenly as possible across the cluster.   The rebalance is a “soft” algorithm, and will be overruled by other “hard” factors such as disk-based or shard allocation awareness.  

If you think your cluster is not rebalancing as it should first check the “hard” limits you have on shard allocation awareness or disk-based shard allocation before tweaking the rebalance parameters.

Manual rebalancing

It is also possible to rebalance manually using a command like this:

POST /_cluster/reroute?dry_run=true
{
    "commands" : [
        {
            "move" : {
                "index" : "test", "shard" : 0,
                "from_node" : "node1", "to_node" : "node2"
            }
        }
    ]
}

It is advisable to include the dry_run parameter to check the result of your action, and if everything is in order then repeat the command with dry_run=false.

Bear in mind that if you rebalance manually, Elasticsearch may move the same (or another shard) back automatically, compensating for your previous action.  Similarly, there may be constraints that will prevent your reallocation from being accepted by the cluster.


To help troubleshoot related issues we have gathered selected Q&A from the community and issues from Github , please review the following for further information :

1. Avoid Rebalancing Upon Failure  

2. Github Issue Number 30162      


Log Context

Log ”Has a wrong value ; defaulting to indices_all_active” classname is ClusterRebalanceAllocationDecider.java
We have extracted the following from Elasticsearch source code to get an in-depth context :

 
    public ClusterRebalanceAllocationDecider(Settings settings; ClusterSettings clusterSettings) {
        try {
            type = CLUSTER_ROUTING_ALLOCATION_ALLOW_REBALANCE_SETTING.get(settings);
        } catch (IllegalStateException e) {
            logger.warn("[{}] has a wrong value {}; defaulting to 'indices_all_active'";
                    CLUSTER_ROUTING_ALLOCATION_ALLOW_REBALANCE_SETTING;
                    CLUSTER_ROUTING_ALLOCATION_ALLOW_REBALANCE_SETTING.getRaw(settings));
            type = ClusterRebalanceType.INDICES_ALL_ACTIVE;
        }
        logger.debug("using [{}] with [{}]"; CLUSTER_ROUTING_ALLOCATION_ALLOW_REBALANCE; type);






About Opster

Incorporating deep knowledge and broad history of Elasticsearch issues. Opster’s solution identifies and predicts root causes of Elasticsearch problems, provides recommendations and can automatically perform various actions to manage, troubleshoot and prevent issues

Learn more: Glossary | Blog| Troubleshooting guides | Error Repository

Need help with any Elasticsearch issue ? Contact Opster

Did this page help you?