docker运行elastic和kibana,并使用密码连接

1. elasticsearch

  • 运行容器
bash 复制代码
docker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:7.7.0 
  • 进入容器
bash 复制代码
docker exec -it elasticsearch bash
  • 修改配置开启密码校验
bash 复制代码
vi ./conf/elasticsearch.yml
  • 添加以下内容
bash 复制代码
xpack.security.enabled: true
xpack.license.self_generated.type: basic
xpack.security.transport.ssl.enabled: true
  • 退出容器
bash 复制代码
exit 
  • 重启容器
bash 复制代码
docker restart elasticsearch 
  • 进入容器
bash 复制代码
docker exec -it elasticsearch bash
  • 生成自定义密码
bash 复制代码
./bin/elasticsearch-setup-passwords interactive
  • 退出容器
bash 复制代码
exit 
  • 访问以下链接 ,输入账号和密码
    http://ip:9200
    ps: ip修改为自己的虚机ip

2. kibana

  • 运行容器
bash 复制代码
docker run --name kibana -d --link elasticsearch:elasticsearch -p 5601:5601 kibana:7.7.0

ps: elasticsearch:elasticsearch中的前者为容器名称

  • 进入容器
bash 复制代码
docker exec -it kibana bash
  • 修改配置,设置elasticsearch的密码
bash 复制代码
vi ./config/kibana.yml
  • 添加以下内容
bash 复制代码
server.name: kibana
server.host: "0.0.0.0"
elasticsearch.hosts: [ "http://elasticsearch:9200" ]
monitoring.ui.container.elasticsearch.enabled: true
elasticsearch.username: "elastic"
elasticsearch.password: "123456"
i18n.locale: "zh-CN"

ps: password修改为elasticsearch的密码

  • 退出容器
bash 复制代码
exit
  • 重启容器
bash 复制代码
docker restart kibana
  • 访问以下链接 ,输入账号和密码
    http://ip:5601
    ps: ip修改为自己的虚机ip
相关推荐
管理大亨3 小时前
ELK + Redis Docker 企业级部署落地方案
大数据·运维·elk·elasticsearch·docker·jenkins
全栈小54 小时前
【数据库】浙人医携手金仓数据库,打造全国首个多院区异构多活容灾架构
数据库·1024程序员节·金仓
悟空码字5 小时前
SpringBoot 整合 ElasticSearch,给搜索插上“光速翅膀”
java·后端·elasticsearch
Elasticsearch6 小时前
开始使用 Elastic Agent Builder 和 Strands Agents SDK
elasticsearch
AI逐月7 小时前
Git 停止追踪已提交文件问题
大数据·git·elasticsearch
_默_7 小时前
前端常用依赖归纳【vueuse\lodash-es\dayjs\bignumber】
大数据·前端·elasticsearch
raoxiaoya7 小时前
golang调用 elasticsearch 8,向量检索
开发语言·elasticsearch·golang
Elasticsearch7 小时前
亲爱的圣诞老人,这里有一点小小的帮助,献给圣诞节
elasticsearch
Haooog9 小时前
Elasticsearch (ES) 面试题清单(不定时更新)
大数据·elasticsearch·搜索引擎·面试
武子康1 天前
大数据-184 Elasticsearch Doc Values 机制详解:列式存储如何支撑排序/聚合/脚本
大数据·后端·elasticsearch