Detailed Explanation of docker Deployment of Elasticsearch kibana and ik Word Segmentation

  • 2021-10-27 10:06:24
  • OfStack

es Installation


docker pull elasticsearch:7.4.0

# -d :  Running in the background 
# -p :  Specifies the host and the docker Start the port mapping of the container 
# --name :  For  elasticsearch  Container name 
# -e :  Specify single-node cluster mode 
# docker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:7.4.0

docker run -id --name es -d -p 9200:9200 -p 9300:9300 -v /usr/share/elasticsearch/plugins:/usr/share/elasticsearch/plugins -e "discovery.type=single-node" elasticsearch:7.4.0
-v /usr/share/elasticsearch/plugins:/usr/share/elasticsearch/plugins # Configure this so that you don't have to enter the container operation    Directly put ik When the word segmentation is decompressed into this directory, ojbk It's over 

es Modify Memory


find / -name jvm.options
vim /var/lib/docker/overlay2/1df979ae710529bc978409973092d28608f927ab6c4b26f5e2c0ffee06e3ac1e/diff/usr/share/elasticsearch/config/jvm.options

1.3 Configuring Chinese Word Segmentation ik

Because the directory is mapped when creating the elasticsearch container, the ik Chinese word segmentation machine can be configured on the host machine
When choosing ik word segmentation device, it needs to correspond to the version of elasticsearch
Upload elasticsearch-analysis-ik-7. 4.0. zip in the data to the server and unzip it in the corresponding directory (plugins)

kibana Installation


docker pull kibana:7.4.0
# -e :  Specify environment variable configuration ,  Provide sinicization 
# --like :  Establish an association between two containers , kibana  Associated with  es
#  If you are not used to sinicization ,  The condition can be removed 
docker run -d --name kibana --link es:es-p 5601:5601 kibana:7.4.0

docker exec -it kibana /bin/bash # Enter the container    Change host
cd config
vi kibana.yml
 Put host Replace with 0.0.0.0
 Change the address to   Public network ip+9200

Viewing the log of so-and-so can not be started to view the log details


docker logs kibana

Related articles: