docker启动 Elasticsearch命令

设置虚拟内存大小:
screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
sysctl -w vm.max_map_count=262144

启动命令:
docker run -p 9200:9200 -p 9300:9300 --name elasticsearch -e “discovery.type=single-node” -e “cluster.name=elasticsearch” -e ES_JAVA_OPTS="-Xms256m -Xmx256m" -v /Users/ggy/IdeaProjects/docker/elasticsearch/plugins:/usr/share/elasticsearch/plugins -v /Users/ggy/IdeaProjects/docker/elasticsearch/data:/usr/share/elasticsearch/data -d elasticsearch

注释: -e ES_JAVA_OPTS="-Xms256m -Xmx256m"必须要加;
docker logs -f “容器id" 查看容器日志

你可能感兴趣的:(docker,docker,elasticsearch)