当前位置:   article > 正文

【elasticsearch6.8.6】elasticsearch开启集群验证步骤_xpack.security.transport.ssl.keystore.path

xpack.security.transport.ssl.keystore.path

    以下步骤都是基于centos7、elasticsearch-6.8.6.tar.gz版本下的集群已经正确启动后的操作。

    1.生成ca文件,bin/elasticsearch-certutil ca,可以指定文件名,配置密码

    2.生成节点秘钥文件,bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12,可以指定文件名,配置密码

    3.复制节点秘钥文件到各节点的指定目录下,具体哪个目录是由elasticsearch.yml中的配置项xpack.security.transport.ssl.keystore.path、xpack.security.transport.ssl.truststore.path指定

    3.1.如果指定了秘钥文件密码,需要执行以下两条命令(不执行启动会报错,所有节点都要执行)

  1. bin/elasticsearch-keystore add xpack.security.transport.ssl.keystore.secure_password
  2. bin/elasticsearch-keystore add xpack.security.transport.ssl.truststore.secure_password

   4.增加elasticsearch.yml配置

  1. xpack.security.enabled: true
  2. xpack.security.transport.ssl.enabled: true
  3. xpack.security.transport.ssl.verification_mode: certificate
  4. xpack.security.transport.ssl.keystore.path: certs/elastic-certificates.p12
  5. xpack.security.transport.ssl.truststore.path: certs/elastic-certificates.p12

    5.重启es集群

    6.设置密码bin/elasticsearch-setup-passwords interactive

    7.测试访问

  1. # 不加密访问(失败)
  2. curl 192.168.113.197:9202/_cluster/health?pretty
  3. # 加密访问(成功)
  4. curl -u elastic:elastic 192.168.113.197:9202/_cluster/health?pretty

参考:https://blog.csdn.net/u011271894/article/details/99626711

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/正经夜光杯/article/detail/953623
推荐阅读
相关标签
  

闽ICP备14008679号