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"
相关推荐
车载testing5 分钟前
SOME/IP 协议中发送 RR 报文的实践指南
网络·tcp/ip·安全
Coder个人博客10 分钟前
Linux6.19-ARM64 mm ioremap子模块深入分析
linux·安全·车载系统·系统架构·系统安全·鸿蒙系统·安全架构
程序员一点10 分钟前
第4章:Linux 文件系统结构与路径管理
linux·运维·服务器
百***787520 分钟前
Clawdbot 技术实战:基于一步 API 快速接入,打造本地化 AI 自动化助手
运维·人工智能·自动化
EnglishJun21 分钟前
数据结构的学习(二)---Makefile的使用
linux·运维·学习
jl486382131 分钟前
打造医疗设备的“可靠视窗”:医用控温仪专用屏从抗菌设计到EMC兼容的全链路解析
大数据·运维·人工智能·物联网·人机交互
曾几何时`31 分钟前
Docker容器化部署编译运行模块
运维·docker·容器
HalvmånEver34 分钟前
Linux:线程 ID 与地址空间布局:深入理解线程内存分布(线程七)
linux·运维·服务器·操作系统·线程
码农三叔35 分钟前
(9-1)电源管理与能源系统:电池选择与安全
人工智能·嵌入式硬件·安全·机器人·能源·人形机器人
北京阿法龙科技有限公司39 分钟前
工业场景下AR+AI图像识别:精准选型赋能运维与质检
运维·人工智能·ar