如果对Docker不太熟悉的小伙伴们可以先去看一下Docker入门,再来看这篇文章哟!
https://blog.csdn.net/m0_53559551/article/details/121358336
那么如果是从我Docker入门文章过来的或者是对Docker有个基本了解的小伙伴们现在跟我一起来了解一下在Docker中部署Elasticsearch的步骤吧。
步骤一:下载并运行镜像
PS C:UsersASUS> docker run -d --name es -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:7.6.2 Unable to find image 'elasticsearch:7.6.2' locally 7.6.2: Pulling from library/elasticsearch ab5ef0e58194: Pull complete c4d1ca5c8a25: Pull complete 941a3cc8e7b8: Pull complete 43ec483d9618: Pull complete c486fd200684: Pull complete 1b960df074b2: Pull complete 1719d48d6823: Pull complete Digest: sha256:1b09dbd93085a1e7bca34830e77d2981521a7210e11f11eda997add1c12711fa Status: Downloaded newer image for elasticsearch:7.6.2 e8fb72ce4fb465aeccb1acbbfd321e06801fa426c3fd59f47c1d8277fe1f52d0
步骤二:运行测试
访问地址:localhost:9200
在安装和运行的过程中可能有一部分小伙伴的电脑会有点卡顿,这是因为ES非常耗内存,这里我们可以对ES进行一些配置
步骤三[可选]:配置ES的内存限制
加入-e ES_JAVA_OPTS="-Xms64m -Xmx512m"的配置
PS C:UsersASUS> docker run -d --name es -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms64m -Xmx512m" elasticsearch:7.6.2 Unable to find image 'elasticsearch:7.6.2' locally 7.6.2: Pulling from library/elasticsearch ab5ef0e58194: Pull complete c4d1ca5c8a25: Pull complete 941a3cc8e7b8: Pull complete 43ec483d9618: Pull complete c486fd200684: Pull complete 1b960df074b2: Pull complete 1719d48d6823: Pull complete Digest: sha256:1b09dbd93085a1e7bca34830e77d2981521a7210e11f11eda997add1c12711fa Status: Downloaded newer image for elasticsearch:7.6.2 097d9eff479123b70f9ccc7c1a579d31bc64d25ede6b04bad3c9e3a75a9c5d08
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)