其他分享
首页 > 其他分享> > ElasticSearch系列:docker之简单部署

ElasticSearch系列:docker之简单部署

作者:互联网

一、前言

二、下载镜像

[root@i-slebi7x6 bin]# docker pull elasticsearch:7.16.3
7.16.3: Pulling from library/elasticsearch
ea362f368469: Pull complete
0ccee306c4da: Pull complete
28688537d02c: Pull complete
aa5fb23d065d: Pull complete
89f4c512861d: Pull complete
bfcc724c6288: Pull complete
abb0ba51c947: Pull complete
5f53dd95410f: Pull complete
4b3820751286: Pull complete
Digest: sha256:de5474d051409e8222eee30c82ef299f3f3c97bb339bbd19c314178db659f7b4
Status: Downloaded newer image for elasticsearch:7.16.3
docker.io/library/elasticsearch:7.16.3

三、简单部署

首先根据自己的需求修改一下config目录下的jvm.options的JVM配置。

################################################################
##
## JVM configuration
##
################################################################
##
## WARNING: DO NOT EDIT THIS FILE. If you want to override the
## JVM options in this file, or set any additional options, you
## should create one or more files in the jvm.options.d
## directory containing your adjustments.
##
## See https://www.elastic.co/guide/en/elasticsearch/reference/7.16/jvm-options.html
## for more information.
##
################################################################



################################################################
## IMPORTANT: JVM heap size
################################################################
##
## The heap size is automatically configured by Elasticsearch
## based on the available memory in your system and the roles
## each node is configured to fulfill. If specifying heap is
## required, it should be done through a file in jvm.options.d,
## and the min and max should be set to the same value. For
## example, to set the heap to 4 GB, create a new file in the
## jvm.options.d directory containing these lines:
##
## -Xms4g
## -Xmx4g
##
## See https://www.elastic.co/guide/en/elasticsearch/reference/7.16/heap-size.html
## for more information
##
################################################################

-Xms1g
-Xmx1g

如果端口无需修改,则不用配置elasticsearch.yml。可以直接启动即可。

docker run -d --name es2 -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:7.16.3

三、测试是否启动

在浏览器输入 ip + 端口号。

 

标签:Pull,7.16,complete,部署,##,ElasticSearch,elasticsearch,docker,options
来源: https://blog.csdn.net/wngpenghao/article/details/122705024