Elasticsearch OpenSearch Cluster Blocks Read-Only

By Opster Team

Updated: Apr 9, 2023

| 2 min read

In addition to reading this guide, we recommend you run the Elasticsearch Health Check-Up. It will detect issues and improve your Elasticsearch performance by analyzing your shard sizes, threadpools, memory, snapshots, disk watermarks and more.

The Elasticsearch Check-Up is free and requires no installation.

Before you begin reading this guide, we recommend you try running the OpenSearch Error Check-Up which analyzes 2 JSON files to detect many configuration errors.

To evaluate the use of cluster.blocks.read_only and cluster.blocks.read_only_allow_delete in your deployment and resolve any issues related to these concepts, try AutoOps for OpenSearch. It diagnoses problems by analyzing hundreds of metrics collected by a lightweight agent and offers guidance for resolving them.

Overview

A read-only delete block can be applied automatically by the cluster because of a disk space issue, or may be applied manually by an operator to prevent indexing to the OpenSearch cluster.

There are two types of block:

  • cluster.blocks.read_only
  • cluster.blocks.read_only_allow_delete

A read-only block is typically applied by an operator because some sort of cluster maintenance is taking place or in order to recover cluster stability.

A read-only allow delete block may be applied either automatically or by an operator because of a disk space issue.

How to resolve cluster.blocks.read_only

Check whether the cluster has been blocked via the settings:

GET _cluster/settings

There is probably a good reason why an operator took such an action, so do not remove it without some consideration.

PUT _cluster/settings
{
  "transient": {
   
    "cluster.blocks.read_only":null

  }
}

Index level read-only block

A read-only delete block may be applied to one or more individual indices. You can see where blocks have been applied here:

GET my_index/_settings

To remove the block from one index:

PUT my_index/_settings
{
  "index": {
	"blocks": {
  	"read_only": "false"
	}
  }
}

To remove the block from all indices:

PUT _all/_settings
{
  "index": {
	"blocks": {
  	"read_only": "false"
	}
  }
}

How to resolve cluster.blocks.read_only_allow_delete

Check whether the cluster has been blocked via the settings:

GET _cluster/settings

There is probably a good reason why an operator took such an action, so do not remove it without some consideration.

PUT _cluster/settings
{
  "transient": {
   
    "cluster.blocks.read_only_allow_delete":null

  }
}

Index level read-only delete block

A read-only delete block may be applied to one or more individual indices. You can see where blocks have been applied here:

GET my_index/_settings

To remove the block from one index:

PUT my_index/_settings
{
  "index": {
	"blocks": {
  	"read_only_allow_delete": "false"
	}
  }
}

To remove the block from all indices:

PUT _all/_settings
{
  "index": {
	"blocks": {
  	"read_only_allow_delete": "false"
	}
  }
}

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?


Analyze your cluster & get personalized recommendations

Skip to content