ES7.8 设置 xpack

单节点 xpack 配置


修改 ES 配置文件,开启 Security
  • 默认文件:./config/elasticsearch.yml
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
  • 配置修改完之后重启 ES。
设置内置用户密码
./bin/elasticsearch-setup-passwords interactive
修改 Kibana 配置文件,访问 ES
  • 默认文件:$KIBANA_HOME/config/kibana.yml
elasticsearch.username: "elastic"
elasticsearch.password: "elastic"
xpack.security.enabled: true
xpack.security.encryptionKey: "4297f44b13955235245b2497399d7a93" 
  • 重启 Kibana,重新登录。

ES 集群 xpack 配置


官方文档:https://www.elastic.co/guide/en/elasticsearch/reference/master/configuring-tls.html

为 ES 集群创建节点认证中心
./bin/elasticsearch-certutil ca
  • 可以设置一个密码,也可以直接回车。
  • 默认文件会在 ES 根目录产生,名为 elastic-stack-ca.p12
  • 然后可以将文件 elastic-stack-ca.p12 复制到每个 ES 节点的根目录下。
为集群中的每个节点创建证书和私钥(每个节点都要执行以下内容)
  • 生成证书和密钥。
./bin/elasticsearch-certutil cert --ca ./elastic-stack-ca.p12
  • 可以设置密码,也可以直接回车。
  • 默认会生成文件 elastic-certificates.p12
  • 将生成的文件复制到配置文件目录下:
mv ./elastic-stack-ca.p12 ./config/
修改 ES 配置文件
  • 默认文件: ./config/elasticsearch.yml
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12
如果之前节点证书设置了密码,将密码添加到 keystore
./bin/elasticsearch-keystore add xpack.security.transport.ssl.keystore.secure_password
./bin/elasticsearch-keystore add xpack.security.transport.ssl.truststore.secure_password
重启 ES 集群。
设置内置用户密码
./bin/elasticsearch-setup-passwords interactive
修改 Kibana 配置文件,访问 ES
  • 默认文件:$KIBANA_HOME/config/kibana.yml
elasticsearch.username: "elastic"
elasticsearch.password: "elastic"
xpack.security.enabled: true
xpack.security.encryptionKey: "4297f44b13955235245b2497399d7a93" 
  • 重启 Kibana,重新登录。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值