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
相关推荐
Elasticsearch1 小时前
Kibana:创建包含时间序列图表的仪表板
elasticsearch
曦夜日长2 小时前
Git系统篇,Git本地使用(一):从“究极进化版“到三个区域的底层原理
大数据·linux·git·elasticsearch
mister_guo10 小时前
Elasticsearch:原理、Docker 安装与常用命令
大数据·运维·elasticsearch
鱼宵14 小时前
LangChain4j 生产化改造:记忆落 Redis、向量落 ES,重启再也不丢
数据库·redis·elasticsearch·langchain4j
小巫山云子14 小时前
Git的用法
大数据·git·elasticsearch
Elasticsearch16 小时前
多租户集群中的 Kubernetes 吵闹邻居:使用 ES|QL 找出它
elasticsearch
Elasticsearch16 小时前
你的 AI 聊天不应只是一张截图:Elastic Agent Builder 中的实时共享对话
elasticsearch
承渊政道17 小时前
CentOS 7单机部署Elasticsearch 7.17.29:从启动报错、CRUD验证到固定公网地址的完整过程
linux·elasticsearch·centos·内网穿透·cpolar·单机部署
Elasticsearch1 天前
Kibana:通过分步教程学习构建仪表板和创建数据可视化图表
elasticsearch
高级程序源2 天前
django房屋租赁系统28636-计算机课程设计、毕业设计
python·mysql·elasticsearch·小程序·django·flask·课程设计