资料
kibana 和elasticserch兼容性表 https://www.elastic.co/cn/support/matrix#matrix_compatibility
Mac系统安装
- 需要版本支持 linux/arm64,需要两个都要支持有arm64,有些es支持,kibana不支持。
- ps: docker pull elasticsearch 出现 elasticsearch:latest not found,查询docker hub是有必要的。
查询docker支持镜像版本链接:
https://hub.docker.com/_/kibana/tags
https://hub.docker.com/_/elasticsearch/tags
一、开始
安装ElasticSearch、Kibana
====elasticsearch安装====
docker pull elasticsearch:7.17.12#在本地目录新建data、conf、logs、plugins挂载
# 假如在 /Users/xxx/docker/es下
cd /Users/xxx/docker/es
mkdir conf data logs plugins# 在下方有elasticsearch.sh具体内容
vim elasticsearch.sh
sh ./elasticsearch.sh====elasticsearch设置密码====
# 进入容器
docker exec -it elasticsearch容器id /bin/bash
# 进入目录
cd bin
# 手动设置用户名和密码,手动输入(有好几个用户和密码需要设置,例如:elastic、kibana_admin、kibana)
elasticsearch-setup-passwords interactive# 进入目录
cd bin
# 自动生成,密码要保存好
elasticsearch-setup-passwords auto=========kibana安装=============
docker pull kibana:7.17.12
# 假如在 /Users/xxx/docker/es下
mkdir kibana
cd kibana
mkdir conf data logs plugins
# 配置文件,在下方有kibana.yml具体内容
vim conf/kibana.yml# kibana.sh文件内容在下方
vim kibana.sh
sh ./kibana.sh
# 需要按顺序配置yml,后启动sh,否则需要重启
docker restart 容器id
elasticsearch.sh执行文件
docker run --name elasticsearch --restart=always \
-p 9200:9200 -p 9300:9300 \
-e "discovery.type=single-node" \
-e ES_JAVA_OPTS="-Xms56m -Xmx128m" \
-v /Users/xxx/docker/es/conf/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
-v /Users/xxx/docker/es/data:/usr/share/elasticsearch/data \
-v /Users/xxx/docker/es/plugins:/usr/share/elasticsearch/plugins \
-v /Users/xxx/docker/es/logs:/usr/share/elasticsearch/logs \
-d elasticsearch:7.17.12
kibana.yml
连接不上时,127.0.0.1改成自己真实的ip
错误信息: Unable to retrieve version information from Elasticsearch nodes. getaddrinfo ENOTFOUND elasticsearch
#
# ** THIS IS AN AUTO-GENERATED FILE **
## Default Kibana configuration for docker target
server.name: kibana
server.host: "0.0.0.0"
elasticsearch.hosts: [ "http://127.0.0.1:9200" ]
elasticsearch.username: "kibana"
elasticsearch.password: "xxxx"
monitoring.ui.container.elasticsearch.enabled: true
i18n.locale: "zh-CN"
kibana.sh执行文件
docker run -d \--name=kibana \--restart=always \-v /Users/xxx/docker/es/kibana/config:/usr/share/kibana/config \-v /Users/xxx/docker/es/kibana/data:/usr/share/kibana/data \-v /Users/xxx/docker/es/kibana/logs:/usr/share/kibana/logs \-v /Users/xxx/docker/es/kibana/plugins:/usr/share/kibana/plugins \-p 5601:5601 \kibana:7.17.12
二、测试
ES访问测试
http://localhost:9200
Kibana访问
http://localhost:5601
ps:Kibana启动报错:Kibana server is not ready yet
- 版本不匹配,查看本文开头【kibana 和elasticserch兼容性】,重新安装。
- ip端口没配好,改成真实ip试试