docker pull elasticsearch:5.6.9
docker run -e ES_JAVA_OPTS="-Xms256m -Xmx256m" -d -p 9200:9200 -p 9300:9300 --name ES01 elasticsearch:5.6.9
查看运行状况:
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
49fb853e0e1b elasticsearch:5.6.9 "/bin/tini -- /usr..." 4 minutes ago Exited (78) 4 minutes ago ES01
没能运行成功,查看启动log
docker logs 49fb853e0e1b
ERROR: [2] bootstrap checks failed. You must address the points described in the following [2] lines before starting Elasticsearch.
bootstrap check failure [1] of [2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
bootstrap check failure [2] of [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
ERROR: Elasticsearch did not exit normally - check the logs at /usr/share/elasticsearch/logs/docker-cluster.log
错误解决:
在/etc/sysctl.conf文件最后添加一行 vm.max_map_count=262144 执行/sbin/sysctl -p 立即生效
重新运行Elasticsearch
docker start 49fb853e0e1b
|