【问题标题】:elasticsearch xpack - Can’t change default passwordelasticsearch xpack - 无法更改默认密码
【发布时间】: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


【解决方案1】:

这是 Windows 用户的普遍问题。您可以改用 Sense Chrome 插件或 Kibana 开发工具。

curl -XPUT -u elastic localhost:9200/_xpack/security/user/elastic/_password -H "Content-Type: application/json" -d "{\"password\" : \"elasticpassword\"}"

请查看弹性开发人员对此情况的回复: https://discuss.elastic.co/t/index-a-new-document/35281/8

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-05-19
    • 1970-01-01
    • 2020-10-20
    • 1970-01-01
    • 1970-01-01
    • 2021-02-18
    • 2010-09-17
    • 2018-06-17
    相关资源
    最近更新 更多