Elasticsearch OpenSearch Cluster Blocks Read-Only

By Opster Team

Updated: Oct 19, 2023

| 2 min read

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?