docker安装es和kibana

1.创建网络

docker network create es-net

2.下载镜像

docker pull elasticsearch:7.12.1

docker pull kibana:7.12.1

docker pull mobz/elasticsearch-head:5

3.运行容器

docker run -d \

--restart=always

--name es7 \

-e "ES_JAVA_OPTS=-Xms512m -Xmx512m" \

-e "discovery.type=single-node" \

-v es-data:/usr/local/elasticsearch7.12.1/data \

-v es-plugins:/usr/local/elasticsearch7.12.1/plugins \

-v es-logs:/usr/local/elasticsearch7.12.1/logs \

--privileged \

--network es-net \

-p 9200:9200 \

-p 9300:9300 \

elasticsearch:7.12.1

docker run -d \

--restart=always

--name kibana \

-e ELASTICSEARCH_HOSTS=http://es7:9200 \

--network=es-net \

-p 5601:5601 \

kibana:7.12.1

docker run -d --restart=always --name es-head -p 9100:9100 mobz/elasticsearch-head:5

4.访问页面

http://192.168.88.130:9200/

http://192.168.88.130:5601/app/home

http://192.168.88.130:9100/

5.elasticsearch.yml需要配置跨域,head才可正常连接

vi /usr/share/elasticsearch/config/elasticsearch.yml

http.cors.enabled: true

http.cors.allow-origin: "*"

http.cors.allow-headers : X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization

http.cors.allow-credentials: true

http.cors.allow-methods: OPTIONS,HEAD,GET,POST,PUT,DELETE

相关推荐
分布式存储与RustFS8 小时前
MinIO 官方 Docker 镜像被移除:依赖它的项目该怎么办
docker·云原生·devops·对象存储·minio·分布式存储
玉&心10 小时前
通过Arthas在线诊断K8S中的内存及JVM等使用情况
docker·k8s·arthas
xing-xing11 小时前
Docker容器中Nginx站点根目录网页配置访问
nginx·docker
guo_wen_qiang11 小时前
上传本地镜像到harbor中
docker·容器·持续部署
Elasticsearch11 小时前
Elastic Observability 的跨项目搜索:通过一个查询搜索所有关联项目
elasticsearch
羑悻的小杀马特11 小时前
Dockerfile 全景指南:从入门编写dockerfile到生产环境镜像优化实战,一步步带你从啃透制作指令到镜像制作落地!
docker·dockerfile·镜像制作
BianHuanShiZhe12 小时前
docker常见命令
docker
Elasticsearch13 小时前
Elasticsearch 中的 agentic 工作流:暂停 AI agent 等待人工审批,72 小时后恢复
elasticsearch
正经教主14 小时前
【FDE系列】阶段2:Day 43:Docker Compose — 多容器一键编排
人工智能·docker·fde
忆~遂愿14 小时前
本地片库怎么在外面打开?Plex + cpolar 搭一套可远程访问的私人影音库
docker·容器