#拉起容器命令 docker run -d --name elasticsearch --net somenetwork -p 9200:9200 -p 9300:9300 -e ES_JAVA_OPTS="-Xms512m -Xmx512m" -e "discovery.type=single-node" -e "xpack.security.enabled=true" elasticsearch:7.17.3 #命令解释 discovery.type 拉起es容器模式 xpack.security.enabled 相当于开启登录认证 ES_JAVA_OPTS 创建时,调整内存的分配 增加9200/9300的端口映射
docker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 -e ES_JAVA_OPTS="-Xms512m -Xmx512m" -e "discovery.type=single-node" -e "xpack.security.enabled=true" elasticsearch:7.17.3