现象:
然后查看docker日志,发现有vm.max_map_count报错
ERROR: [1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决办法:
1. 宿主机(运行docker的机器),运行以下命令修改vm.max_map_count
echo "vm.max_map_count=262144" | sudo tee -a /etc/sysctl.conf
sysctl -p
2. 启动docker容器传入参数:-e "MAX_MAP_COUNT=262144"
docker run -dti --name=elastic-6.8.12 \
-e "MAX_MAP_COUNT=262144" \
--network=host --restart=always \
elasticsearch:6.8.12
问题解决: