kamon-io / docker-grafana-graphite

Docker image with StatsD, Graphite, Grafana 2 and a Kamon Dashboard
Apache License 2.0
1.14k stars 495 forks source link

Can't get stats from outside of the EC2 #45

Closed edanshalom closed 8 years ago

edanshalom commented 8 years ago

The image runs just great and the deployment is very easy. But I couldn't succeed to get stats from outside of the EC2 I'm running the docker's on. I tried to reconfigure statsd graphiteHost to 0.0.0.0 but it didn't help. All the ports are open as they should, and the stats are working just fine when they arrive from the same EC2. Any idea what could be wrong? Thanks.

ivantopo commented 8 years ago

how are you doing the port mapping when starting your container? IIRC there are both private and public IP addresses in EC2, maybe you the container ports are only bound to the private IPs?

edanshalom commented 8 years ago

This is the docker run command I use to run the container: docker run -d -v $(pwd)/logs:/var/log/supervisor -p 80:80 -p 8125:8125/udp -p 8126:8126 --name $CONTAINER_NAME kamon/grafana_graphite

I tried to use both the private and public IP. I succeeded to communicate in and out of docker containers before, so I don't believe the IP or the security group is the issue here.

Perhaps I don't expose correctly the 8125 port in the docker command? Thanks.

edanshalom commented 8 years ago

Ok fixed it. Just for the record and for others: To fix the issue I did the following: I opened the ports in firewalld of the EC2 graphite host. I opened the ports in the Inbound rules of the relevant Security groups. I used the Private IP of the EC2, Public/Elastic IP didn't work. And no need to play with any configurations of the repo. Thanks!

ivantopo commented 8 years ago

awesome @edanshalom, thanks for sharing your solution!