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
相关推荐
liu_sir_7 小时前
升级谷歌webview
大数据·elasticsearch·搜索引擎
Elastic 中国社区官方博客12 小时前
Elasticsearch 下采样方法:最后值采样 vs. 聚合采样
大数据·运维·elasticsearch·搜索引擎·全文检索
Andya_net15 小时前
Git | Git 核心命令深入解析:从原理到实战
大数据·git·elasticsearch
不仙5201 天前
VMware Workstation 26.0.0 在 Ubuntu 24.04 (内核 6.17.0) 上的安装与内核模块编译问题
linux·ubuntu·elasticsearch
qziovv1 天前
Git 回退场景
大数据·git·elasticsearch
ZeroNews内网穿透1 天前
面向 AI 协作的本地客户端能力:ZeroNews Agent Skills
大数据·人工智能·elasticsearch
Elastic 中国社区官方博客1 天前
快 12 倍的 Elasticsearch 向量索引:使用 GPU 和 CPU 分层部署 NVIDIA cuVS
大数据·人工智能·elasticsearch·搜索引擎·ai·全文检索·nvidia
海兰1 天前
【实用应用】React+TypeScript+Next.js博客项目
开发语言·javascript·elasticsearch
乐观的Terry2 天前
博客系统全文搜索实战:用 Elasticsearch 告别 MySQL LIKE 查询
mysql·elasticsearch
敖正炀2 天前
索引写入与数据持久化深度
elasticsearch