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

相关推荐
jingqiulyue31 分钟前
docker run出现exited或者不断restart怎么办
docker·容器
IT策士2 小时前
Docker 常见面试问题
docker·容器·面试
预测模型的开发与应用研究2 小时前
双Docker Oracle XE 跨库查询操作文档
docker·oracle·容器
逻极2 小时前
Docker容器化实战:从镜像构建到微服务编排与避坑指南
docker·容器·镜像·devops
鹤落晴春3 小时前
【K8s】资源配额与访问控制
docker·容器·kubernetes
Dontla3 小时前
.gitkeep文件作用(让Git追踪空目录,使该目录能被纳入版本控制)!.gitkeep
大数据·git·elasticsearch
我叫张小白。3 小时前
Docker核心命令
运维·docker·容器
云原生指北3 小时前
告别 Jenkins UI:jk 让 AI Agent 也能操控 Jenkins
jenkins·devops
一只积极向上的小咸鱼3 小时前
Codex MCP 与 Skills 跨 Docker 共享问题总结与后续规范
运维·docker·容器
暮云星影13 小时前
个人总结 搭建Docker监控
docker·容器·grafana·prometheus