Clustering across multiple machines - duplicate key errors
Solved
Technical Support
-
I have nodeBB running on a couple of machines with a shared db and redis instance. However, I occasionally see errors in the logs indicating that there were duplicated writes attempted.
For example,:
MongoBulkWriteError: E11000 duplicate key error collection: nodebb.objects index: _key_1_value_-1 dup key: { _key: "analytics:logins", value: "1708077600000" }
Do I have something misconfigured?
-
Make sure you add
jobsDisabled: true
to all the machines except one so they don't run jobs.That error is usually fine since multiple machines will try to write out their analytics at the same time. The ones failing will retry and it will work on the second try.
-
Copyright © 2024 NodeBB | Contributors