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
相关推荐
Elasticsearch12 小时前
如何使用 Agent Builder 排查 Kubernetes Pod 重启和 OOMKilled 事件
elasticsearch
Elasticsearch1 天前
通用表达式语言 ( CEL ): CEL 输入如何改进 Elastic Agent 集成中的数据收集
elasticsearch
海兰3 天前
离线合同结构化提取与检索:LangExtract + 本地DeepSeek + Elasticsearch 9.x
大数据·elasticsearch·django
yumgpkpm3 天前
AI视频生成:Wan 2.2(阿里通义万相)在华为昇腾下的部署?
人工智能·hadoop·elasticsearch·zookeeper·flink·kafka·cloudera
Sheffield4 天前
如果把ZooKeeper按字面意思比作动物园管理员……
elasticsearch·zookeeper·kafka
嗝屁小孩纸4 天前
ES索引重建(零工具纯脚本执行)
大数据·elasticsearch·搜索引擎
Elastic 中国社区官方博客4 天前
使用 Jina Embeddings v5 和 Elasticsearch 构建“与你的网站数据聊天”的 agent
大数据·人工智能·elasticsearch·搜索引擎·容器·全文检索·jina
Elastic 中国社区官方博客4 天前
Elastic 公共 roadmap 在此
大数据·elasticsearch·ai·云原生·serverless·全文检索·aws
码云数智-大飞4 天前
像写 SQL 一样搜索:dbVisitor 如何用 MyBatis 范式颠覆 ElasticSearch 开发
sql·elasticsearch·mybatis