Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jan 2018 19:32:05 -0500
From:      Chris Gordon <freebsd@theory14.net>
To:        "Zainelabdeen S.A Elgraeed" <zainco30@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: HAST questions
Message-ID:  <6C4AA002-7CB2-4506-AA7C-722083197BA0@theory14.net>
In-Reply-To: <CAMq=vKGjoheaiS-0TaVj-RH3MUiXwYdC656nuMpJM4y_VwfU5w@mail.gmail.com>
References:  <CAMq=vKEbUeZL9DsutYZ4guMdPk9yK2YjLpsGwWzp1f7nuiBoBQ@mail.gmail.com> <1DFDF803-4D86-42F8-A22E-4A9077608982@theory14.net> <CAMq=vKGjoheaiS-0TaVj-RH3MUiXwYdC656nuMpJM4y_VwfU5w@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

> On Jan 12, 2018, at 1:10 AM, Zainelabdeen S.A Elgraeed =
<zainco30@gmail.com> wrote:
>=20
> > It really depends on the details of the application on what options =
you have and what the best way to do this may be.
> we host dynamic content with MySQL databases like Moodle and OJS.
>=20
> I want for storage to be active/active but HAST is master/backup so I =
can be used for failover only.
> is HAST support DRBD ? or what another technology can use for HA and =
LB for storage?


The exact solution can be somewhat dependent on your specific =
environment, but I=E2=80=99d start looking at:

- Run the web servers (apache, nginx, whatever) active in both/all jails =
and distribute traffic to them with some kind of load balancer =
(commercial appliance, other machines running ha-proxy or the like).
- Run one master DB and one standby DB with database replication =
replicating content between the two.  Most RDBMs support some kind of =
replication including MySQL.
- With MySQL you can do reads from both the active and standby nodes, =
but write to only the master.  It depends on your particular application =
if/how you can configure the application to take advantage of the slave =
reads.
- In the event of the failure of one of the hosts, you only need to =
worry about switching the roles of the DB and potentially re-pointing =
the applications if the primary DB node is the one that goes away.
- I would consider putting the database servers and web servers in =
different jails.  This lets you scale them, add resource controls if =
appropriate, move them, etc independently.

I prefer database/application replication over storage replication in =
most use cases since storage replication will often dutifully =
replication file system and other problems for you.  Database =
replication typically gives you some additional independence between =
your nodes and reduces certain chances of fault replication.  Regardless =
of which you choose, you need to make sure you exercise and understand =
the many failure cases you can end up in and know how to recover the =
system.  Also remember that replication like this is NOT a backup -- be =
sure to also have a good back (and recovery) plan.

Active/Active is another can of worms.  Active/Active storage for writes =
is a very difficult problem.  Even if someone said they have it, I=E2=80=99=
d be very careful with all of the corner cases and failure modes.  =
Active/Active databases do exist (MySQL has Galera, I believe Postgres =
has a paxos based solution), but again you get a lot of additional =
complexity and need to really understand and test the solution before =
using it.

Hope that helps.

Chris







Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6C4AA002-7CB2-4506-AA7C-722083197BA0>