From owner-freebsd-questions@FreeBSD.ORG Mon May 11 19:53:09 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 606C8106564A for ; Mon, 11 May 2009 19:53:09 +0000 (UTC) (envelope-from doug@polands.org) Received: from hrndva-omtalb.mail.rr.com (hrndva-omtalb.mail.rr.com [71.74.56.123]) by mx1.freebsd.org (Postfix) with ESMTP id 1D9468FC21 for ; Mon, 11 May 2009 19:53:08 +0000 (UTC) (envelope-from doug@polands.org) Received: from haran.polands.org ([75.87.219.217]) by hrndva-omta02.mail.rr.com with ESMTP id <20090511194101635.MBWC24998@hrndva-omta02.mail.rr.com>; Mon, 11 May 2009 19:41:01 +0000 Received: from email.polands.org (moab.polands.org [172.16.1.8]) by haran.polands.org (8.14.3/8.14.3) with ESMTP id n4BJSrFV027978; Mon, 11 May 2009 14:28:53 -0500 (CDT) (envelope-from doug@polands.org) Received: from 69.129.174.18 (SquirrelMail authenticated user djp) by email.polands.org with HTTP; Mon, 11 May 2009 14:28:53 -0500 (CDT) Message-ID: In-Reply-To: <4A087A57.1050202@optiksecurite.com> References: <4A01DBCE.9070304@optiksecurite.com> <20090506150933.d0ef0178.wmoran@potentialtech.com> <4A087A57.1050202@optiksecurite.com> Date: Mon, 11 May 2009 14:28:53 -0500 (CDT) From: "Doug Poland" To: "Martin Turgeon" User-Agent: SquirrelMail/1.4.17 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Cc: Bill Moran , "freebsd-questions@freebsd.org" Subject: Re: Advices for a jailed MySQL server X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2009 19:53:09 -0000 On Mon, May 11, 2009 14:19, Martin Turgeon wrote: > Bill Moran a écrit : >> In response to Martin Turgeon : >> >>> Hi everyone, >>> >>> I'm starting to build a new dedicated MySQL server. I will be >>> using FreeBSD 7.2-REL. My plan is to jail the latest version of >>> MySQL 5.0 and to put the MySQL data outside the jail. My >>> objective is to be able to update MySQL without down time. My >>> objective would be to create another up to date MySQL jail and >>> when I'm ready to make the switch, just point the new jail to the >>> data outside the jail using something like a nullfs mount. >>> >>> Is someone using something like this? >>> >>> Did someone have any advice about how to update a MySQL server >>> without down time? >>> >>> Did someone have any advice on how to tune a dedicated MySQL >>> server running FreeBSD 7.2 (Dual core Xeon, 4G RAM, mirror RAID >>> on a PERC5 controler 2x146G 15K)? >>> >>> Thanks everyone for sharing your precious knowledge :) >> >> I expect that what you're trying to do will work, however it's >> horrifically error-prone during the upgrade procedure (what if you >> forget to stop the first MySQL before you start the new one!) >> >> If you need to do anything zero-downtime, then you probably want to >> run multiple MySQL instances and use database replication to keep >> the data in sync. That way you just switch which DB is master, >> then upgrade the slave ... rinse/repeat. >> > > Hi and thanks for your reply. Sorry for the late response... > > I thought about the risk of the procedure and that's why I asked here > hoping that someone had a better idea! > > Do you mean to have another jail with an up to date slave MySQL, get > it in sync with the master and then switch the config file of the > slave to make it a master, restart the new MySQL, change the config > so that the apps are connecting to the new DB? > You may want to research using MySQL in "dual-master" mode. In this architecture, each MySQL instance is both a master and a slave. Some care must be taken in the configuration but is well-documented and googalable. I recently deployed such a configuration using a jail for each instance. Upgrading from 5.1.33 to 5.1.34 was a snap and there was no down time. In my case, I use a DNS CNAME to identify the "master" instance that all clients access. -- Regards, Doug