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的更多信息.

相关文章

Docker 可以让开发者打包他们的应用以及依赖包到一个轻量级、可移植的容器中,然后发布到任何流行的 Li...
1、什么是docker?答:docker是开源的应用容器引擎;开发人员把他们的应用及依赖包打包发布到容器当中。...
1、什么是namespace? 答:名称空间,作用隔离容器 2、namespace隔离有那些? 答:ipc:共享内存、消息队...
1、Docker能在非Linux平台(Windows+MacOS)上运行吗? 答:可以 2 、如何将一台宿主机的docker环境...
环境要求: IP hostname 192.168.1.1 node1 项目规划: 容器网段:172.16.10.0/24 NGINX:172.16.10.10...
文档上传地址:https://files.cnblogs.com/files/lin-strive/07-docker%E8%B7%A8%E4%B8%BB%E6%9C%BA%E7...