• Elasticsearch启动https访问


    Elasticsearch上操作

    前提:已设置密码访问

    ./bin/elasticsearch-certutil ca # 生成elastic-stack-ca.p12文件
    
    ./bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12 # 生成elastic-certificates.p12文件,供elasticsearch使用
    
    openssl pkcs12 -in elastic-stack-ca.p12 -out newfile.crt.pem -clcerts -nokeys # 生成newfile.crt.pem文件,供kibana和filebeat使用,复制到各自对应目录下
    
    ./bin/elasticsearch-certutil cert --pem elastic-stack-ca.p12 # 生成certificate-bundle.zip文件,包含ca/ca.crt,instance/instance.crt,instance/instance.key
        Archive:  certificate-bundle.zip
           creating: ca/
          inflating: ca/ca.crt               
           creating: instance/
          inflating: instance/instance.crt   
          inflating: instance/instance.key 
    
    
    

    elasticsearch.yml配置文件操作

    xpack.security.enabled: true
    
    xpack.security.http.ssl.enabled: true
    xpack.security.http.ssl.keystore.path: /home/vdb1/new_es/elasticsearch-7.3.0/config/elastic-certificates.p12
    xpack.security.http.ssl.truststore.path: /home/vdb1/new_es/elasticsearch-7.3.0/config/elastic-certificates.p12
    
    xpack.security.transport.ssl.enabled: true
    xpack.security.transport.ssl.verification_mode: certificate
    xpack.security.transport.ssl.keystore.path: /home/vdb1/new_es/elasticsearch-7.3.0/config/elastic-certificates.p12
    xpack.security.transport.ssl.truststore.path: /home/vdb1/new_es/elasticsearch-7.3.0/config/elastic-certificates.p12
    

    kibana上操作

    kibana.yml配置文件操作

    elasticsearch.hosts: ["https://localhost:9200"] # 注意https
    elasticsearch.ssl.verificationMode: none
    elasticsearch.ssl.certificateAuthorities: ["/home/vdb1/new_es/kibana-7.3.0/config/newfile.crt.pem"]
    
    elasticsearch.username: "kibana"
    elasticsearch.password: "1io0K4VS7nkxpGwGwzHg"
    

    filebeat上操作

    filebeat.yml配置文件操作

    注意:方法一和方法二使用的证书文件不一样,生成方式详见上述步骤

    # 方法一
    output.elasticsearch:
      hosts: ["localhost:9200"]
      protocol: "https"
      ssl.verification_mode: none
      ssl.certificate_authorities: ["/home/vdb1/new_es/filebeat-7.3.0-linux-x86_64/newfile.crt.pem"]
      username: "elastic"
      password: "x8w2B6OcO3W"
    
    # 方法二
    output.elasticsearch:
      hosts: ["localhost:9200"]
      protocol: "https"
      ssl.verification_mode: none
      ssl.certificate_authorities: ["/home/vdb1/new_es/filebeat-7.3.0-linux-x86_64/ca.crt"]
      username: "elastic"
      password: "x8w2B6ObcO3W"
    
  • 相关阅读:
    servlet 表单加上multipart/form-data后request.getParameter获取NULL(已解决)
    火狐浏览器通过配置文件锁定主页
    如何最快速的完成智慧树期末考试(有钱的大佬请绕道)记----智慧树考试生产力
    java代码发送邮箱验证码与qq邮箱smtp服务
    邮件服务器
    Android requestcode resultcode的作用
    伽卡拉他学生客户端无法运行任务管理器的解决方法
    Django自定义UserModel并实现认证和登录
    {%csrf_token%}的作用
    Producer Flow Control 和 vmQueueCursor
  • 原文地址:https://www.cnblogs.com/sanduzxcvbnm/p/12654166.html
Copyright © 2020-2023  润新知