1, the search elasticsearch
docker search elasticsearch
Because you want to download the specified version 6.6.2, we go to the official website to see if there is a specified version
https://hub.docker.com/
see the results, there is, we pulled the specified version
2, Download image
docker pull elasticsearch:6.6.2
The download is complete, View
docker images
3, start:
docker run -e ES_JAVA_OPTS="-Xms256m -Xmx256m" -d -p 9200:9200 -p 9300:9300 --name=es-pro elasticsearch:6.6.2
Parameters Resolution:
-e ES_JAVA_OPTS = "- Xms256m -Xmx256m" heap memory size restrictions, prevent elasticsearch start occupying too much memory, (due to the default start-up parameters are es 2g, our virtual machine sometimes is not big enough, you can modify the JVM startup parameters are not 256 starts)
-d start background
-p 9200: 9200 port mapping virtual machine 9200 to 9200 of elasticsearch port (web communication default port 9200)
-p 9300: 9300 port mapping virtual machine 9300 to 9300 elasticsearch port (the distributed case, the communication between the respective nodes by default port 9300)
-Name es-pro specify a name (es-pro optionally specify)
elasticsearch: 6.6.2: image name
3, browser and enter their own virtual machine ip and port elasticsearch of 9200, operating results in the following figure represents a successful installation
success stories are as follows:
In fact, the first time I did not start up, found every few seconds to flash back,
we use docker View Log
docker logs es-pro
max virtual memory areas vm.max_map_count [65530]
is too low, increase to at least [262144] As given, can be solved by the following
vi /etc/sysctl.conf
Add a line vm.max_map_count = 655360
Load Parameters
sysctl -p
Restart es
dockerr start es-pro
View Log:
We can see, my es up
Use your browser to view,
OK, solved!
4, the mounting plug elasticsearch-hear
1, download the image
docker pull mobz / elasticsearch-head: 5
2, the boot image
docker run -d -p 9100: 9100 --name = es-head mobz / elasticsearch-head: 5