我正在尝试在我的Mac上安装ElasticSearch。
我从official website下载了tar并将其解压缩。
然后我运行bin/elastic。之后我打开https://localhost:9200/,当我取消它时,它会显示用户名和密码的输入字段,这会出现:
{
"error": {
"root_cause": [
{
"type": "security_exception",
"reason": "missing authentication credentials for REST request [/]",
"header": {
"WWW-Authenticate": [
"Basic realm=\"security\" charset=\"UTF-8\"",
"Bearer realm=\"security\"",
"ApiKey"
]
}
}
],
"type": "security_exception",
"reason": "missing authentication credentials for REST request [/]",
"header": {
"WWW-Authenticate": [
"Basic realm=\"security\" charset=\"UTF-8\"",
"Bearer realm=\"security\"",
"ApiKey"
]
}
},
"status": 401
}
我没有输入密码或用户名,我看了前面的问题,没有人为我工作。我该怎么办?
注意:当我打开http://localhost:9200/时,它显示:
This page isn’t working localhost didn’t send any data.
ERR_EMPTY_RESPONSE
2条答案
按热度按时间nwnhqdif1#
Tldr;
Elasticsearch似乎会自动创建密码。
你可能想把你自己的
但在
8.x
及更高版本中,它已被弃用。你应该用
hkmswyz62#
如果Elastic Search安装程序在Windows上,那么我遵循以下步骤来解决身份验证问题
1.以管理员身份打开命令提示符
1.转到Elastic搜索解压缩文件夹bin路径
cd elasticsearch-bin-folderpath
bin>elasticsearch-users useradd username -p password -r superuser
bin>elasticsearch
在浏览器中打开
https:localhost:9200/
当提示输入用户名和密码时给予useradd命令后设置的用户名和密码