【问题标题】:failed to authenticate user [elastic]无法对用户进行身份验证 [弹性]
【发布时间】:2021-01-29 10:54:56
【问题描述】:

在将两个线添加到 elacticsearch.yml 之前,我的 ELK 堆栈运行良好:

http.cors.allow-methods: OPTIONS, HEAD, GET, POST, PUT, DELETE
http.cors.allow-headers: kbn-version, Origin, X-Requested-With, Content-Type, Accept, Engaged-Auth-Token

重启 elastic 和 kibana 后,我收到以下错误消息给用户 Kibana 和 elastic:

[INFO ][o.e.x.s.a.AuthenticationService] [myserver] Authentication of [kibana] was terminated by realm [reserved] - failed to authenticate user [kibana]

删除添加到 elasticsearch.yml

的行后,问题仍然存在

我最初的 elasticsearch.yml

path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch

# Set the bind address to a specific IP (IPv4 or IPv6):
#@ IP
network.host: 10.xx.xx.xx
http.port: 9200
xpack.security.enabled: true
xpack.watcher.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: /etc/elasticsearch/elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: /etc/elasticsearch/elastic-certificates.p12

repositories.url.allowed_urls: "http://10.xx.xx.xx/home/User"
http.cors.enabled: true
http.cors.allow-origin: "*"

我看到一些论坛谈论丢失 .security 索引(重新启动弹性时)

下面是使用 curl 请求的弹性状态:

[root@myserver elasticsearch]# curl -XGET 'http://10.x.x.x:9200/_cluster/state?pretty'
{
  "error" : {
    "root_cause" : [
      {
        "type" : "security_exception",
        "reason" : "missing authentication credentials for REST request [/_cluster/state?pretty]",
        "header" : {
          "WWW-Authenticate" : "Basic realm=\"security\" charset=\"UTF-8\""
        }
      }
    ],
    "type" : "security_exception",
    "reason" : "missing authentication credentials for REST request [/_cluster/state?pretty]",
    "header" : {
      "WWW-Authenticate" : "Basic realm=\"security\" charset=\"UTF-8\""
    }
  },
  "status" : 401
}

您对这个问题有什么想法吗? 提前致谢

【问题讨论】:

    标签: elasticsearch kibana elasticsearch-x-pack


    【解决方案1】:

    我怀疑您还有其他问题,但要在启用 xpack.security 时通过 curl 获得响应,您还必须像这样传递身份验证详细信息:

    curl -XGET --user elastic:changeme 'http://10.x.x.x:9200/_cluster/state?pretty'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-26
      • 2016-11-01
      • 2011-08-04
      • 1970-01-01
      • 2021-08-10
      相关资源
      最近更新 更多