通过命令行更新AWS Elasticsearch设置时出错

时间:2017-05-12 15:36:59

标签: amazon-web-services elasticsearch

我正在尝试更新AWS Elasticsearch实例的设置。我的命令是:

curl -XPUT "https://<index-endpoint>.es.amazonaws.com/_settings" -d @/path/to/settings.json

我收到以下回复:

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

我已经读过ES的AWS实例并不接受所有ES命令,但是我找不到我正在做的事情的替代方案。

注意:

我的设置如下:

{
    "index" : {
        "number_of_shards" : "5",
        "number_of_replicas" : "1",
        "analysis": {
            "analyzer": {
                "urls-links-emails": {
                    "type": "custom",
                    "tokenizer": "uax_url_email"
                }
            }
        }
    }
}

1 个答案:

答案 0 :(得分:2)

您需要将这些设置应用于特定索引,因此您的端点需要类似https://<index-endpoint>.es.amazonaws.com/myindex/_settings

更具体地说,你的命令必须是这样的:

curl -XPUT https://<index-endpoint>.es.amazonaws.com/myindex/_settings --data-binary @/path/to/settings.json