Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ElasticSearch entered "read only" mode, node cannot be altered

Something happened during the night to my ES cluster (composed of 5 data nodes, 3 master nodes).

I have no idea what happened but all the indices and data were deleted and the cluster entered a "read only" mode, possibly hacked?

When trying to get Kibana running, I get the following: kibana

Tried restarting Kibana - it restarted, nothing changed. Tried restarting Elastic - it restarted (all nodes), nothing changed.

I then had a look at the cluster settings and this is what I got:

{
  "persistent": {
    "cluster": {
      "routing": {
        "allocation": {
          "enable": "all"
        }
      },
      "blocks": {
        "read_only": "true"
      }
    }
  },
  "transient": {
    "cluster": {
      "routing": {
        "allocation": {
          "enable": "all"
        }
      }
    }
  }
}

I tried undoing the read only as follows:

PUT _cluster/settings
{
  "persistent": {
    "blocks.read_only": false
  }
}

No luck as you can see:

{
  "error": {
    "root_cause": [
      {
        "type": "cluster_block_exception",
        "reason": "blocked by: [FORBIDDEN/6/cluster read-only (api)];"
      }
    ],
    "type": "cluster_block_exception",
    "reason": "blocked by: [FORBIDDEN/6/cluster read-only (api)];"
  },
  "status": 403
}

Any ideas?

UPDATE: Problem solved by Andrei Stefan, now for the more important part - why? What happened and why? I've lost all data and my cluster entered a read-only mode.

like image 804
Orz Avatar asked Aug 03 '16 05:08

Orz


People also ask

How do I close Elasticsearch index?

To close all indices, use _all or * . By default, you must explicitly name the indices you are closing. To specify indices to close with _all , * , or other wildcard expressions, change the action. destructive_requires_name setting to false .

What is master node in Elasticsearch?

The master node is responsible for lightweight cluster-wide actions such as creating or deleting an index, tracking which nodes are part of the cluster, and deciding which shards to allocate to which nodes. It is important for cluster health to have a stable master node.

What is coordinator node in Elasticsearch?

Client nodes were removed from Elasticsearch after version 2.4 and became coordinating nodes. Coordinating nodes are nodes that do not hold any configured role. They don't hold data and are not part of the master eligible group nor execute ingest pipelines.


1 Answers

The correct command is:

PUT /_cluster/settings
{
  "persistent" : {
    "cluster.blocks.read_only" : false
  }
}
like image 62
Andrei Stefan Avatar answered Oct 02 '22 15:10

Andrei Stefan