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

相关推荐
算力魔方AIPC2 小时前
如何用算力魔方4060安装PaddleOCR MCP 服务器
运维·服务器
Ray Song2 小时前
【Linux】 wget、curl 用法区别
linux·运维·服务器·curl·wget
小妖6663 小时前
本地文件夹即时变身 Web 服务器(文件服务器)
运维·服务器
qq_364371724 小时前
Docker 常见命令
运维·docker·容器
VVVVWeiYee7 小时前
TCP/UDP详解(一)
运维·网络·tcp/ip·udp·信息与通信
谢尔登7 小时前
【计算机网络】 IPV4和IPV6区别
运维·服务器·计算机网络
努力努力再努力wz8 小时前
【c++进阶系列】:万字详解多态
java·linux·运维·开发语言·c++
杭州泽沃电子科技有限公司8 小时前
工业环境电缆火灾预防的分布式光纤在线监测
运维·人工智能·科技·安全
zzz.108 小时前
Linux问答题:调优系统性能
linux·运维·云原生
Lovyk8 小时前
完整实验命令解析:从集群搭建到负载均衡配置
linux·运维·服务器