question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running Wildduck instances on multiple servers.

See original GitHub issue

Hi *,

I want to run two Wildduck instances on two different physical servers. The first one should be the main mail server and the second one should serve as a backup mail server, accepting mail in case the first mail server is down. Hence I want both servers to have identical data. Does anyone know how to do this, especially regarding mongodb and redis? @andris9 do you have any suggestions on this one? Any information is appreciated.

What I already looked into

All mails are stored in the mongodb database, therefor the database has to be synchronized between both servers. I’ve figured out, that mongodb has a feature called replication set that does exactly what I need.

I do not know what the corresponding concept is called for redis though or if I need to replicate the information in redis at all (haven’t looked into the code yet).

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
andris9commented, Jan 23, 2020

With 2 servers you could run Redis in a “normal” 1 master - 1 slave configuration without Sentinel and also 2 node MongoDB replica set (with or without arbiter). If one of these servers goes down then:

  1. If the invalid server was running Redis Master, then configure Redis Slave to be new master (by running REPLICAOF NO ONE command in the former slave instance). Also modify WildDuck config files to use the new server as Redis host.
  2. Unless you used MongoDB arbiter setup and the server with arbiter is still up then MongoDB goes down even if the remaining server was primary as it does not have enough quorum votes. So you would have to modify the replica set by removing the invalid instance from cluster configuration using rs.remove() command. Once you have a replica set with a single server then you have enough votes and the instance could become primary again.
0reactions
rqelibaricommented, Jan 23, 2020

Thank you all. I think @andris9 did explain the possible solutions to this issue very thoroughly. I for myself will use a three server setup to have automatic failover.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WildDuck Mail Server – Self hosted modern mail server
All WildDuck instances are stateless, so to increase throughput, you could add more WildDuck application servers behind a TCP load balancer, no need...
Read more >
wildduck/README.md - UNPKG
Start as many instances as you want. You can start multiple Wild Duck instances in different machines and as long as they share...
Read more >
Running multiple server instances on a single system - IBM
To run multiple server instances on a single system, set up separate database and recovery log directories for each server instance.
Read more >
nodemailer/wildduck - Gitter
So in your case, assuming you have used setup scripts to install WildDuck, ... what happens if multiple wild-duck instances try to unsnooze...
Read more >
Lame Duck Mode - NATS Docs
Some maintainer supported clients will invoke an optional callback indicating that a server is entering lame duck mode. This is used for cases...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found