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/


相关推荐
lilye661 小时前
精益数据分析(17/126):精益画布与创业方向抉择
大数据·数据挖掘·数据分析
思通数科AI全行业智能NLP系统3 小时前
AI视频技术赋能幼儿园安全——教师离岗报警系统的智慧守护
大数据·人工智能·安全·目标检测·目标跟踪·自然语言处理·ocr
程序员沉梦听雨6 小时前
【Elasticsearch】入门篇
大数据·elasticsearch·搜索引擎
Gadus_6 小时前
Elasticsearch性能优化实践
大数据·elasticsearch·搜索引擎·性能优化
riveting7 小时前
SD2351核心板:重构AI视觉产业价值链的“超级节点”
大数据·linux·图像处理·人工智能·重构·智能硬件
欧先生^_^8 小时前
Spark 的一些典型应用场景及具体示例
大数据·分布式·spark
八股文领域大手子9 小时前
如何给GitHub项目提PR(踩坑记录
大数据·elasticsearch·github
爱吃龙利鱼9 小时前
elk中kibana一直处于可用和降级之间且es群集状态并没有问题的解决方法
大数据·elk·elasticsearch
腾讯云大数据9 小时前
腾讯云ES一站式RAG方案获信通院“开源大模型+软件创新应用”精选案例奖
大数据·elasticsearch·开源·云计算·腾讯云
苍煜9 小时前
Elasticsearch(ES)中的脚本(Script)
大数据·elasticsearch·搜索引擎