1.进入es安装目录下的config目录
elasticsearch.yml
配置X-Pack
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: Authorization
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
2.重启elasticsearch服务
3.执行设置用户名和密码的命令
需要为4个用户分别设置密码:elastic、kibana、logstash_system、beats_system
linux
1.进入bin目录
cd /usr/local/elasticsearch-7.2.0/bin
2.执行命令
./elasticsearch-setup-passwords interactive
windows
1.打开cmd
2.进入bin目录
3.执行命令
elasticsearch-setup-passwords interactive
4.浏览器输入 ip:9200 测试
参考链接:
https://www.cnblogs.com/xhq1024/p/12844654.html
https://blog.csdn.net/q283614346/article/details/120698788
https://zhuanlan.zhihu.com/p/447155597