[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openldap-technical
Subject:    Re: Multimaster ldap related questions
From:       Jarbas Peixoto =?utf-8?q?J=C3=BAnior?= <jarbas.junior () gmail ! com>
Date:       2011-03-25 20:13:38
Message-ID: AANLkTimo8FLumrRP2PTTQrExit3GQh2Y1ms02zvXqy81 () mail ! gmail ! com
[Download RAW message or body]

["attachment.htm" (text/html)]

<br><br><div class="gmail_quote">2011/3/25 Cannady, Mike <span dir="ltr">&lt;<a \
href="mailto:mike.cannady@htcinc.net">mike.cannady@htcinc.net</a>&gt;</span><br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex;"> <div class="im"><br>
<br>
&gt; -----Original Message-----<br>
&gt; From: Buchan Milne [mailto:<a \
href="mailto:bgmilne@staff.telkomsa.net">bgmilne@staff.telkomsa.net</a>]<br> &gt; \
Sent: Friday, March 25, 2011 6:17 AM<br> &gt; To: Cannady, Mike<br>
&gt; Cc: <a href="mailto:openldap-technical@openldap.org">openldap-technical@openldap.org</a><br>
 &gt; Subject: Re: Multimaster ldap related questions<br>
&gt;<br>
&gt;<br>
&gt; ----- &quot;Mike Cannady&quot; &lt;<a \
href="mailto:mike.cannady@htcinc.net">mike.cannady@htcinc.net</a>&gt; wrote:<br> \
&gt;<br> &gt; &gt; I have implemented a multi-master two node ldap with openldap \
2.4.22<br> &gt; &gt; and Berkely DB 4.8.26 on Redhat enterprise 5.4 with several \
readonly<br> &gt; &gt; replicas off of the masters.<br>
&gt; &gt;<br>
&gt; &gt; I have a need to add several optional attributes to a schema and<br>
&gt; &gt; probably should upgrade to 2.4.24 as well.  If this was a<br>
&gt; &gt; single-master<br>
&gt; &gt; server, it would be easy to do; just slapcat the ldap store, update<br>
&gt; &gt; software, change schema, slapadd the ldap store back, and resume<br>
&gt; &gt; slapd.<br>
&gt;<br>
&gt; Why would you need to slapcat/slapadd to &quot;add several optional<br>
attributes&quot;<br>
<br>
</div>While testing the 2 node multi-master nodes, I did identical changes<br>
(added an optional attribute to a schema) by stopping the 2 slapd<br>
daemonds, changed schema, started the daemonds.  After a lot of adding<br>
and deleting of info out of the stores, it was apparent that something<br>
was wrong with the data and the syncs.  I stopped both daemons, did the<br>
dump and restore on one and purge the database on the other and started<br>
them back up.  I didn&#39;t have any problems after that.  I know I didn&#39;t<br>
have issues prior to the changes, so I assumed the S.O.P. for schema<br>
changes is dump, change, restore.<br>
<br>
Are you indicating that isn&#39;t the case?  What about newly defined<br>
required attributes in a schema or one that was optional and now<br>
required where all the instances have the optional already specified.<br>
<div class="im"><br>
&gt;<br>
&gt; &gt; I&#39;m not sure how to do that with multi-master.  One reason for \
using<br> &gt; &gt; multi-master was if one master was down, the other would keep<br>
&gt; &gt; running.<br>
&gt; &gt; One should be able to upgrade one server, have it catch up with the<br>
&gt; &gt; changes that the other master had done while the first master is<br>
down<br>
&gt; &gt; and then repeat for the 2nd master.<br>
&gt;<br>
&gt; Well, it would apply if you weren&#39;t modifying data offline on the 1st<br>
&gt; master.<br>
&gt;<br>
&gt; &gt; Is this possible?  Has anyone<br>
&gt; &gt; done<br>
&gt; &gt; this and how was it done?<br>
&gt; &gt;<br>
&gt; &gt; I know in the near future, a high-level branch on my DIT will be<br>
&gt; &gt; purged<br>
&gt; &gt; and bulk reloaded.<br>
&gt;<br>
&gt; I can&#39;t think of a strategy where a bulk load will have neither:<br>
&gt; -write downtime<br>
&gt; -inconsistency (changes made in the window between the bulk generation<br>
and<br>
&gt; the startup of the server after import will be lost)<br>
&gt;<br>
&gt; You aren&#39;t clear which of these you want/prefer/require.<br>
&gt;<br>
<br>
</div>I want to minimize the time that the data in the store is unavailable.<br>
If the delete and bulk-load take 10 hours to do online, then the service<br>
is effectively down for 10 hours.  If the offline version of dump,<br>
delete what is to be deleted, slapadd the results, and then slapadd the<br>
new info takes only 30-60 minutes.  The offline would be the method I<br>
choose based on time.  The amount of time was my next question:<br>
<div class="im"><br>
<br>
&gt; &gt; I have tested the load with a test setup of<br>
&gt; &gt; multi-master ldap.  If I do it via ldapadd, it takes over 6 hours to<br>
&gt; &gt; load.  With slapadd (and slapd down) it only takes 25 minutes plus<br>
&gt; &gt; the<br>
&gt; &gt; time for the other master to get up-to-date.<br>
&gt;<br>
&gt; What is tool-threads set to? Which interesting slapadd options (e.g.<br>
-q)<br>
&gt; did you use?<br>
<br>
</div>Tool-threads is not specified, so I guess its one.  The test box is a<br>
single hyperthreaded cpu.<br>
<br>
Slapadd command (for master # 1)<br>
   slapadd -c   -f ldapfile  -n 1  -S 001  -w<br>
<div class="im"><br>
<br>
&gt;<br>
&gt; &gt; Is there any way that I<br>
&gt; &gt; can speed-up the update with ldapadd?<br>
&gt;<br>
&gt; ldapadd will never be as fast as slapadd.<br>
&gt;<br>
<br>
</div>Granted.  What I&#39;m asking is there a way to speed up slapd for the<br>
duration of the mass deletes and bulk loads.  In normal circumstances,<br>
the syncs and such would be OK for normal processing; but, with bulk<br>
changes, I would like have the daemon run in such a way that syncs are<br>
not done and everything is done in memory.  My tests seem to indicate<br>
that disk I/O is the bottleneck.  I know if there is a failure during<br>
this time, the database may be corrupted, but this OK for the bulk<br>
change duration.<br></blockquote><div><br></div><div>Hello, \
</div><div><div><br></div><div>I have a machine that was time consuming to restore a \
base </div><div>ldif with &quot;slapadd. </div><div><br></div><div>My problem was the \
I / O (HD very slow). </div> <div><br></div><div>Resolved with a small shell: \
</div></div><div><br></div><div>#!/bin/bash</div><div><div><br></div><div>/etc/init.d/slapd \
stop</div><div>slapcat \
/tmp/backup.ldif</div><div><br></div><div>dir_ldap=&quot;/var/lib/ldap&quot;</div> \
<div><br></div><div>rm -f \
/var/lib/ldap/{alock,__db.*,*bdb,log.*}</div><div><br></div><div>mv $dir_ldap \
$dir_ldap.real</div><div>mkdir $dir_ldap</div><div>mount -t tmpfs tmpfs $dir_ldap -o \
nr_inodes=3000000,size=4G</div><div> <br></div><div>cp $dir_ldap.real/DB_CONFIG \
$dir_ldap</div><div><br></div><div>slapadd -c -q -w -b &quot;dc=example,dc=com&quot; \
-l /tmp/backup.ldif</div><div>rsync -a --delete $dir_ldap/ \
$dir_ldap.real/</div><div>umount $dir_ldap</div> <div>rmdir $dir_ldap</div><div>mv \
$dir_ldap.real $dir_ldap</div><div>chown openldap:openldap $dir_ldap \
-R</div><div><br></div><div>/etc/init.d/slapd \
start</div></div><div><br></div><div>Thus, the I / O during the slapadd no longer \
exists, because all files are in memory. The time difference with &quot;tmpfs&quot; \
is striking.</div> <div><br></div><div><div>Regards,</div><div>Jarbas</div></div><div><br></div><div> \
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex;"> <div class="im"><br>
<br>
&gt; &gt; I have pieces of my slapd.conf<br>
&gt; &gt; for the 1st master at the end of this email.<br>
&gt; &gt;<br>
&gt; &gt; Slapadd has two options that appear to be needed when dealing with<br>
&gt; &gt; multi-master or replicate nodes.  The first is the &quot;-S sid&quot; \
option,<br> &gt; &gt; the<br>
&gt; &gt; second is &quot;-w&quot;.  I&#39;m a little confused what is used where.  \
If you<br> &gt; &gt; are<br>
&gt; &gt; doing a dump and restore operation (slapcat, delete database,<br>
&gt; &gt; slapadd)<br>
&gt; &gt; the only option you need is the &quot;-w&quot; option?  If you are adding \
new<br> &gt; &gt; entries offline then do both options need to be specified?<br>
&gt;<br>
&gt; Adding, *or* modifying.<br>
<br>
</div>I don&#39;t understand this answer.<br>
<div class="im"><br>
&gt;<br>
&gt; &gt; Is there a multi-master best practice quide somewhere?<br>
&gt;<br>
&gt; A good start is to never lie to slapd. If you have changed the<br>
contents of<br>
&gt; an entry, the entryCSN should not be retained.<br>
&gt;<br>
&gt; I also prefer to avoid non-restore bulk-loading.<br>
<br>
</div>Me too, but if it is a decision of 10 hours vs. 1 hour, the 1 hour will<br>
win.<br>
<br>
<br>
&gt;<br>
&gt; Regards,<br>
&gt; Buchan<br>
<br>
<br>
Thanks,<br>
<font color="#888888"><br>
Mike<br>
</font><div><div></div><div class="h5"><br>
**********************************************************************<br>
HTC Disclaimer:  The information contained in this message may be privileged and \
confidential and protected from disclosure. If the reader of this message is not the \
intended recipient, or an employee or agent responsible for delivering this message \
to the intended recipient, you are hereby notified that any dissemination, \
distribution or copying of this communication is strictly prohibited.  If you have \
received this communication in error, please notify us immediately by replying to the \
message and deleting it from your computer.  Thank you.<br>

**********************************************************************<br>
<br>
<br>
</div></div></blockquote></div><br>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic