我已经设置了我的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重新编制索引?
发布评论