Guys,
I've already read this, and understand the difference between MirrorMode and Multi Master. http://www.openldap.org/doc/admin24/replication.html
Actually, when I setup 2-nodes MirrorMode and add too much entries to both nodes, at the same time, sometimes both databases weren't syncrhonized correctly. (I made a script to add 10,000 entries, and run it on both nodes at the same time.)
In this case, we shouldn't update both nodes at the same time. and of course this is already discribed in the document as following.
-------------------------------------------------------- MirrorMode is not what is termed as a Multi-Master solution. This is because writes have to go to just one of the mirror nodes at a time --------------------------------------------------------
but on some cases(including my environment), UPDATE happens 3-10 times in a day. it's much less than SEARCH. in this case, I think we can just put loadbalancer, and enable "load balancing" and "redundancy" (I understand UPDATE isn't load balanced.)
-------------------------------------------------------- CLIENT | SLB(RoundRobin) | +-----+ SRV1 SRV2
* MirrorMode is enabled on SRV1 and SRV2 --------------------------------------------------------
My question is, MirrorMode document says "writes have to go to just one of the mirror nodes at a time." but if the writes don't happen very often, I think "writes can be done on every nodes at a time."
When I did some tests, it could be done. but I'm not sure developer's thoughts. How do you think guys ?
Hideo NAKAMITSU wrote:
My question is, MirrorMode document says "writes have to go to just one of the mirror nodes at a time." but if the writes don't happen very often, I think "writes can be done on every nodes at a time."
When I did some tests, it could be done. but I'm not sure developer's thoughts. How do you think guys ?
If the period between updates is always longer than the propagation delay between servers, then it will make no difference.
Hello Howard,
Thanks for you reply.
On Sat, 27 Jun 2009 07:50:15 -0700 Howard Chu hyc@symas.com wrote:
Hideo NAKAMITSU wrote:
My question is, MirrorMode document says "writes have to go to just one of the mirror nodes at a time." but if the writes don't happen very often, I think "writes can be done on every nodes at a time."
When I did some tests, it could be done. but I'm not sure developer's thoughts. How do you think guys ?
If the period between updates is always longer than the propagation delay between servers, then it will make no difference.
The point is this "period". sec, microsec, less ?
I wrote following 2 simple scripts to update 2 notes at the same time to know data corruption. both of them will add LDAP 10,000 entries but the difference is,
add_many1.sh will add 10,000 entries with one ldapadd command(LDAP tcp session) and in my environment, throughput was 47 entries/sec add_many2.sh will run 10,000 times of ldapadd command. obviously this is slower than add_many1.sh. throughput was 33 entries/sec
when I run add_many1.sh, database wasn't synchronized correctly, but in case of add_many2.sh, it could be synchronized perfectly every time.
from my test, the result was this. -------------------------------------------------------- If the adding throughput was 47 entries/sec, couldn't write both nodes at the same time. but if it was 33 entries/sec, it could be written at the same time.
you know adding 33 entries/sec is much heavier than normal ldap server. which means, if the ldap servers don't have too much add/modify operation in a day, both of then can be written at the same time. --------------------------------------------------------
thoughts ?
add_many1.sh -------------------------------------------------------- #!/bin/sh i=0 host=`hostname --short` while [ $i -lt 10000 ]; do echo "dn: cn=${host}_${i},ou=people,dc=example,dc=com" echo "objectClass: person" echo "cn: ${host}_${i}" echo "sn: ${host}_${i}" echo "" i=`expr $i + 1` done --------------------------------------------------------
how to run add_many1.sh -------------------------------------------------------- # on one host ./add_many1.sh | ldapadd -x -D "cn=Manager,dc=example,dc=com" -w secret # on the other host ./add_many1.sh | ldapadd -x -D "cn=Manager,dc=example,dc=com" -w secret --------------------------------------------------------
add_many2.sh -------------------------------------------------------- #!/bin/sh i=0 host=`hostname --short` while [ $i -lt 10000 ]; do ldapadd -x -D "cn=Manager,dc=example,dc=com" -w secret <<EOF dn: cn=${host}${i},ou=people,dc=example,dc=com objectClass: person cn: ${host}${i} sn: ${host}${i} EOF i=`expr $i + 1` done --------------------------------------------------------
how to run add_many2.sh -------------------------------------------------------- # on one host ./add_many2.sh # on the other host ./add_many2.sh --------------------------------------------------------
On Sat, Jun 27, 2009 at 11:56 PM, Hideo NAKAMITSU nomo@bluecoara.netwrote:
Guys,
I've already read this, and understand the difference between MirrorMode and Multi Master. http://www.openldap.org/doc/admin24/replication.html
Actually, when I setup 2-nodes MirrorMode and add too much entries to both nodes, at the same time, sometimes both databases weren't syncrhonized correctly. (I made a script to add 10,000 entries, and run it on both nodes at the same time.)
In this case, we shouldn't update both nodes at the same time. and of course this is already discribed in the document as following.
MirrorMode is not what is termed as a Multi-Master solution. This is because writes have to go to just one of the mirror nodes at a time
but on some cases(including my environment), UPDATE happens 3-10 times in a day. it's much less than SEARCH. in this case, I think we can just put loadbalancer, and enable "load balancing" and "redundancy" (I understand UPDATE isn't load balanced.)
Update is not load balanced, but it could be. You could have a "read only" balance rule, and a "read write" balance rule, either on sererate ip or seperate port. They would both point to the same servers, but the balance rules would act differently based on the selectioj of ip / port.
If you are able to distinguish between read only and read write applications, then you could configure your read only applications for "round robin", and your read write applications for "sorry server" ie. traffic only hits the secondary if the primary is down.
Ie. a typical use is for mapping email adreesses, in this case the mailers are only ever frequent read, and whatever puts the emails in are seldom write (by comparison). In this case mailers need high speed round robin for load sharing, updating application only need's it's writes to be accurately stored (extreme speed is not such a priority)
Alternately if you have one application that does high frequency read and write, you could always put a ldap proxy in front and try to divert the writes toward the "read write" balance, and the read only queries toward the "read only" balance, via use of a slave syncrepl and updatedn.
Cheers Brett
Hi, Brett,
On Sun, 28 Jun 2009 13:36:03 +1000 "Brett @Google" brett.maxfield@gmail.com wrote:
but on some cases(including my environment), UPDATE happens 3-10 times in a day. it's much less than SEARCH. in this case, I think we can just put loadbalancer, and enable "load balancing" and "redundancy" (I understand UPDATE isn't load balanced.)
Update is not load balanced, but it could be. You could have a "read only" balance rule, and a "read write" balance rule, either on sererate ip or seperate port. They would both point to the same servers, but the balance rules would act differently based on the selectioj of ip / port.
If you are able to distinguish between read only and read write applications, then you could configure your read only applications for "round robin", and your read write applications for "sorry server" ie. traffic only hits the secondary if the primary is down.
Ie. a typical use is for mapping email adreesses, in this case the mailers are only ever frequent read, and whatever puts the emails in are seldom write (by comparison). In this case mailers need high speed round robin for load sharing, updating application only need's it's writes to be accurately stored (extreme speed is not such a priority)
Alternately if you have one application that does high frequency read and write, you could always put a ldap proxy in front and try to divert the writes toward the "read write" balance, and the read only queries toward the "read only" balance, via use of a slave syncrepl and updatedn.
I understand your case. what I wanted to do is this.
- I have L4 load balancer - want to do load balancing(for search) & HA - no frequency "writes" - simple as possible
to separate LB configuration(port,host), or building LDAP proxy maybe easy, but complicated work. if I can build ldap servers as following, I believe it's simpler.
-------------------------------------------------------- CLIENT | SLB(RoundRobin) | +-----+ SRV1 SRV2
* MirrorMode is enabled on SRV1 and SRV2 --------------------------------------------------------
the problem is as Howard said, "writes period" If there are too much "writes" in every seconds, I understand I shouldn't choose this. but if it is 10writes/min, it must be safe.
and how about 1write/sec, 10writes/sec, 50writes/sec, 100writes/sec... I want to know this threshold like,
- if writes happen 0-5/sec, it's 99% safe (at the worst unlucky case, only 2writes at the same time may break something) - 6-50/sec, may safe or not. - more than 50/sec, danger.
Regards,
On Saturday 27 June 2009 15:56:11 Hideo NAKAMITSU wrote:
Guys,
I've already read this, and understand the difference between MirrorMode and Multi Master. http://www.openldap.org/doc/admin24/replication.html
Actually, when I setup 2-nodes MirrorMode and add too much entries to both nodes, at the same time, sometimes both databases weren't syncrhonized correctly. (I made a script to add 10,000 entries, and run it on both nodes at the same time.)
What version of OpenLDAP were you running on these nodes?
On Mon, 29 Jun 2009 09:45:46 +0200 Buchan Milne bgmilne@staff.telkomsa.net wrote:
On Saturday 27 June 2009 15:56:11 Hideo NAKAMITSU wrote:
Guys,
I've already read this, and understand the difference between MirrorMode and Multi Master. http://www.openldap.org/doc/admin24/replication.html
Actually, when I setup 2-nodes MirrorMode and add too much entries to both nodes, at the same time, sometimes both databases weren't syncrhonized correctly. (I made a script to add 10,000 entries, and run it on both nodes at the same time.)
What version of OpenLDAP were you running on these nodes?
I tested with openldap-servers-2.4.15-3.fc11.i586.rpm of FC11.
but never tested with the newest version from source yet. I'll try with 2.4.16 on today or tomorrow.
Hi,
Actually, when I setup 2-nodes MirrorMode and add too much entries to both nodes, at the same time, sometimes both databases weren't syncrhonized correctly. (I made a script to add 10,000 entries, and run it on both nodes at the same time.)
My understanding may be wrong, but in a mirror mode, you need to add the entries in one node only, and the mirror will take care of the updating of the other node.
(or you add half the entries in one node and the other half on the other node).
If you add the same information on both node, the mirror will also try to add that information on the other node and it will fail.
Bests,
olivier
Hi, Oliver,
On Mon, 29 Jun 2009 15:04:24 +0700 (ICT) Olivier Nicole on@cs.ait.ac.th wrote:
Actually, when I setup 2-nodes MirrorMode and add too much entries to both nodes, at the same time, sometimes both databases weren't syncrhonized correctly. (I made a script to add 10,000 entries, and run it on both nodes at the same time.)
My understanding may be wrong, but in a mirror mode, you need to add the entries in one node only, and the mirror will take care of the updating of the other node.
yes, you're right. this is normal MirrorMode operation. but if the writes don't happen frequently, can be added in both nodes I believe. I want to make sure this.
(or you add half the entries in one node and the other half on the other node).
If you add the same information on both node, the mirror will also try to add that information on the other node and it will fail.
yes, actually LB controls client access. when clientA and clientB would add "cn=abc,ou=people,dc=example,c=com" at the same time, ClientA access goes to ServerA, and ClientB to ServerB by round robin rule of LB.
and if ClientA could update LDAP firstly, ClientB would get error code 68(already exist) even if it was almost at the same time access.
besides, sorry to forget to attach my slapd.conf of both nodes. here it is. this works LIKE multi master.
### server A ### serverID 1 syncrepl rid=001 provider=ldap://10.0.0.62 bindmethod=simple binddn="cn=Manager,dc=example,dc=com" credentials=secret searchbase="dc=example,dc=com" schemachecking=on type=refreshAndPersist retry="10 +" syncrepl rid=002 provider=ldap://10.0.0.63 bindmethod=simple binddn="cn=Manager,dc=example,dc=com" credentials=secret searchbase="dc=example,dc=com" schemachecking=on type=refreshAndPersist retry="10 +" mirrormode on
### server B ### serverID 2 syncrepl rid=001 provider=ldap://10.0.0.62 bindmethod=simple binddn="cn=Manager,dc=example,dc=com" credentials=secret searchbase="dc=example,dc=com" schemachecking=on type=refreshAndPersist retry="10 +" syncrepl rid=002 provider=ldap://10.0.0.63 bindmethod=simple binddn="cn=Manager,dc=example,dc=com" credentials=secret searchbase="dc=example,dc=com" schemachecking=on type=refreshAndPersist retry="10 +" mirrormode on
openldap-technical@openldap.org