linking kibana with elasticsearch

后端 未结 2 609
无人及你
无人及你 2021-02-06 19:06

I have the following docker containers running on my box...

CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS                  


        
2条回答
  •  佛祖请我去吃肉
    2021-02-06 19:53

    First of all, Linking is a legacy feature, Create a user defined network first:

    docker network create mynetwork --driver=bridge
    

    Now use mynetwork for containers you want to be able to communicate with each other.

    docker run -p 5601:5601 --name kibana -d --network mynetwork kibana 
    docker run -p 9200:9200 -p 9300:9300 --name elasticsearch -d --network mynetwork elasticsearch
    

    Docker will run a dns server for your user defined network, so you can ping other container by name.

    docker exec -it kibana /bin/bash
    ping elasticsearch
    

    You can use telnet or curl to verify kibana->elasticsearch connectivity from kibana container.

    p.s I used official (library) docker images for ELK stack with user defined networking recently and it worked like a charm.

提交回复
热议问题