PGHero - Docker - Monitor all databases in the cluster

143 Views Asked by At

Is it possible to deploy a single standalone, docker instance, of PGHero and be able to use it to monitor all databases in the cluster?

1

There are 1 best solutions below

0
On

Use docker run to and a custom pghero.yml with the custom config.

The secret is map the pghero.yml (the -v), here is an example that I used:

databases:
   main:
     url: 'postgres://aaa:[email protected]:55432/pghero'
   dev:
     url: 'postgres://ccc:[email protected]:5432/otherdb'

Run it:

docker run -tid --name pgdafhero -e PGHERO_USERNAME=xxx -e PGHERO_PASSWORD=yyy \
-p 8080:8080 \
-v $(pwd)/pghero.yml:/app/config/pghero.yml \
 ankane/pghero 

check for a clean start

open the URL: HTTP://xxx:[email protected]:8080 to access the dashboard

Here, you can see the list of available databases (2) and the current selected one (1)

enter image description here

In summary, you can use a single docker to monitor all the databases that you need. Just add DB by DB in the yml file.