如果我有一个elasticsearch.yml配置文件,可以更改默认密码吗?我要在.yml文件中添加些什么呢?现在,它的changeme
。
我正在使用Elasticsearch 5.6.4
我的.yml
文件
cluster.name: "docker-cluster"
network.host: "0.0.0.0"
http.cors.enabled : true
http.cors.allow-origin : "*"
http.cors.allow-methods : "OPTIONS, HEAD, GET, POST, PUT, DELETE"
http.cors.allow-headers : "X-Requested-With, X-Auth-Token, Content-Type, Content-Length, Authorization"
最佳答案
您可以通过API更改密码,如下所示:
POST _xpack/security/user/elastic/_password
{
"password": "whatever"
}
或者,如果您忘记了该密码或类似密码:https://discuss.elastic.co/t/i-lost-the-password-that-has-been-changed/91867/2
但是您无法执行与elasticsearch.yml文件类似的操作。
关于elasticsearch - 使用.yml文件更改Elasticsearch中的默认密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48727826/