By default, Elasticsearch requires 2G of memory space when it is turned on, so if you don’t have enough memory during installation, you need to set the memory
- Check your own memory size: free -m
Mem: means memory (see how much free you have left)
Swap: means virtual memory - To start:
docker run -e ES_JAVA_OPTS="-Xms256m -Xmx256m" -d -p 9200:9200 -p 9300:9300 --name el01 -e "discovery.type=single-node" 7ec4f35ab452
7ec4f35ab452: ImageId of Elasticsearch downloaded by docker
-e ES_JAVA_OPTS="-Xms256m -Xmx256m": Just set how much memory you want to start Elasticsearch, not too small!
9200: External access
9300: Internal access
discovery.type=single-node: Single node deployment
- Run in the browser:
if this json data appears on your own IP: 9200, it means success! !
Installed for the first time.