拉取镜像
docker pull docker.elastic.co/elasticsearch/elasticsearch:7.17.18
创建本地数据、配置文件夹,修改权限
sudo mkdir -p /server/es7/config /server/es7/data /server/es7/logs /server/es7/plugins
sudo chmod 777 /server/es7/config /server/es7/data /server/es7/logs /server/es7/plugins
编辑配置文件
sudo vi /server/es7/config/elasticsearch.yml
network.host: 0.0.0.0
http.cors.allow-origin: "*"
http.cors.enabled: true
xpack.security.enabled: false
启动容器
docker run --name es7 --network host \
-e "discovery.type=single-node" \
-e "cluster.name=es7" \
-e "ES_JAVA_OPTS=-Xms1g -Xmx1g" \
-v /server/es7/plugins:/usr/share/elasticsearch/plugins \
-v /server/es7/data:/usr/share/elasticsearch/data \
-v /server/es7/logs:/usr/share/elasticsearch/logs \
-v /server/es7/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
-d docker.elastic.co/elasticsearch/elasticsearch:7.17.18
标签:es7,单机版,logs,server,elasticsearch7,elasticsearch,docker,config
From: https://www.cnblogs.com/zhaopengcheng/p/18067287