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

相关推荐
Makoto_Kimur3 小时前
Elasticsearch面试八股整理
elasticsearch
杨浦老苏4 小时前
开源的AI编程工作站HolyClaude
人工智能·docker·ai·编辑器·开发·群晖
普通网友10 小时前
《K8s 自动扩缩容:基于 CPU / 内存的 HPA 配置》
docker·容器·kubernetes
DYuW5gBmH12 小时前
Godot UI布局指南
jenkins
青稞社区.12 小时前
Claude Code 源码深度解析:运行机制与 Memory 模块详解
大数据·人工智能·elasticsearch·搜索引擎·agi
Aktx20FNz13 小时前
iFlow CLI 完整工作流指南
大数据·elasticsearch·搜索引擎
学习3人组14 小时前
TortoiseGit冲突解决实战上机练习
大数据·elasticsearch·搜索引擎
A__tao15 小时前
Elasticsearch Mapping 一键生成 Go Struct,支持嵌套解析
elasticsearch·es
zfoo-framework16 小时前
docker compose安装gitea实现公司内部开发git私有仓库
docker·容器·gitea
zs宝来了16 小时前
Elasticsearch 索引原理:倒排索引与 Segment 管理
elasticsearch·索引·倒排索引·源码解析·segment