Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Aug 2005 11:41:31 +0400
From:      Dmitriy Kirhlarov <dimma@higis.ru>
To:        Anton Nikiforov <anton@nikiforov.ru>
Cc:        freebsd-cluster@freebsd.org
Subject:   Re: DRBD-like something for FreeBSD
Message-ID:  <20050804074117.GG46130@torch.higis.ru>
In-Reply-To: <42F1105B.5040507@nikiforov.ru>
References:  <42EE559A.3080000@nikiforov.ru> <42EE7813.8020902@centtech.com> <42F1105B.5040507@nikiforov.ru>

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

--4zI0WCX1RcnW9Hbu
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi Anton!

On Wed, 03 Aug 2005, Anton Nikiforov wrote:

> not see the way to promote second node as prymary in case of real=20
> prymary crashed. Or i should test it with vrrpd (for example) and=20
> restart secondary as ggated instead of being ggatec? Did not clear yet.=
=20
> If you have the solution or an idea - could you please drop me a line?

Yes.
/usr/ports/net/freevrrpd

> algorythm looks the following for me:
> We have two computers:
> stage 0 (up and running claster)
> 1. da0 is exported via ggated over the network.
> This computer runing postgresql (for example) that storing data on da0.
> 2. da1 is being imported over network via ggatec as da1. Local da0 and=20
> remote da1 are mirrored via ggated/geom_mirror.ko
> and there is no service activity on this device. just a mirroring of data.

No.
When you work with ggate{c,d} you get devices ggate{0,1,2,...}. Not with da=
1.

> stage 1 (slave failed)
> 1. working as before
> 2. down
> Requests to update remote data failed. There should be no problem.
>=20
> stage 2 (slave is coming up)
> 1. working as before
> 2. booting and starting to mirror date from the master
> in case secondary goes down and up again there are no troubles. it just=
=20
> boots itself in the stage0 config. that is it

When slave is start you can rebuild mirror on the fly.
But it get many time (in my case) -- 54Gb slice rebuilded slow :(

> stage 3 (master is down)
> 1. down
> 2. should consider master is down and stop ggatec, then start ggated and=
=20
> export the da0. Then mount da0 and start PostgreSQL.

when master down, then freevrrpd can run script on slave machine.

> stage 4 (master coming up)
> 1. Should understand it is not the master anymore and start ggatec and=20
> mirror remote data to the local drive.
> 2. running as a master. with services moved/started at stage 3
> Here troubles begins. When bouth become synchronized the service that=20
> was running on this disk shoul be moved from 2 to 1. to do that i'll=20
> have to restart services in stage 0. But how? using vrrpd? or some other=
=20
> utility? How can i understand that the system is ready to get the=20
> Postgresql back to 1 and stop it on 2?

Yes. vrrp -- your friend. But moving from node2 -> node1, when node1 coming=
 up bad idea. Service must continue to run on node2.

> stage 5 (bouth down, master coming up first)
>=20
> stage 6 (bouth down, slave is coming up first)

My algoritm.
No difference between master and slave in start time.
We have:
/etc/rc.conf -- this file identical on both nodes. Many parametes in it and=
 2 includes:
/etc/rc.clh -- specific addreses and specific params for every node.
/etc/rc.cluster -- simlink dinamically switching between:
/etc/rc.custer.master or /etc/rc.cluster.slave

If we can ping shared IP, when starting -- we start as slave. In not -- mas=
ter.
We start freevrrpd with master or slave config (see /etc/rc.d/freevrrpd).
/etc/rc.d/freevrrpd run after network start, but before all daemons.
It work in RELENG_5* with new style rc-scripts.

/boot/loader.conf have different autoboot_delay on different nodes (bad gua=
rantee what important start-ping not run in one time on both machines)

> This is main confuse. Maybe i did not read mutch, but it is not clear=20
> for me, how to inderstand which drive contain the last data?

Yes. It's a problem in one case:
reboot node0 and reboot node1, when mirror not fully synchronize.

See attached scripts -- this my experiments. It have some known and, my be =
unknown issues:
 - in /usr/local/ifstated/bin/ggatec-gmirror.sh script I can't get unit nam=
e with one line:
ggate=3D`/sbin/ggatec ${ggatec_flags}`
 - when I restart /etc/rc.d/freevrrpd many time I get many ggate devices.
 - parametert for ggate{c,d} may be not ideal, but it work on gigabit inter=
connect.
 - I can't undestand what I must open on firewall for freevrrpd.

By.
Dmitriy=20

--4zI0WCX1RcnW9Hbu
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="cluster.tbz2"
Content-Transfer-Encoding: base64

QlpoOTFBWSZTWaJchtEADN1/5ey0AKB/////P///7/////4AgIEAAAEBQgAIYBH99W1d2fe9
PYAvHK27sc9d3jhrq60d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