- MongoDB 8 as a replica set (it uses transactions). Three members spread over three nodes survive the loss of a node; one member also works.
- Redis 7, one server with AOF persistence. Redis holds the edits that are not yet written to MongoDB, the sessions, and the messages between Overleaf services. Overleaf connects to a single Redis server: Sentinel and Redis Cluster are not supported.
You can use managed services instead, such as MongoDB Atlas or your cloud’s Redis. Skip this page and set
OVERLEAF_MONGO_URL and OVERLEAF_REDIS_HOST to them in step 4.1
MongoDB
10-mongo.yaml
PRIMARY and the others SECONDARY after a few seconds. The Job retries until all members answer, so a few failed Job pods are normal.- The headless Service needs
publishNotReadyAddresses: true: the members must find each other by name before the replica set exists. - The members are added with their stable names (
mongo-0.mongo.overleaf.svc.cluster.local), never pod IPs, which change on every restart. - For a single member, set
replicas: 1and keep onlymongo-0in the Job.
2
Redis
20-redis.yaml
Q&A
MongoDB 8 crashes at startup on a recent kernel. Why?
MongoDB 8 crashes at startup on a recent kernel. Why?
Answer: MongoDB 8 fails on Linux kernel 6.19 and later (SERVER-121912). Uncomment the
GLIBC_TUNABLES environment variable in 10-mongo.yaml.How much memory does MongoDB need?
How much memory does MongoDB need?
Answer: By default MongoDB uses half of the node’s memory minus 1 GB for its cache, and it sees the node’s memory, not the pod’s limit. Set
--wiredTigerCacheSizeGB to fit your nodes; 0.25 kept each member at about 200 to 260 MiB on our 4 GB test nodes.
