目前使用的Es版本为7.5版本, 在7.X版本中已经可以免费的使用x-pack进行用户验证了
1. 修改elasticsearch主节点配置文件:
action.destructive_requires_name: true http.cors.enabled: true http.cors.allow-origin: "*" http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type xpack.security.enabled: true xpack.license.self_generated.type: basic xpack.security.transport.ssl.enabled: true
注意:上面对于跨域的配置,下面使用elasticsearch-head进行连接的时候会用到 使用到的是基础验证类型