参考:基于Docker安装Elasticsearch【保姆级教程、内含图解】_docker elasticsearch_Acloasia的博客-CSDN博客
创建网络
docker network create es-net
基于Docker安装Elasticsearch
拉取镜像
docker pull elasticsearch:8.9.1
挂载文件
mkdir -p /usr/local/es/data /usr/local/es/config /usr/local/es/plugins
chmod 777 /usr/local/es/data
chmod 777 /usr/local/es/config
chmod 777 /usr/local/es/plugins
创建ES
docker run -d --restart=always --name gises -p 9200:9200 -p 9300:9300 --privileged=true -v /usr/local/es/data:/usr/share/elasticsearch/data -v /usr/local/es/plugins:/usr/share/elasticsearch/plugins -e "discovery.type=single-node" -e "ES_JAVA_OPTS=-Xms512m -Xmx512m" elasticsearch:8.9.1
编写elasticsearch.yml
docker exec -it gises /bin/bash
cd config
echo 'xpack.security.enabled: false' >> elasticsearch.yml
重启es容器
docker restart gises
http://192.168.0.181:9200/
Docker安装Kibana
docker pull kibana:8.9.1
docker run -d --restart=always --name kibana --network es-net -p 5601:5601 -e ELASTICSEARCH_HOSTS=http://es:9200 kibana:8.9.1
测试Kibana是否安装成功
http://192.168.0.181:5601/
kibana设置中文
docker exec -u 0 -it kibana /bin/bash
i18n.locale: "zh-CN"