1.安装docker和java环境,java请自行百度,docker安装连接如下:
https://blog.csdn.net/qq_38776582/article/details/90731768
2.安装elasticsearch
- 拉取elasticsearch镜像
- docker pull docker.elastic.co/elasticsearch/elasticsearch:6.6.2
- 创建elasticsearch容器
- docker run -p 9200:9200 -p 9300:9300 --name es -e “discovery.type=single-node” -e “http.cors.enabled: true” -e “http.cors.allow-origin: “*”” -e “http.cors.allow-credentials: true” docker.elastic.co/elasticsearch/elasticsearch:6.6.2
- 验证elasticsearch是否安装成功
- docker exec -it es bash
3.安装zookeeper - 拉取镜像
- docker pull wurstmeister/zookeeper
- 创建容器
- mkdir -p /zookeeper
- cd /zookeeper
- docker run -d --name zookeeper -p 2181:2181