[LUGOS] mysql kro??na replikacija

Matija Grabnar matija.grabnar at arnes.si
Sat Jul 17 12:53:47 CEST 2004


On Sat, Jul 17, 2004 at 08:06:50AM +0200, Jure Koren wrote:
> > Torej ??elel bi nekak??no kro??no replikacijo (ni nujno, le da se spremembe
> > poznajo na vseh, neglede na to na katerem izvr??im INSERT al pa UPDATE) brez
> > posamezne to??ke izpada.

> Trenutno mysql 4.x ne podpira nobene pametne sheme za repliciranje.
> Postgresql je boljsi in zanj obstajajo aplikacije, ki lahko izvajajo

Ne bo drzalo:
Ce pogledas http://dev.mysql.com/doc/mysql/en/Replication_Features.html, si 
lahko preberes:
====citat====
# It is safe to connect servers in a circular master/slave
relationship with the --log-slave-updates option specified. Note,
however, that many statements will not work correctly in this kind of
setup unless your client code is written to take care of the potential
problems that can occur from updates that occur in different sequence
on different servers. This means that you can create a setup such as
this:

A -> B -> C -> A

Server IDs are encoded in the binary log events, so server A will know
when an event that it reads was originally created by itself and will
not execute the event (unless server A was started with the
--replicate-same-server-id option, which is meaningful only in rare
setups). Thus, there will be no infinite loop. But this circular setup
will work only if you perform no conflicting updates between the
tables. In other words, if you insert data in both A and C, you should
never insert a row in A that may have a key that conflicts with with a
row inserted in C. You should also not update the same rows on two
servers if the order in which the updates are applied is significant.
====konec citata====
Torej lahko naredis zadevo tako kot si zamisljas. 

Edini problem ki ga vidim je, ce se tvoje omrezje razpade na dva dela
(nekaj streznikov v LJ, nekaj v MB, bager na trojanah) in ti skusas
delati insert na obeh koncih. To lahko preprecis edino tako, da 
pri insertih, kjer nastopi auto_increment ID zadevi dodas se ID 
masine, na kateri si pisal. Malce bolj pazljiv je treba biti, 
pa gre...

Matija



More information about the lugos-list mailing list