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