Can't close the ElasticSearch index on AWS?

I created a new AWS ElasticSearch domain for testing. I am using ES on a different host right now and I want to upgrade to AWS.

One thing I need to do is set the mapping (parsers) in my instance. To do this, I need to "close" the index, otherwise ES will simply raise an exception.

Whenever I try to close the index, I get an exception from AWS:

Your request: '/_all/_close' is not allowed by CloudSearch. 

The AWS ES documentation specifically says to do this in some cases:

  curl -XPOST 'http://search-weblogs-abcdefghijklmnojiu.us-east-1.a9.com/_all/_close' 

I did not find any documentation that said why I could not close my indexes on AWS ES, and also did not find anyone else who has this problem.

It’s also a little strange that I have an ElasticSearch domain, but it gives me a CloudSearch error message, as I thought these were different services, although I believe that one of them is implemented in terms of the other.

thanks!

+5
source share
2 answers

AWS Elasticsearch does not support close by indexes.

http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains.html

"Amazon ES does not currently support the Elasticsearch _close API"

+3
source

Since closing all indexes at once is a dangerous action, it may be disabled by default on your cluster. You must ensure that your elasticsearch.yml configuration file does not contain this:

 action.destructive_requires_name: true 

You can install this in your configuration file and restart the cluster, but I strongly disagree with the fact that since it opens the door to all kinds of other destructive actions, such as deleting all your indexes at once.

 action.destructive_requires_name: false 

Instead, you should temporarily update the cluster settings with

 curl -XPUT localhost:9200/_cluster/settings -d '{ "persistent" : { "action.destructive_requires_name" : false } }' 

Then close all your indexes

 curl -XPOST localhost:9200/_all/_close 

And then reset the settings for a safer value:

 curl -XPUT localhost:9200/_cluster/settings -d '{ "persistent" : { "action.destructive_requires_name" : true } }' 
0
source

Source: https://habr.com/ru/post/1233662/


All Articles