[Bucardo-general] Replication problems? data overwritten?
eric machine
eric.machine at hotmail.com
Mon Aug 26 14:03:25 UTC 2013
Hi Michelle,
Thanks for the kind opinion.
I tried below here.
bucardo install
bucardo add database dbbranch1 host=192.168.56.12 dbname=branch1
bucardo add database dbbranch2 host=192.168.56.13 dbname=branch2
bucardo add database dbbranch3 host=192.168.56.14 dbname=branch3
bucardo add database dbhq host=192.168.56.11 dbname=dbhq
bucardo add all tables db=dbhq -T nopktable herd=therd
bucardo add dbgroup tgroup dbbranch1:source dbbranch2:source dbbranch3:source dbhq:target
bucardo add sync foobar herd=therd dbs=tgroup ping=false autokick=0 checktime=300
bucardo validate foobar
bucardo start
bucardo kick foobar
bucardo status
bucardo update sync foobar autokick=1
bucardo reload config
a) It works. But weird? I insert couple of records after entering the above commands. How come the first 1 - 2 minutes, show records not found. After that, it will show good status. Any idea why?
b) I have set dbhq as the only target. But how come when I insert data into dbbranch2, the data get replicated into both dbbranch1 and dbhq? Any idea why?
c) to get my data replication working, I manually go to each dbs above and set sequence id as follows.
hq:
ALTER SEQUENCE $schema start with 1 maxvalue 999999999;
dbbranch1:-
ALTER SEQUENCE $schema start with 1000000000 maxvalue 1999999999;
SELECT setval('$schema'::regclass, (select last_value from $schema) + 1000000000);
dbbranch2:-
ALTER SEQUENCE $schema start with 2000000000 maxvalue 2999999999;
SELECT setval('$schema'::regclass, (select last_value from $schema) + 2000000000);
dbbranch3:-
ALTER SEQUENCE $schema start with 3000000000 maxvalue 3999999999;
SELECT setval('$schema'::regclass, (select last_value from $schema) + 3000000000);
Note: my assumption is i doubt each database will ever hit sequence of 1 billion records. Plus the sequence maxvalue is bigint. I assume this works right?
Is this the best practice? odd and even only work for 2 databases. Now I have 4 databases.
d) For autokick, how come I can't set this at the first time?
bucardo add sync foobar herd=therd dbs=tgroup ping=false autokick=1 checktime=300 // this won't work? if I do "bucardo status all", it will show autokick = no
but once I do the "bucardo update sync foobar autokick=1", then it will set autokick = 1. That's weird.
e) for production use, should i run a .sh script for the above commands?
Thanks in advance :)
> Date: Mon, 26 Aug 2013 01:28:26 +0200
> From: michelle at sorbs.net
> Subject: Re: [Bucardo-general] Replication problems? data overwritten?
> To: eric.machine at hotmail.com
> CC: josh at endpoint.com; bucardo-general at bucardo.org
>
> eric machine wrote:
> > Thanks Joshua.
> >
> > I have some problems here. My sync is not that consistent.
> >
> > 2 out of 10 when I run "bucardo status", I will see "good" status.
> >
> > if I try to "delete existing bucardo db" and do "bucardo install"
> > again. Follow 100% same way.
> >
> > 8 out of 10, I will get this problem.
> >
> > Name State Last good Time Last I/D Last
> > bad Time
> > ========+==================+============+=======+===========+===========+=======
> > foobar | No records found | | |
> > | |
> >
> > Any idea why I keep getting no records found? I can't figure out what
> > went wrong.
> >
> > if I do "bucardo status all", this what i get.
> >
> > ======================================================================
> > Sync name : foobar
> > Current state : No records found
> > Source relgroup/database : therd / dbbranch
> > Tables in sync : 937
> > Status : Active
> > Check time : None
> > Overdue time : 00:00:00
> > Expired time : 00:00:00
> > Stayalive/Kidsalive : Yes / Yes
> > Rebuild index : No
> > Autokick : No
> > Onetimecopy : No
> > Post-copy analyze : Yes
> > Last error: :
> > ======================================================================
>
> When running with 'AutoKick No' and having a set sync time the status
> will be updated to indicate the last sync. If there were no changes
> there will be 'no records found'.. If you turn off the check time (or
> set it to something like 10 minutes - like I do) and set AutoKick on you
> will find that until the Checktime is elapsed with no changes your
> status will always show records. (ie: if you set checktime to 10 minutes
> and autokick on, check the 'state' you'll find changes are replicated
> whenever there are updates to the tables, if you then wait without any
> table changes for the 10 minutes, the status will be updated to 'No
> records found')
>
>
> Michelle
>
> --
> Michelle Sullivan
> http://www.mhix.org/
> I
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20130826/814d46ca/attachment.html>
More information about the Bucardo-general
mailing list