不允许为Elasticsearch重新编制索引?

编程入门 行业动态 更新时间:2024-10-12 05:44:05
本文介绍了不允许为Elasticsearch重新编制索引?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经设置了我的AWS Elasticsearch实例,以便任何人都可以对其执行任何操作(创建,删除,搜索等).

I've set my AWS Elasticsearch instance so that anyone can do anything (create, delete, search, etc.) to it.

这些是我的权限(将$ myARN替换为我的Elasticsearch ARN):

These are my permissions (replace $myARN with my Elasticsearch ARN):

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "*" }, "Action": "es:*", "Resource": "$myARN" } ] }

当我PUT新索引时:

PUT my-elasticsearch-domain.us-west-2.es.amazonaws/index-name

或者我DELETE一个索引:

DELETE my-elasticsearch-domain.us-west-2.es.amazonaws/index-name

我明白了:

{ "acknowledged": true }

这意味着我可以创建和删除索引,但是当我尝试POST重新索引时,我得到:

Which means I can create and delete indexes but when I try to POST a reindex I get:

{ "Message": "Your request: '/_reindex' is not allowed." }

我必须签署此请求吗?为什么我必须签署此请求但不创建或删除索引?

Do I have to sign this request? Why should I have to sign this request but not creating or deleting indexes?

推荐答案

原因仅是因为Amazon Elasticsearch Service是一种受限环境,您无法访问由Amazon Elasticsearch Service提供的全部服务和终端节点.准系统安装Elasticsearch.

The reason is simply because the Amazon Elasticsearch Service is a kind of restricted environment where you don't have access to the full range of services and endpoints provided by a barebone install of Elasticsearch.

您可以查看列表允许在Amazon Elasticsearch Service上使用的终端节点,而_reindex不在该列表中.

You can check the list of endpoints that you're allowed to use on the Amazon Elasticsearch Service and _reindex is not part of that list.

更新

不过,还有另一种方法可以实现您想要的.通过使用Logstash,您可以从ES中获取数据,应用所需的任何转换,然后将其吸收回ES.

There's another way to achieve what you want, though. By leveraging Logstash, you can source the data from ES, apply any transformation you wish and sink it back to ES.

input { elasticsearch { hosts => ["my-elasticsearch-domain.us-west-2.es.amazonaws:80"] index => "index-name" docinfo => true } } filter { mutate { remove_field => [ "@version", "@timestamp" ] } # add other transformations here } output { elasticsearch { hosts => ["my-elasticsearch-domain.us-west-2.es.amazonaws:80"] manage_template => false index => "%{[@metadata][_index]}" document_type => "%{[@metadata][_type]}" document_id => "%{[@metadata][_id]}" } }

更多推荐

不允许为Elasticsearch重新编制索引?

本文发布于:2023-11-28 16:17:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1643096.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不允许   索引   Elasticsearch

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!