【发布时间】:2022-11-05 09:34:05
【问题描述】:
我正在尝试将chainlink连接到postgres db,同样我将它们都作为docker镜像运行。
我将 postgres docker 启动为:
$ docker run --name some-postgres -e POSTGRES_PASSWORD=secret -p 5432:5432 -d postgres
这将成功启动 postgres。
但是,如果我尝试使用以下 .env 连接链环(根据chainlink doc) 文件
ROOT=/chainlink
LOG_LEVEL=debug
ETH_CHAIN_ID=5
CHAINLINK_TLS_PORT=0
SECURE_COOKIES=false
ALLOW_ORIGINS=*
ETH_URL=wss://eth-goerli.g.alchemy.com/v2/<API KEY>
DATABASE_URL=postgresql://some-postgres:secret@postgres:5432/postgres?sslmode=disable
我正在尝试使用密码作为“secret”连接到“some-postgres”实例,但它仍然抛出错误
Cannot boot Chainlink: opening db: failed to open db: failed to connect to `host=postgres user=some-postgres database=postgres`: hostname resolving error (lookup postgres on 192.168.1.1:53: read udp 172.17.0.3:47766->192.168.1.1:53: i/o timeout) err=Cannot boot Chainlink: opening db: failed to open db: failed to connect to `host=postgres user=some-postgres database=postgres`: hostname resolving error (lookup postgres on 192.168.1.1:53: read udp 172.17.0.3:47766->192.168.1.1:53: i/o timeout) errVerbose=opening db: failed to open db: failed to connect to `host=postgres user=some-postgres database=postgres`: hostname resolving error (lookup postgres on 192.168.1.1:53: read udp 172.17.0.3:47766->192.168.1.1:53: i/o timeout)
Cannot boot Chainlink
我不知道为什么它没有将chainlink docker连接到postgres docker。
【问题讨论】:
标签: postgresql docker chainlink