admin管理员组

文章数量:1624786

ES默认是不需要认证的,可以直接访问,但是这样不安全; 需要为其添加认证;

认证设置方式取自:Elasticsearch 7.8 开启用户名密码认证 - Kevin_zheng - 博客园

在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

重启ES服务后通过命令:bin/elasticsearch-setup-passwords interactive进行设置密码;

需要设置 elastic,apm_system,kibana,kibana_system,logstash_system,beats_system,remote_monitoring_user 这些账户的密码,密码可以重复;

另:

设置完成之后,Kibana需要修改设置才可以连上;否则当设置完密码之后,启动Kibana会报错:

[2021-11-15T15:33:27,803][INFO ][o.e.x.s.a.AuthenticationService] [A03-R28-I33-232-JCFB742.JD.LOCAL] Authentication of [kibana] was terminated by realm [reserved] - failed to authenticate user [kibana]
[2021-11-15T15:33:30,305][INFO ][o.e.x.s.a.AuthenticationService] [A03-R28-I33-232-JCFB742.JD.LOCAL] Authentication of [kibana] was terminated by realm [reserved] - failed to authenticate user [kibana]

添加如下设置

#elasticsearch.username: "kibana_system"
#elasticsearch.password: "pass"

username填的是kiana的,默认用户名: kibana

本文标签: es