06、ElasticStack系列,第六章:elasticsearch设置密码

第六章:Elasticsearch设置密码

一、修改配置文件

xml 复制代码
##进入容器
docker exec -it elasticsearch bash

##启用认证
vi config/elasticsearch.yml
添加如下内容:
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: Authorization
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true

##重启容器
docker restart elasticsearch

二、设置用户密码

xml 复制代码
##重启容器后,再次进入容器
docker exec -it elasticsearch /bin/bash
##执行一下命令
./bin/elasticsearch-setup-passwords interactive

##会 出现如下内容:
出现:Initiating the setup of passwords for reserved users elastic,apm_system,kibana,logstash_system,beats_system,remote_monitoring_user.
You will be prompted to enter passwords as the process progresses.
Please confirm that you would like to continue [y/N]

##输入y  挨个输入密码即可

Please confirm that you would like to continue [y/N]y


Enter password for [elastic]: 
Reenter password for [elastic]: 
Enter password for [apm_system]: 
Reenter password for [apm_system]: 
Enter password for [kibana]: 
Reenter password for [kibana]: 
Enter password for [logstash_system]: 
Reenter password for [logstash_system]: 
Enter password for [beats_system]:

Reenter password for [beats_system]: 
Enter password for [remote_monitoring_user]: 
Reenter password for [remote_monitoring_user]: 
Changed password for user [apm_system]
Changed password for user [kibana]
Changed password for user [logstash_system]
Changed password for user [beats_system]
Changed password for user [remote_monitoring_user]
Changed password for user [elastic]


##重启容器
docker restart elasticsearch

三、验证

xml 复制代码
http://192.168.73.107:9200/


相关推荐
AI职业加油站6 小时前
2026大数据运维行业趋势复盘:大数据运维工程师赋能发展
大数据·运维·人工智能·学习·数据分析·职场发展
GlobalInfo7 小时前
34.2%年复合增长率背后,AI量子计算市场规模影响因素会是什么?
大数据·人工智能·量子计算
kaoa0007 小时前
Linux入门攻坚——89、Hadoop-1-架构及概念
大数据·linux·hadoop·分布式
onthe_wing7 小时前
flink窗口与水位线详解
大数据·flink
RisunJan7 小时前
DeepSeek 全景技术指南:从混合推理架构到提示语工程实战(2026.09)
大数据·人工智能·架构
Elasticsearch7 小时前
将 Vercel 数据导入 Elastic:无需安装任何东西的无服务器可观测性
elasticsearch
2503_931712487 小时前
具身机器人和人形机器人的区别是什么?两者是否有什么关系
大数据
长谷深风1117 小时前
Checkpoint设计的三大生死关
大数据·人工智能·ai·大模型·ai智能体·tool·aiagent
BYSJMG7 小时前
计算机毕业设计选题推荐:基于大数据的水质多指标关联分析与可视化的设计与实现,Spark 加 K-Means 做水质分群
大数据·hadoop·信息可视化·数据分析·spark·kmeans·课程设计
龙亘川7 小时前
数字化建设案例|构建议案履职一体化闭环,解决议案建议办理多主体协同难题
大数据·人工智能·科技·信息可视化·智慧城市