docker部署单机版elasticsearch7
拉取镜像
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
学习过程中,难免出错。如果您在阅读过程中遇到不太明白,或者有疑问。欢迎指正...联系邮箱crazyCodeLove@163.com
如果觉得有用,想赞助一下请移步赞助页面:赞助一下