1. docker installation 7.4.2
docker pull elasticsearch:7.4.2
2. Check whether the elasticsearch image is installed
docker images
3. install kibana
docker pull kibana:7.4.2
4. Check whether the kibana image is installed
docker images
5. View the available memory size of the virtual machine
free -m
6. Create config configuration folder
mkdir -p /mydata/elasticsearch/config
7. Create data folder
mkdir -p /mydata/elasticsearch/data
8. elasticsearch.yml file in the config folder
echo "http.host: 0.0.0.0" >> /mydata/elasticsearch/config/elasticsearch.yml
9. Start elasticsearch and make some configurations (note that although the command is long, it needs to be copied directly and cannot be wrapped): docker run - -name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms64m -Xmx128m" -v /mydata/elasticsearch/config/elasticsearch.yml:/usr/ share/elasticsearch/config/elasticsearch.yml -v /mydata/elasticsearch/data:/usr/share/elasticsearch/data -v /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins -d elasticsearch:7.4.2
10. Assign maximum permissions to other users
chmod -R 777 /mydata/elasticsearch/
11. View the containerID of the elasticsearch container
docker ps -a
12. Restart the elasticsearch container (f2c is the first three digits of containerID)
docker start f2c
13. Check whether the elasticsearch container is started successfully
docker ps
14. Check the logs for errors
docker logs f2c
15. Access port 9200 in the browser, if there is a json string ({ "name" : "f2c92aa136ec", beginning, where f2c is my elasticsearch container ID, which is different for everyone), it means that the elasticsearch installation is successful 16
. Start elasticsearch and make some configurations (note that 192.168.36.128 should be replaced with your own ip address, and the command cannot be wrapped):
docker run --name kibana -e ELASTICSEARCH_HOSTS=http://192.168.36.128:9200 -p 5601:5601 -d kibana:7.4.2
17. Access port 5601 in the browser, if the kibana homepage appears, it means that kibana is installed successfully