我在想我为什么要拿到401。
采取的步骤:
创建了elasticsearch.keystore
添加 bootstrap.password
成功,与 cat ~/.elk.secret | /opt/elasticsearch/bin/elasticsearch-keystore add -x 'bootstrap.password'
因为我运行了多个示例,所以我将它移到新的conf目录中
但现在我得到了401:
curl -X GET 'https://elastic:myFancyPass@myServer:9200/_cluster/health?pretty' -k
{
"error" : {
"root_cause" : [
{
"type" : "security_exception",
"reason" : "unable to authenticate user [elastic] for REST request [/_cluster/health?pretty]",
"header" : {
"WWW-Authenticate" : [
"Bearer realm=\"security\"",
"ApiKey",
"Basic realm=\"security\" charset=\"UTF-8\""
]
}
}
],
"type" : "security_exception",
"reason" : "unable to authenticate user [elastic] for REST request [/_cluster/health?pretty]",
"header" : {
"WWW-Authenticate" : [
"Bearer realm=\"security\"",
"ApiKey",
"Basic realm=\"security\" charset=\"UTF-8\""
]
}
},
"status" : 401
}
我的理解是,这个错误可能是由两个原因造成的:
密码错误(我怀疑这是我的情况)
错误的elasticsearch.file
如何找到正在加载的elasticsearch.keystore?
跑步 rootLogger.level = debug
没用。我觉得得到这样的确认会很好 /opt/elasticsearch/instance2/conf/elasticsearch.keystore
暂无答案!
目前还没有任何答案,快来回答吧!