Elasticsearch3节点集群配置账号密码安全验证

Elasticsearch3节点集群配置账号密码安全验证

ES配置文件

bash 复制代码
root@node1:~# grep -Ev "^#|^$" /etc/elasticsearch/elasticsearch.yml 
cluster.name: es-pre
node.name: node1
node.master: true
node.data: true
path.data: /data/elk/es/data
path.logs: /data/elk/es/logs
network.host: esIP
http.port: 9200
discovery.seed_hosts: ["node1", "node2", "node3"]
cluster.initial_master_nodes: ["node1", "node2", "node3"]
http.cors.enabled: true
http.cors.allow-origin: "*"
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.client_authentication: required
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12
xpack.monitoring.enabled: true
xpack.monitoring.collection.enabled: true
root@node1:~# 

生成CA证书

bash 复制代码
/usr/share/elasticsearch/bin/elasticsearch-certutil ca
/usr/share/elasticsearch/bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12

拷贝证书文件到es节点目录

bash 复制代码
mv ./elastic-certificates.p12 /etc/elasticsearch

拷贝证书到es节点并授权

bash 复制代码
scp /etc/elasticsearch/elastic-certificates.p12   node3:/etc/elasticsearch/
scp /etc/elasticsearch/elastic-certificates.p12   node2:/etc/elasticsearch/

chown elasticsearch.elasticsearch /etc/elasticsearch/elastic-certificates.p12 

拷贝es配置文件到es节点

bash 复制代码
scp /etc/elasticsearch/elasticsearch.yml node2:/etc/elasticsearch/
scp /etc/elasticsearch/elasticsearch.yml node3:/etc/elasticsearch/

三个节点启动ES

bash 复制代码
systemctl restart elasticsearch.service

登录任一节点设置密码

bash 复制代码
/usr/share/elasticsearch/bin/elasticsearch-setup-passwords interactive

#需要设置密码的用户
	apm_system
	kibana_system
	kibana
	logstash_system
	beats_system
	remote_monitoring_user
	elastic

配置kibana

bash 复制代码
root@node1:~# grep -Ev "^#|^$" /etc/kibana/kibana.yml 
server.port: 5601
server.host: "kibanaIP"
server.publicBaseUrl: "http://kibanaIP"
elasticsearch.hosts: ["http://esIP:9200","http://esIP:9200","http://esIP:9200"]
elasticsearch.username: "kibana_system"
elasticsearch.password: "Your@Passw0rd"
i18n.locale: "zh-CN"
相关推荐
dmy14 分钟前
n8n内网快速部署
运维·人工智能·程序员
程序员JerrySUN22 分钟前
全面理解 Linux 内核性能问题:分类、实战与调优策略
java·linux·运维·服务器·单片机
米粉03051 小时前
深入剖析Nginx:从入门到高并发架构实战
java·运维·nginx·架构
huangyuchi.1 小时前
【Linux】LInux下第一个程序:进度条
linux·运维·服务器·笔记·进度条·c/c++
moongoblin1 小时前
行业赋能篇-2-能源行业安全运维升级
运维·安全·协作
Fortinet_CHINA1 小时前
引领AI安全新时代 Accelerate 2025北亚巡展·北京站成功举办
网络·安全
极简网络科技2 小时前
Docker、Wsl 打包迁移环境
运维·docker·容器
黑客老李2 小时前
JavaSec | SpringAOP 链学习分析
java·运维·服务器·开发语言·学习·apache·memcached
杨浦老苏2 小时前
轻量级Docker管理工具Docker Switchboard
运维·docker·群晖
江湖有缘2 小时前
【Docker管理工具】部署Docker可视化管理面板Dpanel
运维·docker·容器