I have the following docker containers running on my box...
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5da7523e527b kibana "/docker-entrypoint.s" About a minute ago Up About a minute 0.0.0.0:5601->5601/tcp elated_lovelace
20aea0e545ca elasticsearch "/docker-entrypoint.s" 3 hours ago Up 3 hours 0.0.0.0:9200->9200/tcp, 9300/tcp sad_meitner
My aim was to get kibana to link to my elasticsearch container however when I hit kibana it's telling me that I do not have any document stores. I know this is not right because I definitely have documents in elasticsearch. I'm guessing my link command is wrong.
This is the docker command I used to start the kibana container.
docker run -p 5601:5601 --link sad_meitner:elasticsearch -d kibana
Can someone tell me what I've done wrong?
thanks
First of all, Linking is a legacy feature, Create a user defined network first:
Now use
mynetwork
for containers you want to be able to communicate with each other.Docker will run a
dns server
for your user defined network, so you can ping other container by name.You can use
telnet
orcurl
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.you can add
ENV ELASTICSEARCH_URL=elasticsearch:9200
to your Dockerfile before build kibana, then use docker-compose to run elasticsearch with kibana like this: