简体   繁体   中英

Cannot connect to my PostgreSQL server remotely from chainlink node terminal

I have tried everyting to connect my Chainlink node up to my postgresql database with no luck. I have scoured the interwebs for answers to no avail...

Here is the error message I am receiving:

[ERROR] failed to initialize database, got error failed to connect to `host=/tmp user=root database=`: dial error (dial unix /tmp/.s.PGSQL.5432: connect: no such file or directory)

Here is my.env file:

ROOT=/chainlink
LOG_LEVEL=debug
ETH_CHAIN_ID=42
MIN_OUTGOING_CONFIRMATIONS=2
LINK_CONTRACT_ADDRESS=0xa36085F69e2889c224210F603D836748e7dC0088
CHAINLINK_TLS_PORT=0
SECURE_COOKIES=false
GAS_UPDATER_ENABLED=true
ALLOW_ORIGINS=*
ETH_URL=wss://kovan.infura.io/ws/v3/id...
DATABASE_URL=https://chainlink-db-url://postgres:Password@chainlink-kovan:5432

I have tried every configuration of the connection string. Also I am able to connect to the db via pgAdmin no problem and the dbs are publicaly accessible.

The postgresql database is on AWS.

Please change the syntax of your DATABASE_URL to:

DATABASE_URL=postgresql://"username":"password"@"public-ip-pg-server":5432/"database-name"

just change:

"username": you need to configure a new user, because the default/admin user postgres will not work for it.
"password": password of the user
"public-ip-pg-server": the public ip address of your postgresql-server
"database-name": the name of your database

PS: delete all " in your syntax (;

Here is the link to the official documentation: https://docs.chain.link/docs/connecting-to-a-remote-database/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM