adapter cannot connect to postgresql with default credentials
AmeyK-Globant opened this issue · 2 comments
Hi,
I have setup postgresql 10 on my ubuntu box and it is in running state. Also, I changed pg_hba.conf to allow connections to the host without password by changing METHOD to trust from peer. Still, when I am running prometheus-postgresql-adapter, I am getting following error:
root@ubuntu:~/work/src/prometheus-postgresql-adapter# ./prometheus-postgresql-adapter
level=info ts=2018-04-27T08:24:04.537165229Z caller=client.go:80 msg="host=localhost port=5432 user=postgres dbname=postgres password='' sslmode=disable connect_timeout=10"
level=error ts=2018-04-27T08:24:04.603877981Z caller=client.go:99 err="pq: password authentication failed for user "postgres""
But remote connection to postgresql is working which was tested as below:
root@ubuntu:~/work/src/prometheus-postgresql-adapter# sudo psql -U postgres
psql (10.3 (Ubuntu 10.3-1.pgdg16.04+1))
Type "help" for help.
postgres=# \q
Hi,
same issue here. It seems prometheus-postgresql-adapter
isn't working with peer authentication?
I tried a view -pg.* usage options. :-/
@aliensmily @AmeyK-Globant
Peer authentication only works with unix domain sockets but not with TCP/IP connections. To use unix domain sockets you can pass the path to your unix domain socket directory as host like so:
./prometheus-postgresql-adapter -pg.host /tmp/