【问题标题】:What is the default user and password for Elasticsearch 7.8.0?Elasticsearch 7.8.0 的默认用户名和密码是什么?
【发布时间】:2020-12-03 23:14:44
【问题描述】:

Elasticsearch 7.8.0 的默认用户名和密码是什么?它在 9200 端口上问这个。尝试了这些(用户名密码):

  • 弹性 [未通过]
  • 弹力弹力
  • 无需输入任何内容
  • 弹性变化
  • 弹性密码
  • 用户密码

操作系统:Windows 10 x64,从其网站安装 ES 和 MSI 安装程序。

yml 文件:

bootstrap.memory_lock: false
cluster.name: elasticsearch
http.port: 9200
node.data: true
node.ingest: true
node.master: true
node.max_local_storage_nodes: 1
node.name: LAPTOP-1C4GVFSU
path.data: C:\ProgramData\Elastic\Elasticsearch\data
path.logs: C:\ProgramData\Elastic\Elasticsearch\logs
transport.tcp.port: 9300
xpack.license.self_generated.type: basic
xpack.security.enabled: true

【问题讨论】:

  • @Bhavya 感谢您的反馈!声望低于 15 人的投票将被记录,但不会更改公开显示的帖子得分。

标签: elasticsearch


【解决方案1】:

不知何故,默认用户名密码不起作用。我必须通过

在 CMD 上设置密码
bin/elasticsearch-setup-passwords interactive

bin/elasticsearch-setup-passwords auto

interactive 参数提示用户输入新密码,而auto 为您生成密码。

【讨论】:

    【解决方案2】:

    用户名为elastic,密码为password

    1. 如果您尝试调试Elasticsearch Source Code,则在运行./gradlew :run 之后,ES 开始构建并运行。

    服务启动后,从另一个窗口运行此 curl 命令:

    curl -u elastic:password localhost:9200
    

    然后添加上面提到的用户名和密码。要了解更多信息,请参阅CONTRIBUTING.md

    1. 也有可能,您只将xpack.security.enabled 设置添加到ES_PATH_CONF/elasticsearch.yml 文件中。

    之后如果您尝试点击localhost:9200,它会询问用户名和密码(因为您已启用安全功能)。但是由于你没有设置用户名和密码,所以会抛出security_exception(输入错误的用户名和密码时)。

    因此,为此,运行bin/elasticsearch-setup-passwords interactive,并设置用户名和密码。

    请参阅此文档以获取 Setting built-in user and password

    【讨论】:

    • 我无法使用弹性登录:密码如果我输入它们。它显示与“此站点说:安全”{“错误”:{“root_cause”:[{“type”:“security_exception”,“reason”:“无法对REST请求的用户[弹性]进行身份验证[/]相同的形式","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}}],"type":"security_exception","re​​ason":"unable为 REST 请求验证用户 [elastic] [/]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}},"status" :401}
    • C:\Users\etosu>curl -u elastic:password localhost:9200 {"error":{"root_cause":[{"type":"security_exception","re​​ason":"unable为 REST 请求验证用户 [elastic] [/]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}}],"type ":"security_exception","re​​ason":"无法为 REST 请求验证用户 [elastic] [/]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\" UTF-8\""}},"status":401}
    • @emretosunkaya 你有没有尝试使用 elasticsearch-setup-passwords 工具来为 elastic 的内置用户生成/设置密码,通过运行这个bin/elasticsearch-setup-passwords interactive
    • @emretosunkaya 你在尝试运行 ES 源代码吗? (b/c 只询问用户名和密码 --> 你必须知道默认用户名和密码)。否则,如果您刚刚安装了elasticsearch,那么当您的用户名和密码不正确时,security_exception 将出现,您已使用上述命令将其设置为交互模式。
    • @emretosunkaya 你是在尝试运行和调试 ES 源代码还是只是在运行 ES 服务?
    【解决方案3】:

    检查/etc/nginx/ 以获得nginx.con 文件和nginx passwd 文件。 ElasticSearch 使用简单的 Nginx passwd 文件和默认实例的基本身份验证。

    【讨论】:

      猜你喜欢
      • 2018-03-19
      • 2016-12-19
      • 2016-02-08
      • 2018-04-17
      • 2011-04-19
      • 2014-09-18
      • 2020-04-11
      • 2023-03-23
      • 1970-01-01
      相关资源
      最近更新 更多