Forum OpenACS Q&A: Re: PostgreSQL database replication just by transfering/mirroring the files

Sounds like you're trying to replicate what DRBD already does:

I haven't tried DRBD with PostgreSQL yet, but it should be a good experiment. DRBD acts as a block device that copies all changes made to it to other machines via a dedicated network. RAID 1 over a network. This would work if you made sure the PostgreSQL on the secondary machine does not make any writes to the data.

Now, why are you doing this through kernel modules? Is slony-i not sufficient for your needs?


i'm working on project of file system replication and done with that.. i replicate files on machine A to machine B on network as soon as any file is modified on machine A..

so i want to apply this concept further to databases.

i've tried by many ways.. that worked in replicating databases..

one way i used recently is like this...

i have two machies A and B on network.. with postgres installed on machine A and B,
with postmaster on B off..

now i keep track on all files in data directory of postgresql database on machine A

i mirror all files on machine A db dir to machine B(Except xlog dirctory.. big file causess bandwidth problem)

when i might need database back (in case of physical damage on machine A) i call "pg_resetxlog" on machine B to avoid consistency issues generated by not consistent xlog files..

then i start Postmaster on machine B and get my database back...

anyproblem with this approch..??

earlier i mirrored xlog too.. that ofcourse, did work.. but wasted time in patching the big xlog files each time..

(btw i've to stick to file system replication approach, thats part of my project)