安装前请确保linux已经安装好了Docker和Docker Compose,并配置好Docker镜像容器加速,推荐使用国内镜像加速地址,
例如阿里云或者DaoCloud的镜像加速服务。需要注册帐号
准备Docker容器安装部署目录
cd ~
mkdir es_kibana
cd es_kibana
touch kibana.yml
编辑Docker-compose.yml文件
version: "3.8"
volumes:
data:
config:
plugin:
networks:
es:
services:
kibana:
image: kibana:7.1.0
ports:
- "5601:5601"
networks:
- "es"
volumes:
- ./kibana.yml:/usr/share/kibana/config/kibana.yml
elasticsearch:
image: elasticsearch:7.1.0
environment:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "discovery.type=single-node"
volumes:
- data:/usr/share/elasticsearch/data
- config:/usr/share/elasticsearch/config
- plugin:/usr/share/elasticsearch/plugins
ports:
- "9200:9200"
- "9500:9300"
networks:
- "es"
添加kibana配置文件
server.host: "0"
elasticsearch.hosts: ["http://elasticsearch:9200"]
xpack.monitoring.ui.container.elasticsearch.enabled: true
启动镜像服务
docker compose up -d ### -d 后台运行容器
## 查看容器启动日志
docker logs -f #容器ID#
查看验证
- 访问elasticsearch地址 虚拟机ip:9200
- 访问kibana地址 虚拟机ip:5601