【发布时间】:2019-04-29 15:46:22
【问题描述】:
我无法将 postgres_exporter 连接到 postgresql 数据库。我得到了
time="2019-04-29T15:37:46Z" level=info msg="Established new database connection to \"localhost:5432\"." source="postgres_exporter.go:767"
time="2019-04-29T15:37:46Z" level=error msg="Error opening connection to database (postgresql://postgres:PASSWORD_REMOVED@localhost:5432/postgres?sslmode=disable): pq: unknown authentication response: 10" source="postgres_exporter.go:1260"
time="2019-04-29T15:37:46Z" level=info msg="Starting Server: :9187" source="postgres_exporter.go:1360"
端口没问题,密码也是。当我尝试将其作为
运行时# Start an example database
docker run --net=host -it --rm -e POSTGRES_PASSWORD=password postgres
# Connect to it
docker run --net=host -e DATA_SOURCE_NAME="postgresql://postgres:password@localhost:5432/postgres?sslmode=disable" wrouesnel/postgres_exporter
它运行良好,但已经有 postgresql 运行实例,所以我无法创建新实例。
【问题讨论】:
标签: postgresql docker prometheus