1.docker network create es-net
2.docker pull elasticsearch:8.6.0
3.mkdir -p /usr/local/es/data /usr/local/es/config /usr/local/es/plugins
4.chmod 777 /usr/local/es/data
chmod 777 /usr/local/es/config
chmod 777 /usr/local/es/plugins
5.配置config/elasticsearch.yml
#--配置start---
cluster.name: "docker-cluster"
network.host: 0.0.0.0
xpack.security.enabled: false
#--配置end---
6.docker run -d \
--restart=always \
--name es \
--network es-net \
-p 9200:9200 \
-p 9300:9300 \
--privileged \
-v /usr/local/es/data:/usr/share/elasticsearch/data \
-v /usr/local/es/plugins:/usr/share/elasticsearch/plugins \
-v /usr/local/es/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
-e "discovery.type=single-node" \
-e "ES_JAVA_OPTS=-Xms512m -Xmx512m" \
elasticsearch:8.6.0
7.访问http://xx.xx.xxx.xx:9200/
标签:local,elasticsearch,usr,plugins,docker,安装,es From: https://www.cnblogs.com/mark999/p/18064151