docker安装elasticsearch
查看max_map_count的值 默认是65530
[root@localhost ~]# cat /proc/sys/vm/max_map_count
65530
重新设置max_map_count的值
[root@localhost ~]# sysctl -w vm.max_map_count=262144
vm.max_map_count = 262144
拉取镜像
[root@localhost ~]# docker pull elasticsearch:7.7.0
7.7.0: Pulling from library/elasticsearch
524b0c1e57f8: Pull complete
4f79045bc94a: Pull complete
5bfd159f5e06: Pull complete
e00e3b68a158: Pull complete
33b005156da6: Pull complete
a4bd47222680: Pull complete
6433b34e08c2: Pull complete
fc6ab638f272: Pull complete
ca0dbaf72840: Pull complete
Digest: sha256:ce6d341f95af5c1fdefae53789d92b6dd978f605ade2eea41381162d21c9f938
Status: Downloaded newer image for elasticsearch:7.7.0
docker.io/library/elasticsearch:7.7.0
运行
[root@localhost ~]# docker run --name elasticsearch -d -e ES_JAVA_OPTS="-Xms512m -Xmx512m" -e "discovery.type=single-node" -p 9200:9200 -p 9300:9300 elasticsearch:7.7.0
93a27d51d0ae93b6f32cb9d1b054a883654418864c1182a418e9a1358ecba2db
浏览器访问ip:9200 出现以下界面安装成功
学习参考链接:https://blog.csdn.net/qq_40942490/article/details/111594267