我试图摆脱cloudsql代理,使用它作为一个侧服务器来分离服务。按照这里提到的所有步骤,在kubernetes集群中部署https://github.com/GoogleCloudPlatform/cloud-sql-proxy/tree/main/examples/k8s-service后,我得到了下面提到的一个错误
┌─────────────────────────────────────────────────────────── Logs(pygeno/pgbouncer-xxxxxxx-xxxxx:pgbouncer)[1m] ───────────────────────────────────────────────────────────┐
│ Autoscroll:On FullScreen:Off Timestamps:Off Wrap:Off │
│ pgbouncer 04:58:23.60 │
│ pgbouncer 04:58:23.61 Welcome to the Bitnami pgbouncer container │
│ pgbouncer 04:58:23.61 Subscribe to project updates by watching https://github.com/bitnami/containers │
│ pgbouncer 04:58:23.62 Submit issues and feature requests at https://github.com/bitnami/containers/issues │
│ pgbouncer 04:58:23.62 │
│ pgbouncer 04:58:23.65 INFO ==> ** Starting PgBouncer setup ** │
│ pgbouncer 04:58:23.67 INFO ==> Validating settings in PGBOUNCER_* env vars... │
│ pgbouncer 04:58:23.69 INFO ==> Initializing PgBouncer... │
│ pgbouncer 04:58:23.74 INFO ==> Waiting for PostgreSQL backend to be accessible │
│ cannot resolve host "postgresql": lookup postgresql on xx.0.xx.xx:xx: no such host │
│ cannot resolve host "postgresql": lookup postgresql on xx.0.xx.xx:xx: no such host │
│ cannot resolve host "postgresql": lookup postgresql on xx.0.xx.xx:xx: no such host │
│ cannot resolve host "postgresql": lookup postgresql on xx.0.xx.xx:xx: no such host │
│ cannot resolve host "postgresql": lookup postgresql on xx.0.xx.xx:xx: no such host │
│ cannot resolve host "postgresql": lookup postgresql on xx.0.xx.xx:xx: no such host我在这里被击中了,不能再往前走了。
发布于 2022-09-21 15:58:21
我通过添加环境变量POSTGRESQL_HOST和赋值127.0.0.1来解决这个问题。
https://stackoverflow.com/questions/73781910
复制相似问题