有事没事领个红包

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
posted @ 2024-03-11 22:43  crazyCodeLove  阅读(150)  评论(0编辑  收藏  举报