简体   繁体   English

CHAINLINK 节点:我该如何解决“无法锁定 ORM”错误?

[英]CHAINLINK NODE: How might I approach fixing "unable to lock ORM" errors?

I am not overly familiar with the process of setting up a chainlink node.我不太熟悉设置chainlink节点的过程。 I have done so today, but am running into an issue.我今天已经这样做了,但遇到了一个问题。 On the very last step, when attempting to start the chainlink node I put the following into the command line:在最后一步,当尝试启动 chainlink 节点时,我将以下内容放入命令行:

cd ~/.chainlink-kovan && docker run -p 6688:6688 -v ~/.chainlink-kovan:/chainlink -it --env-file=.env smartcontract/chainlink local n

When this runs the pulls all say "pull complete"当这个运行时,所有的拉动都说“拉动完成”

I am getting the following ORM errors:我收到以下 ORM 错误:

2020-10-15T22:07:30Z [ERROR] unable to lock ORM: dial tcp 127.0.0.1:5432: connec t: connection refused logger/default.go:139 2020-10-15T22:07:30Z [ERROR] 无法锁定 ORM:拨号 tcp 127.0.0.1:5432:连接:连接被拒绝 logger/default.go:139
stacktrace=github.com/smartcontrac stacktrace=github.com/smartcontrac
tkit/chainlink/core/logger.Error tkit/chainlink/core/logger.Error

/usr/local/go/src/runtime/proc.go:203 2020-10-15T22:07:30Z [FATAL] Unable to initialize ORM: dial tcp 127.0.0.1:5432: /usr/local/go/src/runtime/proc.go:203 2020-10-15T22:07:30Z [致命] 无法初始化 ORM:拨 tcp 127.0.0.1:5432:
connect: connection refused unable to open for gorm DB连接:连接被拒绝,无法为 gorm DB 打开

I am not sure what might be the issue.我不确定可能是什么问题。 Could someone point me in the direction I might start in the debug this issue?有人能指出我在调试这个问题时可能开始的方向吗?

[ERROR] unable to lock ORM is the default message given when the data is not able to be reached, and it also don't see another user with a lock. [ERROR] unable to lock ORM[ERROR] unable to lock ORM数据时给出的默认消息,并且也看不到其他用户锁定。 You can see the reason it can't connect to the ORM is because: dial tcp 127.0.0.1:5432: connec t: connection refused To fix, you can try a number of different things:您可以看到它无法连接到 ORM 的原因是: dial tcp 127.0.0.1:5432: connec t: connection refused要修复,您可以尝试多种不同的方法:

1. Try to access the postgress database using the parameters of the DATABASE_URL 1.尝试使用DATABASE_URL的参数访问postgress数据库

If you can't get into the DB with the parameters of the DATABASE_URL there might be something wrong with that.如果您无法使用DATABASE_URL的参数进入DATABASE_URL则可能有问题。 You can see if you can connect by downloading the psql client .您可以通过下载 psql 客户端查看是否可以连接。 If on ubuntu you can use:如果在 ubuntu 上,您可以使用:

sudo apt-get update
sudo apt-get install postgresql-client

and then running something like psql -h IP_HERE -U USER_HERE and then entering your password然后运行类似psql -h IP_HERE -U USER_HERE ,然后输入你的密码

2. Add --network host for local databases 2.为本地数据库添加--network host

If you are running your node/database locally you'll have to add --network host to your chainlink docker command.如果您在本地运行节点/数据库,则必须将--network host添加到您的--network host命令。

3. Try localhost , 172.17.0.1 , or use a cloud DB if you're using a mac. 3. 尝试localhost172.17.0.1 ,或者如果您使用的是 mac,请使用云数据库。

Docker is a little tricky when it comes to IPs. Docker 在 IP 方面有点棘手。 If you are running a local DB and you are trying to use 127.0.0.1 , you may want to try localhost .如果您正在运行本地数据库并尝试使用127.0.0.1 ,您可能想尝试localhost On a mac, you'll run into issues since the docker gateway doesn't play nicely with macos, and easy work around is to get a database URL from a cloud database like on heroku, GCP, or AWS.在 Mac 上,您会遇到问题,因为 docker 网关不能很好地与 macos 配合使用,而简单的解决方法是从 Heroku、GCP 或 AWS 等云数据库中获取数据库 URL。

If none of these work for you, please add a comment and we can update this answer.如果这些都不适合您,请添加评论,我们可以更新此答案。

在查看 Patrick 的视频后,我注意到我正在复制公共 IP,而实际上,GCP 的私有 IP 是您在命令中运行 docker 时需要使用的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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