1 通过阿里云镜像加速器地址 配置docker加速服务
2 拉取镜像
docker pull elasticsearch:7.4.2
3 建立挂载目录
mkdir -p /mydata/elasticsearch/config
mkdir -p /mydata/elasticsearch/data
echo "http.host : 0.0.0.0" >> /mydata/elasticsearch/config/elasticsearch.yml
4 修改权限
chmod -R 777 /mydata/elasticsearch/
5 创建容器
docker run --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms64m -Xmx128m" -v /mydata/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml -v /mydata/elasticsearch/data:/usr/share/elasticsearch/data -v /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins -d elasticsearch:7.4.2
6 查看是否启动成功 docker ps
7 修改完开机自启动 docker update --restart=always 容器名
8 测试是否启动成功
标签:mydata,config,share,elasticsearch,usr,docker,安装 From: https://www.cnblogs.com/ljj007/p/16818391.html