docker – elasticsearch的默认用户和密码是什么?

我有installed Elastic with Docker

docker run -p 9200:9200 \
           -p 9300:9300 \
           -e "discovery.type=single-node" \ 
           docker.elastic.co/elasticsearch/elasticsearch:5.6.2

但curl localhost:9200失败并出现身份验证错误:

{
  "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","header": {
      "WWW-Authenticate": "Basic realm=\"security\" charset=\"UTF-8\""
    }
  },"status": 401
}

Elasticsearch的默认用户名/密码组合是什么?

最佳答案
Defaults are

user: elastic
password: changeme

所以:

$curl -u elastic:changeme localhost:9200
{
  "name" : "5aEHJ-Y","cluster_name" : "docker-cluster","cluster_uuid" : "3FmaYN7rS56oBTqWOyxmKA","version" : {
    "number" : "5.6.2","build_hash" : "57e20f3","build_date" : "2017-09-23T13:16:45.703Z","build_snapshot" : false,"lucene_version" : "6.6.1"
  },"tagline" : "You Know,for Search"
}

了解有关更改默认值here的更多信息.

相关文章

文章浏览阅读8.8k次,点赞2次,收藏7次。本文介绍Docker Com...
文章浏览阅读1.5w次,点赞7次,收藏76次。原网提供的教程需要...
文章浏览阅读940次,点赞20次,收藏20次。通过 docker run 命...
文章浏览阅读1k次,点赞20次,收藏20次。Podman 是一个开源的...
文章浏览阅读2.1k次。请注意,这些命令需要在 Docker 主机上...
文章浏览阅读1.1k次,点赞37次,收藏40次。nacos搭建集群连接...