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"
相关推荐
Fnetlink118 小时前
零信任网络架构是什么及零信任的发展趋势
安全·web安全
神算大模型APi--天枢64618 小时前
2025 国产算力破局后,大模型训练数据集如何实现 “合规采集 + 高效清洗”?
运维·服务器·人工智能·架构·硬件架构
飞函安全18 小时前
MongoBleed:MongoDB的秘密漏洞
数据库·安全·mongodb
代码游侠18 小时前
学习笔记——sqlite3 数据库基础
linux·运维·网络·数据库·笔记·学习·sqlite
QT 小鲜肉18 小时前
【Linux命令大全】001.文件管理之od命令(实操篇)
linux·运维·服务器·chrome·笔记
珂玥c18 小时前
virsh启用linux虚拟机+忘记密码的操作
linux·运维·服务器
白帽子黑客杰哥18 小时前
Hack The Box和Try Hack Me两个平台在渗透测试训练上各有什么特色?
安全·web安全
2501_9399090518 小时前
Docker(3)
运维·docker·容器
irisart18 小时前
第二章【NGINX 开源功能】—— 四层反向代理
运维·nginx·开源