ES 启用x-pack安全验证

1 启用 trial license

curl -H "Content-Type:application/json" -XPOST  http://192.168.163.128:9200/_xpack/license/start_trial?acknowledge=true

2 设置用户名密码

/usr/local/elasticsearch-6.3.0/bin/elasticsearch-setup-passwords interactive

会依次修改kibana logstash_system beats_system elastic 的密码

3 elasticsearch.yml中添加

http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type
xpack.security.enabled: true

4 kibana.yml中添加

elasticsearch.username: "elastic"
elasticsearch.password: "111111"
xpack.security.enabled: true
xpack.security.encryptionKey: "4297f44b13955235245b2497399d7a93"//这个key随便写

重启elasticsearch kibana再访问http://192.168.163.128:5601就需要输入密码了

5 es-head访问方式

http://192.168.969.888:9100/?auth_user=elastic&auth_password=you_pass

6 修改密码

curl -H "Content-Type:application/json" -XPOST -u elastic 'http://192.168.111.222:9200/_xpack/security/user/elastic/_password' -d '{ "password" : "111111" }' 

7 php操作时也要配置账号密码才可以了

'elasticsearch' => [
        [
            'host' => '192.168.111.222',
            'port' => '9200',
            'scheme' => 'http',
            'user' => 'elastic',
            'pass' => '111111'
        ],
    ],
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容