跳至主要內容

[elastsearch] missing authentication token for REST request

没想到这次却出问题了,有如下输出:

{
  "error": {
    "root_cause": [
      {
        "type": "security_exception",
        "reason": "missing authentication token for REST request [/]",
        "header": {
          "WWW-Authenticate": "Basic realm=\"security\" charset=\"UTF-8\""
        }
      }
    ],
    "type": "security_exception",
    "reason": "missing authentication token for REST request [/]",
    "header": {
      "WWW-Authenticate": "Basic realm=\"security\" charset=\"UTF-8\""
    }
  },
  "status": 401
}

嗯,是安全类型异常 security_exception,REST 请求中没有 WWW-Authenticate 请求头,认证失败,也就是说,默认需要密码了。
官网描述如下:

X-Pack is preinstalled in this image. Please take a few minutes to familiarize yourself with X-Pack Security and how to change default passwords. The default password for the elastic user is changeme.
X-Pack includes a trial license for 30 days. After that, you can obtain one of the available subscriptions or disable Security. The Basic license is free and includes the Monitoring extension.

5.0.0 及以上版本 Elasticsearch 中默认预安装使用了 X-Pack 组件,可以 30 天免费试用,过期之后,基础的功能和监视扩展组件可以继续免费试用。具体可查看官方文档介绍:X-Pack for the Elastic Stack
那如何取消禁用 X-Pack 插件呢?
在 elasticsearch.yml 中添加如下配置:
xpack.security.enabled: false
missing authentication token for REST request

分類:elastsearch
由 Compete Themes 設計的 Author 佈景主題