0

I have Grafana hosted on Google Cloud Platform using docker - https://github.com/kamon-io/docker-grafana-graphite. I confirmed docker is running on GCE and as GCE only allows port 8080 upwards I change the Grafana port to 8080. I tried previewing using the console, and it returned

Error: Could not connect to Cloud Shell on port 8080.
Ensure your server is listening on port 8080 and try again.

This error does not pertain to this app alone but all the apps I have hosted on GCE, so I seeking a valid way to preview webapps on GCE. This is the docker file docker-compose.yml

version: '2'
services:
  grafana_graphite:
    build: .
    image: kamon/grafana_graphite
    container_name: kamon-grafana-dashboard
    ports:
      - '8080:8080'
      - '8181:8181'
      - '8125:8125/udp'
      - '8126:8126'
      - '2003:2003'
    volumes:
      - ./data/whisper:/opt/graphite/storage/whisper
      - ./data/grafana:/opt/grafana/data
      - ./log/graphite:/opt/graphite/storage/log
      - ./log/supervisor:/var/log/supervisor
Mark
  • 2,265
  • 15
  • 13
ken4ward
  • 2,246
  • 5
  • 49
  • 89

1 Answers1

1

The Grafana backend binds to port 3000 by default, even if you open the firewall on port 8080 it may not work. You have to use one of the following alternatives:

  1. Redirect port 8080 to the Grafana port using:
    $ sudo iptables -t nat -A PREROUTING -p tcp --dport 8080 -j REDIRECT --to- port 3000

  2. Put a webserver like Nginx or Apache in front of Grafana and have them proxy requests to Grafana.

Further information on Grafana configurations options can be found on this documentation link.

JMD
  • 610
  • 4
  • 8