Failover switch

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
Centuries
New user
New user
Posts: 14
Joined: 2014-09-02 07:13

Failover switch

Post by Centuries » 2014-09-02 07:46

Hi All,

May I check following questions with you:

Scenario 1.
We got two separate physical servers set up, Server1 and Server2 in one site separately connected with high speed LAN. Both of them are Windows 2012 + SQL Server 2014 + hMailServer. The purpose is to set Server1 active, and Server2 standy.
Imaging there is an running email broadcasting covering about 1000 emails (not junk emails), and somehow the Server1 corrupts, and we have to switch it to Server2 and continue the on-going email broadcasting.

Question1.1 for this scenario is, besides following preparation:
  • 1.Copy hMailServer Configuration.
    2.The database and hMailServer Data Directory have been synchronized from Server1 to Server2.
    3.Check that the Windows Firewall is not blocking traffic to hMailServer.
    4.Update any MX record which was pointing at the old host name.
    5.Update the host name in the hMailServer configuration (if it has changed).
Anything else I need to ensure?


Question1.2 for this scenario is:
How to ensure the Server2 can continue automatically sending the remaining emails(which are not delivered yet from Server1), instead of re-sending all the 1000 emails from the beginning. If the SQL Server Replication(to backup the database) , and the built-in backup of hMailServer(to backup the Data Directory) is enough to secure no latency which may cause the inconsistency of the email queue?
Or it is not possible technically?




Scenario 2.
Same configuration as Scenario 1, but both the Server1 and Server2 will function actively sending broadcast emails(not junk emails again). However, to ease the load pressure of each server, Server1 will serve for Email Group 1, and Server2 will serve for Email Group 2. In the case Server1 fails, the Server2 needs to take over the remaining task of Email Group 1(namely the Server2 will need to not only proceed the Email Group 2 but also continue the Email Group 1 for those undelivered emails).
Question2.1 for this scenario is:
Technically is that possile? If possible, what needs to configured, or what script needs to be prepared (which can be run when the cluster identify the Server1 is down).


Appreciate your opinions in advance.

User avatar
mattg
Moderator
Moderator
Posts: 20289
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Failover switch

Post by mattg » 2014-09-02 12:32

Hmailserver is not supported for these scenarios

You should look at server replication from an OS level
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
SorenR
Senior user
Senior user
Posts: 3228
Joined: 2006-08-21 15:38
Location: Denmark

Re: Failover switch

Post by SorenR » 2014-09-02 13:29

How do you ensure that database and file storage is fully synchronised in case of a "crash" if you have to maintain "duplicates?

Not sure you can do this 100% without a dedicated database server and a SAN thus making this a 4 box solution (virtual or physical).

Moving IP addresses between Server 1 and Server 2 is also an issue as the IP address must match the A and MX record as well as the HELO string in the server.

A mailserver is not a "time critical" application, so if the Mailserver application stalls or hangs, it could be sufficient simply rebooting the server - or if the Mailserver runs in a VMWare image, simply kill the image and load a new image.

Just my 0,01 €
SørenR.

“With age comes wisdom, but sometimes age comes alone.”
- Oscar Wilde

Centuries
New user
New user
Posts: 14
Joined: 2014-09-02 07:13

Re: Failover switch

Post by Centuries » 2014-09-02 14:51

mattg wrote:Hmailserver is not supported for these scenarios

You should look at server replication from an OS level

Thanks,

I noticed there is one document mentioned that 'The hMailServer delivery queue consists of two parts, the queue message list in the database and the actual messages in the data folder' , do you think we can rely on the Queue Message List (in the database) and consider it as a flag: namely when the Master Server is Active, then we keep the Queue Message List as invalid by changing the table name(for instance, and in this way the hMailServer will not be able to deliver the emails out, correct?) until the Master Server fails and Slave Server take over the job. The reason to have such complex idea is there is specific requirement behind that.


Or I will have to rely on the OS level redundancy mechanism.

User avatar
mattg
Moderator
Moderator
Posts: 20289
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Failover switch

Post by mattg » 2014-09-02 15:54

mattg wrote:You should look at server replication from an OS level
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

percepts
Senior user
Senior user
Posts: 5282
Joined: 2009-10-20 16:33
Location: Sceptred Isle

Re: Failover switch

Post by percepts » 2014-09-02 16:51

mattg wrote:
mattg wrote:You should look at server replication from an OS level
+1

You are thinking you can make hmailserver do something it simply isn't designed to do.

prisma
Senior user
Senior user
Posts: 310
Joined: 2010-07-09 13:16

Re: Failover switch

Post by prisma » 2014-09-04 15:39

Setup hmailserver within a Hyper-V-VM and replicate the VM to another server. It's all build-in in Server2012. No extra license for the VM is needed, one virtualization per host is covered by the standard server license. No active directory needed, no special hardware needed.

We use replication since 2 years without any issue. If you already use active directory, you could think about an 2 node active-passive cluster. Replication has no automatic fail-over, but needs no AD. Hyper-V-Cluster support automatic fail-over, but needs AD. Furthermore you need 3 NICs for a cluster. Replication can be done using a single NIC.

All build-in Server 2012, awesome OS.

Centuries
New user
New user
Posts: 14
Joined: 2014-09-02 07:13

Re: Failover switch

Post by Centuries » 2014-09-06 15:13

prisma wrote:Setup hmailserver within a Hyper-V-VM and replicate the VM to another server. It's all build-in in Server2012. No extra license for the VM is needed, one virtualization per host is covered by the standard server license. No active directory needed, no special hardware needed.

We use replication since 2 years without any issue. If you already use active directory, you could think about an 2 node active-passive cluster. Replication has no automatic fail-over, but needs no AD. Hyper-V-Cluster support automatic fail-over, but needs AD. Furthermore you need 3 NICs for a cluster. Replication can be done using a single NIC.

All build-in Server 2012, awesome OS.

Thanks.
Cluster is the option am thinking at. Need to set up an environment to test it.

prisma
Senior user
Senior user
Posts: 310
Joined: 2010-07-09 13:16

Re: Failover switch

Post by prisma » 2014-09-07 00:33

Since 2012 R2 the fileserver role is supported as scale-out fileserver on a CSV. I manged to mix the fileserver role with generic clusterservice. The result was hmailserver and postgres runnig as clusterservice on a shared storage. super cool. But I wasn't completly sure this scenario is supported by microsoft. The reason was postgres with its database files on a CSV. With a clustered MSSQL you should be safe...

But if you need only 95% performance you should choose the hyper-v-VM on a cluster using CSV. Much more easier to handle. My personal opinion.

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: Failover switch

Post by martin » 2014-09-07 10:33

That sounds nice Prisma. I'm running some hMailServer's in EC2, wonder what the perf would be setting up HyperV there, considering that those environments are already emulated.

prisma
Senior user
Senior user
Posts: 310
Joined: 2010-07-09 13:16

Re: Failover switch

Post by prisma » 2014-09-09 12:52

Did I understand right? You want to setup Hyper-V within a EC2 instance? Hmmm, if this works, this only could work on HVM instances, couldn't it? I think it's not possible to put a hypervisor on top of a PV machine. Even not sure if it's possible to put a hypervisor on top of a HVM instance...

Do you have AD activated, or are these servers standalone servers?

Post Reply