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"
相关推荐
Kobebryant-Manba3 分钟前
C/S和B/S结构
运维·服务器
Flynn Liang14 分钟前
内存/Redis/PGVector/Milvus/ES 怎么选?Spring AI VectorStore 抽象与向量库选型对照表
redis·elasticsearch·milvus·rag·springai·pgvector·向量库
jimmyleeee1 小时前
Agent安全之七:当智能体之间开始“互相信任”------深入理解 OWASP ASI07 不安全的智能体间通信
人工智能·安全
AI_Lab012 小时前
宝塔用了两年,有没有必要换成轻量方案?
linux·运维·服务器
众壹新能源科技2 小时前
逆变器直流开关柜温度监测与预防:红外巡检发现3个120度热点
运维·人工智能·自动化
by209992 小时前
Linux GDB 调试与 CGDB 使用
linux·运维·服务器·经验分享
卓豪终端管理2 小时前
终端零信任落地实践:应用控制与权限管理的五层管控体系
安全·web安全
深蓝AI2 小时前
一个版本号失守:Claude Code 2.1.313 扩展后门事件,开发者机器如何变成别人的 SSH 入口
安全·程序员
小Ti客栈2 小时前
Netty 零拷贝原理与实战
运维·服务器·网络
ai_coder_ai2 小时前
AIOps 智能运维架构设计及其应用
运维