1.准备镜像
docker pull elasticsearch:7.5.1
docker pull mobz/elasticsearch-head:5-alpine
2.修改系统参数
vi /etc/sysctl.conf
调整参数
vm.max_map_count=262144
刷新参数
sysctl -p
3.启动elasticsearch
docker run -d \
--name=elasticsearch \
--network=host \
-e "cluster.name=elasticsearch" \
-e "discovery.type=single-node" \
-e "network.host=0.0.0.0" \
-e "http.cors.enabled=true" \
-e "http.cors.allow-origin=*" \
elasticsearch:7.5.1
http://10.0.42.211:9200
4.启动elasticsearch-head
docker run -d \
--name=elasticsearch-head \
--restart=always \
--network=host \
docker.io/mobz/elasticsearch-head:5-alpine
访问地址 http://10.0.42.211:9100