How To Solve Issues Related to Log – Updating cluster.routing.allocation.disable-replica-allocation from to

Get an Elasticsearch Check-Up

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

Check-Up

Last update: Feb-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 “Updating cluster.routing.allocation.disable-replica-allocation from to” it’s important to know common problems related to Elasticsearch concepts: allocation, cluster, 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”.

Routing in Elasticsearch

What it is

In Elasticsearch, routing refers to document routing. When you index a document, Elasticsearch will determine which shard will be used to index the document to. 

The shard is selected based on the following formula:

shard = hash(_routing) % number_of_primary_shards

Where the default value of _routing is _id.
It is important to know which shard the document is routed to, because Elasticsearch will need to determine where to find that document later on for document retrieval requests. 

Examples

In twitter index with 2 primary shards, the document with _id equal to “440” gets routed to the shard number:   

shard = hash( 440 ) % 2
PUT twitter/_doc/440
{
...
}

Notes
  • In order to improve search performance speed you can create custom routing. For example, you can enable custom routing that will ensure only a single shard is queried (the shard that contains your data).
  • To create custom routing in Elasticsearch, you will need to configure and define  that not all routing will be completed by default settings. ( v <= 5.0)
PUT my_index/customer/_mapping
{
   "order":{
      "_routing":{
         "required":true
      }
   }
}
  •  This will ensure that every document in the “customer” type must specify a custom routing.  For elasticsearch 6 or above you will need to update the same mapping as:
PUT my_index/_mapping
{
   "order":{
      "_routing":{
         "required":true
      }
   }
}


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 :

ElasticSearch: How to disable shard reallocation of all shards?
stackoverflow.com/questions/29408834/elasticsearch-how-to-disable-shard-reallocation-of-all-shards

Number of Views : 5.50 K  Score on Stackoverflow : 5

How to remove node from elasticsearch cluster on runtime without down time
stackoverflow.com/questions/17268495/how-to-remove-node-from-elasticsearch-cluster-on-runtime-without-down-time

Number of Views : 53.17 K  Score on Stackoverflow : 61


Log Context

Log ”Updating cluster.routing.allocation.disable-replica-allocation from to” classname is DisableAllocationDecider.java
We have extracted the following from Elasticsearch source code to get an in-depth context :

                 DisableAllocationDecider.this.disableAllocation = disableAllocation;
            }

            boolean disableReplicaAllocation = settings.getAsBoolean(CLUSTER_ROUTING_ALLOCATION_DISABLE_REPLICA_ALLOCATION; DisableAllocationDecider.this.disableReplicaAllocation);
            if (disableReplicaAllocation != DisableAllocationDecider.this.disableReplicaAllocation) {
                logger.info("updating [cluster.routing.allocation.disable_replica_allocation] from [{}] to [{}]"; DisableAllocationDecider.this.disableReplicaAllocation; disableReplicaAllocation);
                DisableAllocationDecider.this.disableReplicaAllocation = disableReplicaAllocation;
            }
        }
    }







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

We are constantly updating our analysis of Elasticsearch logs, errors, and exceptions. Sharing best practices and providing troubleshooting guides.

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

Need help with any Elasticsearch issue ? Contact Opster

Did this page help you?