1、下载镜像
docker pull elasticsearch:6.4.3
2、运行容器
docker run -p 9200:9200 -p 9300:9300 --name es_643 -d elasticsearch:6.4.3
3、容器无法启动时解决
sudo sysctl -w vm.max_map_count=262144 (
4、安装分词器
docker exec -it es_643 /bin/bash
./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.4.3/elasticsearch-analysis-ik-6.4.3.zip
es配置文件位置:vi /usr/share/elasticsearch/config/elasticsearch.yml
和项目一致:cluster.name: "kobe"
5、重启es
docker restart es_643