问题描述
我正在尝试在 ubuntu 20.04 上安装 eventstore,但每次我运行 evenstored --what-if
(作为 root 或作为简单用户,或作为 sudo)我都会收到以下错误消息:Couldn't acquire exclusive lock on DB at '/eventstore/db'.
。
我尝试了很多东西:
- 我尝试确保 eventstore 用户和组是文件夹的所有者。
- 重新安装 eventstore
- 重启服务器
- 用
systemctl stop eventstore
停止进程并重新开始 在使用eventstored --what-if
之前,我还尝试先启动服务(以 root/sudo 或简单用户身份)。
我不明白为什么我总是收到这条消息,就好像有多个 eventstore 实例同时启动一样。
编辑:
这是我的配置文件 (/etc/eventstore/eventstore.conf
)
# Paths
Db: /eventstore/db
Index: /eventstore/index
Log: /eventstore/logs
# Certificates configuration
CertificateFile: /etc/eventstore/certs/cert.crt
CertificatePrivateKeyFile: /etc/eventstore/certs/privkey.key
TrustedRootCertificatesPath: /etc/ssl/certs
CertificateReservednodeCommonName: "*.mathob-jehanno.com"
# Network configuration
IntIp: 37.187.2.103
ExtIp: 37.187.2.103
IntHostAdvertiseAs: mathob-jehanno.com
ExtHostAdvertiseAs: mathob-jehanno.com
HttpPort: 2113
IntTcpPort: 1112
EnableExternalTcp: false
EnableAtompubOverHTTP: false
# Projections configuration
RunProjections: None
解决方法
以前发生在我身上。我在运行 v20 时没有提供必要的设置,例如缺少证书。服务器因此崩溃,但您看到的最后一条消息是此 Couldn't acquire exclusive lock on DB at '/eventstore/db'
。您可能会仔细查看是否是警告,而崩溃的真正原因在前面原始错误的堆栈跟踪中已提及。
好的
首先,评论很有帮助:
此错误消息是在另一条错误消息之后提供的,该消息提供了有关问题所在的更多详细信息。
需要知道的一件事是,eventstored --what-if
应该在服务未运行时运行,因此用户需要在 (systemctl stop eventstore
) 之前停止服务。
然后我更改了 db、index 和 logs 文件的路径以匹配默认值(它阻止了我一些权限错误)。