From owner-freebsd-questions@freebsd.org Wed Jan 17 00:32:12 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C65B2EC2C2F for ; Wed, 17 Jan 2018 00:32:12 +0000 (UTC) (envelope-from freebsd@theory14.net) Received: from bacon.theory14.net (bacon.theory14.net [45.55.200.27]) by mx1.freebsd.org (Postfix) with ESMTP id 831B674A6F for ; Wed, 17 Jan 2018 00:32:12 +0000 (UTC) (envelope-from freebsd@theory14.net) Received: from remote.theory14.net (remote.theory14.net [173.79.116.36]) by bacon.theory14.net (Postfix) with ESMTPSA id CB8CA125ECA; Tue, 16 Jan 2018 19:32:05 -0500 (EST) Received: from anubis.int.theory14.net (anubis.int.theory14.net [192.168.10.50]) by remote.theory14.net (Postfix) with ESMTPS id 898B33417; Tue, 16 Jan 2018 19:32:05 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=theory14.net; s=mail; t=1516149125; bh=+B+FhoKLpfdo+TT1drnPQn7w3k0t04hZ+aF+B+TUSK0=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=d/IP2nZbxs0hTddyh13YnSJz/n6f7LCZHEuh9JONN04y4+BGV6IR/PB2dOvvAmo1P FwA8dVh8HCsCRFHFeySLgtu6JC713TiuIarMlF0Lj8IEQM2w6aFPyPB9mvjZrSk8ha 6M2kTSOYndmkDLIxTR8bOe8Fm/Qdrh4qvHkW5JiM= Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: HAST questions From: Chris Gordon In-Reply-To: Date: Tue, 16 Jan 2018 19:32:05 -0500 Cc: freebsd-questions@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <6C4AA002-7CB2-4506-AA7C-722083197BA0@theory14.net> References: <1DFDF803-4D86-42F8-A22E-4A9077608982@theory14.net> To: "Zainelabdeen S.A Elgraeed" X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 00:32:12 -0000 > On Jan 12, 2018, at 1:10 AM, Zainelabdeen S.A Elgraeed = 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