报错日志如下:
具体日志显示的原因是
1.内存不足
2.三个指定的参数必须配置其中一个
针对问题1:max virtual memory areas vm.max_map_count [65530] is too low,increase to at least[262144] 的一劳永逸办法就是在系统配置 vim /etc/sysctl.conf 加入 vm.max_map_count=262144
vim /etc/sysctl.conf
针对问题2:the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
三个指定的参数必须配置其中一个
在docker运行命令的时候加入 -e "discovery.type=single-node"
详细命令:
docker run -d -e ES_JAVA_POTS="-Xms256m -Xmx256m" -e "discovery.type=single-node" -p 9200:9200 -p 9300:9300 --name ES0827 elasticsearch:7.9.0
运行成功:
访问9200端口