我的elasticsearch 有问题。
我从 https://www.elastic.co/downloads/elasticsearch 下载。我无法打开页面。
当我使用 https://localhost:9200/ 时,我只会看到用于身份验证(用户名和密码)的弹出菜单。你知道如何解决它吗?
当我在 Postman 中访问 localhost:9200 时,我收到如下所示的错误消息。
{
"error": {
"root_cause": [
{
"type": "security_exception",
"reason": "unable to authenticate with provided credentials and anonymous access is not allowed for this request",
"additional_unsuccessful_credentials": "oauth2 token: invalid token",
"header": {
"WWW-Authenticate": [
"Basic realm=\"security\" charset=\"UTF-8\"",
"ApiKey"
]
}
}
],
"type": "security_exception",
"reason": "unable to authenticate with provided credentials and anonymous access is not allowed for this request",
"additional_unsuccessful_credentials": "oauth2 token: invalid token",
"header": {
"WWW-Authenticate": [
"Basic realm=\"security\" charset=\"UTF-8\"",
"ApiKey"
]
}
},
"status": 401
}
Elasticsearch 最新版本(8.0)具有基本的安全性,因此您会看到弹出的身份验证窗口,您需要提供用户名(
elastic
,这是保留名称)和密码(启动服务时打印在 Elasticsearch 日志上) ).
默认用户是
elastic
,密码是自动生成的。您可以使用以下命令重置 elastic
用户密码。
bin/elasticsearch-reset-password --auto
参考资料: