Docker installs elasticsearch and kibana

Time:2020-10-1

1. Install elasticsearch

  • Pull elasticsearch image

    docker pull elasticsearch

    Docker installs elasticsearch and kibana

    Create a handover mode network

    docker network create elasticsearch_net
  • install

    docker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 --network elasticsearch_net -v elasticsearch_volume:/root -e "privileged=true" -e "discovery.type=single-node" elasticsearch
    
    #- D background operation
    #-- name elasticsearch container name
    #- P 9200:9200 - P 9300:9300 map port 
    # --network elasticsearch_ Net
    # -v elasticsearch_ Volume / root named shared directory
    #- e "privileged = true" to configure access
    # -e " discovery.type=single -Node "specifies elasticsearch deployment mode
    #Elasticsearch specifies the image
    
    ----
    # -v elasticsearch_ Volume / root named shared directory
    #- e "privileged = true" to configure access
    At the beginning, there is no configuration of access rights, ES has been unable to get up, and you can get up after adding permissions

    Docker installs elasticsearch and kibana

    Docker installs elasticsearch and kibana

  • Modify configuration

    echo 'http.cors.allow-origin: "*"' >> elasticsearch.yml
    echo "http.cors.enabled: true" >> elasticsearch.yml
  • Restart es

    docker restart elasticsearch
  • Installing IK word breaker
    Download the same version of IK word breaker zip package through shared directory or direct WGet
    Docker installs elasticsearch and kibana
    Unzip it to the / usr / share / elasticsearch / plugins directory
    Restart es

    docker restart elasticsearch
    In the startup log, you can see that it is loaded into the IK word breaker plug-in

    Docker installs elasticsearch and kibana

  • Install kibana
    Docker pulls kibana 5.6.12 image

    docker pull kibana:5.6.12

    Docker installs elasticsearch and kibana

    Running kibana

    docker run -d --name kibana --network elasticsearch_net -e ELASTICSEARCH_URL=http://192.168.159.3:9200 -p 5601:5601 kibana:5.6.12

    Visit kibana
    Docker installs elasticsearch and kibana

  • Installing elasticsearch head

    docker pull mobz/elasticsearch-head:5
    docker run -d -p 9100:9100 docker.io/mobz/elasticsearch-head:5

    Docker installs elasticsearch and kibana