1、修改elasticsearch.yml文件,重启ES
#允许head插件等访问的相关设置
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type
http.cors.allow-credentials: true
#是否启用es的安全设置,启用安全设置后es各节点、客户端的传输都会加密,并需要账号密码
xpack.security.enabled: true
#此项不可更改,当启用安全设置后,此项必须为true
xpack.security.transport.ssl.enabled: true
2、找到对应的命令设置默认用户密码
./bin/elasticsearch-setup-passwords interactive
标签:http,设置,enabled,认证,elasticsearch,7.4,cors,true
From: https://www.cnblogs.com/gaoyanbing/p/17361471.html