ELK集群设置密码

一、软件安装清单

  • elasticsearch7.17.22
  • logstash7.17.22
  • kibana:7.17.22
  • filebeat7.17.22
  • elasticsearch-head:5

二、配置

  1. 生成证书

进入elasticsearch容器

bash 复制代码
bin/elasticsearch-certutil cert -out /usr/share/elasticsearch/config/elastic-certificates.p12 -pass
  1. 将证书拷贝至其他容器后重启集群
  2. 设置密码

进入容器设置密码

bash 复制代码
bin/elasticsearch-setup-passwords interactive
  1. 设置elasticsearch

elasticsearch.yml

bash 复制代码
# 安全认证
xpack.security.enabled: true
xpack.license.self_generated.type: basic
xpack.security.transport.ssl.enabled: true
http.cors.allow-headers: "Authorization"

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
  1. 设置logstash

logstash.yml

bash 复制代码
xpack.monitoring.enabled: true
xpack.monitoring.elasticsearch.username: elastic
xpack.monitoring.elasticsearch.password: xxxxxx

logstash-filebeat.conf

bash 复制代码
output {
    # 选择elasticsearch
    elasticsearch {
        hosts => ["http://es-master:9200"]
        user => "elastic"
        password => "xxxxxx"
        index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
    }
}
  1. 设置kibana

kibana.yml

bash 复制代码
elasticsearch.username: "elastic"
elasticsearch.password: "xxxxxx"
xpack.security.enabled: true
  1. 验证

访问地址 http://kibana服务IP:5601

参考

https://www.elastic.co/guide/en/elasticsearch/reference/7.17/security-basic-setup.html

相关推荐
卡比巴拉—林14 分钟前
HAProxy 实验指南:从零开始搭建高可用负载均衡系统
运维·负载均衡
tanxiaomi26 分钟前
docker 从主机复制文件到容器外进行编辑
运维·docker·容器
七七powerful41 分钟前
sealos 方式安装k8s5节点集群
linux·运维·服务器
小Tomkk1 小时前
AutoLabelImg:高效的数据自动化标注工具和下载
运维·人工智能·自动化
Json____2 小时前
docker搭建部署 onlyoffice 实现前端集成在线解析文档解决方案
运维·docker·容器·在线文档·onlyoffice·文档预览·在线文档解析
basketball6162 小时前
Linux C 进程间高级通信
linux·运维·服务器
是小恐龙啊2 小时前
【测试报告】博客系统(Java+Selenium+Jmeter自动化测试)
运维·服务器
kyle~2 小时前
Windows---动态链接库Dynamic Link Library(.dll)
运维·windows·操作系统·运维开发·开发部署
水痕013 小时前
nginx一个域名下部署多套前端项目
运维·前端·nginx
YCY^v^6 小时前
centos 7 开启80,443端口,怎么弄?
linux·运维·centos