1. 错误信息:
使用docker run -id -p 9200:9200 -p 9300:9300 --name elasticsearch elasticsearch:7.0.0
启动成功,但是几秒钟就回自动停止,查看log发现报错
ERROR: [1] bootstrap checks failed
[1]: 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
2.解决方案
docker run -d -e ES_JAVA_POTS="-Xms256m -Xmx256m" -e "discovery.type=single-node" -p 9200:9200 -p 9300:9300 --name elasticsearch elasticsearch:7.0.0
根据上面语句启动就可以后台运行不会报错了