In the db folder, this folder “/data/db/key.db/journal/” do not even exist. But still got the same error if I create this folder in advance. The mongo server version is v4.4.6-8. Does anyone have some advice on this ? Thank you.
After some digging, I found out this error is because pbm can not find the fixed journal folder. I saw some discuss about make journal folder configurable a year ago. While on current master branch, journal folder is fixed in /data/db/journal. So I add some softlink to bypass this error and can make physical backup succeed. Wooha~
However, while restoring, the cluster state can not be ready anymore. digging…
I assume you have dbpath assigned to /data/db. Then PSMDB will use /data/db/key.db only if you enabled data at rest encryption. Thus we have situation when data at rest encryption is enabled but /data/db/key.db does not exist.
I have no idea how this happened on you machine. key.db subdir is created when you start PSMDB for the first time with empty dbpath and is never deleted by PSMDB.
Probably you enabled encryption when your dbpath dir was already initialized? This scenario is not supported because existing unencrypted instance cannot be switched to encrypted mode.
Hello, @Igor_Solodovnikov
You are right that my instance enabled data at rest encryption by default. My situation is /data/db/key.db exist while /data/db/key.db/journal does not exist. Since physical backup will copy journal file from /data/db/key.db/journal with data at rest encryption enabled, I have to add a soft link to bypass this error.
Blockquote cd /data/db/key.db && ln -s …/journal journal