内网怎么连接数据库,我用sealos上 devbox开的 nodejs,连接 sealos上的数据库不成功
devbox@mysqltestnode:~/project$ node test-connection.js
Error connecting to PostgreSQL database Error: getaddrinfo ENOTFOUND postdbtest-postgresql.ns-pnd3aqak.svc
at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26) {
errno: -3008,
code: ‘ENOTFOUND’,
syscall: ‘getaddrinfo’,
hostname: ‘postdbtest-postgresql.ns-pnd3aqak.svc’
}
An error occurred: Error: getaddrinfo ENOTFOUND postdbtest-postgresql.ns-pnd3aqak.svc
at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26) {
errno: -3008,
code: ‘ENOTFOUND’,
syscall: ‘getaddrinfo’,
hostname: ‘postdbtest-postgresql.ns-pnd3aqak.svc’
}
Connection to PostgreSQL closed
devbox@mysqltestnode:~/project$ ping postdbtest-postgresql.ns-pnd3aqak.svc
ping: postdbtest-postgresql.ns-pnd3aqak.svc: Name or service not known
devbox@mysqltestnode:~/project$
Connection 为
postgresql://postgres:xxxxxxxx@postdbtest-postgresql.ns-pnd3aqak.svc:5432