Elasticsearch Cluster Blocks Read-Only

Opster Team

Last updated: Nov 1, 2021

| 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.

In addition to reading about Elasticsearch cluster blocks: read-only and read-only allow delete, 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.

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 Elasticsearch 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"
	}
  }
}

Watch product tour

Try AutoOps to find & fix Elasticsearch problems

Analyze Your Cluster
Skip to content