拉取es docker pull docker.elastic.co/elasticsearch/elasticsearch:7.11.1
单节点启动es
docker run --name es9200 -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.11.1
单节点加入已有集群
cd /opt/ touch elasticsearch.yml mv elasticsearch.yml elasticsearch-9200.yml
启动es docker run --name es9200x --network=host -p 9200:9200 -p 9300:9300 -v /opt/docker-file/elasticsearch-9200.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:7.11.1
查看集群节点