【发布时间】:2017-11-06 05:26:32
【问题描述】:
我为 elasticsearch 安装了 Xpack,并尝试更改密码,如下所示: https://www.elastic.co/guide/en/x-pack/current/security-getting-started.html
运行这个:
curl -XPUT -u elastic localhost:9200/_xpack/security/user/elastic/_password -H Content-Type: application/json -d {"password" : "elasticpassword"}
正在吸引我:
{"error":{"root_cause":[{"type":"json_parse_exception","reason":"Unexpected character ('p' (code 112)): was expecting double-quote to start field name\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@4a142671; line: 1, column: 3]"}],"type":"json_parse_exception","reason":"Unexpected character ('p' (code 112)): was expecting double-quote to start field name\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@4a142671; line: 1, column: 3]"},"status":500}curl: (6) Could not resolve host: application curl: (3) Bad URL, colon is first character curl: (3) [globbing] unmatched close brace/bracket in column 16
或者,运行这个:
curl -XPUT -u elastic "localhost:9200/_xpack/security/user/elastic/_password" -H "Content-Type: application/json -d {"password" : "elasticpassword"}
给我这个:
{"error":{"root_cause":[{"type":"not_x_content_exception","reason":"Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"}],"type":"not_x_content_exception","reason":"Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"},"status":500}
我似乎无法理解它,无论我使用的是 " 或 ' 的什么组合。请帮助!
谢谢
【问题讨论】:
-
你用的是windows cmd吗?
-
试试这个:
curl -XPUT -u elastic localhost:9200/_xpack/security/user/elastic/_password -H "Content-Type: application/json" -d "{\"password\" : \"elasticpassword\"}" -
该死!有效!非常感谢!
-
我可以添加响应吗?因为我想关联一些链接,所以我想这是 Windows 用户的普遍问题。
标签: elasticsearch