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

Prevent ES settings related problems

Check if your ES issues are caused from misconfigured settings

Resolve Issue

Updated: Feb-20

In Page Navigation (click to jump) :
Troubleshooting Background       
Related Issues  
Log Context
About Opster

Opster Offer’s World-Class Elasticsearch Expertise In One Powerful Product
Try Our Free Check-Up   Prevent Incident

Troubleshooting background

To troubleshoot Elasticsearch log “Updating cluster.routing.allocation.disable-new-allocation from to” it’s important to understand common problems related to Elasticsearch concepts: allocation, cluster, routing. See detailed explanations below 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 :

1 ElasticSearch: How to disable shard reallocation of all shards? 5 5.50 K 

2 Github Issue Number 4488    


Log Context

Log ” updating [cluster.routing.allocation.disable_new_allocation] from [{}] to [{}]” classname is DisableAllocationDecider.java
We have extracted the following from Elasticsearch source code to get an in-depth context :

     class ApplySettings implements NodeSettingsService.Listener {
        
Override
        public void onRefreshSettings(Settings settings) {
            boolean disableNewAllocation = settings.getAsBoolean(CLUSTER_ROUTING_ALLOCATION_DISABLE_NEW_ALLOCATION; DisableAllocationDecider.this.disableNewAllocation);
            if (disableNewAllocation != DisableAllocationDecider.this.disableNewAllocation) {
                logger.info("updating [cluster.routing.allocation.disable_new_allocation] from [{}] to [{}]"; DisableAllocationDecider.this.disableNewAllocation; disableNewAllocation);
                DisableAllocationDecider.this.disableNewAllocation = disableNewAllocation;
            }

            boolean disableAllocation = settings.getAsBoolean(CLUSTER_ROUTING_ALLOCATION_DISABLE_ALLOCATION; DisableAllocationDecider.this.disableAllocation);
            if (disableAllocation != DisableAllocationDecider.this.disableAllocation) {





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?