<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>williamhathaway.com &#187; ldap</title>
	<atom:link href="http://www.williamhathaway.com/wordpress/category/ldap/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.williamhathaway.com/wordpress</link>
	<description></description>
	<lastBuildDate>Wed, 21 Jul 2010 03:10:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Creating a slow operation log for OpenDS</title>
		<link>http://www.williamhathaway.com/wordpress/2009/11/02/creating-a-slow-operation-log-for-opends/</link>
		<comments>http://www.williamhathaway.com/wordpress/2009/11/02/creating-a-slow-operation-log-for-opends/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 20:58:39 +0000</pubDate>
		<dc:creator>William Hathaway</dc:creator>
				<category><![CDATA[ldap]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[opends]]></category>

		<guid isPermaLink="false">http://www.williamhathaway.com/wordpress/?p=480</guid>
		<description><![CDATA[For anyone that has spent much time looking at MySQL performance, you will be familiar with the &#8216;slow query log&#8217;.  This basically is a log where queries that took over some amount of time would get recorded.   For kicks, I tried implementing a similar hook for OpenDS.  My current version is in pretty rough shape [...]]]></description>
			<content:encoded><![CDATA[<p>For anyone that has spent much time looking at MySQL performance, you will be familiar with the &#8216;slow query log&#8217;.  This basically is a log where queries that took over some amount of time would get recorded.   For kicks, I tried implementing a similar hook for <a href="http://www.opends.org/">OpenDS</a>.  My current version is in pretty rough shape (not very efficient or configurable), but seems to work.  I started from a copy of the TextAccessLogPublisher.java file and created a new one called TextSlowAccessLogPublisher.java.  My logic is basically:</p>
<ul>
<li>create a hash table</li>
<li>emptied out all the log XYZIntermediateMessage and connect/disconnect methods</li>
<li>when a request comes in, store the text to log in the hash table (keyed off connectionID and opNumber) instead of outputting it (changed the logSearchRequest, logModifyRequest, &#8230; methods)</li>
<li>when a request is finished processing, we check the elapsed time (etime)
<ul>
<li>if the elapsed time greater  than our or equal to our threshold
<ul>
<li>print the request info we stashed in the hash table and delete it</li>
<li>print the response info</li>
</ul>
</li>
<li>if the elapsed time is less than our threshold
<ul>
<li>delete the request info from the hash table, don&#8217;t print anything</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>There are a few more things I want to do:</p>
<ul>
<li>Make the &#8216;slow operation threshold time&#8217; dynamically changeable (looks like I will need to mess with configuration objects since I want to add an additional parameter not in the standard access log type)</li>
<li>Add extra information to the output format such as authorization DN (and potentially client connection info if not too hard to retrieve)</li>
<li>Instead of all the text formatting for every request, just put the Operation object into the hash table, since the majority of operations won&#8217;t ever get printed we shouldn&#8217;t burn CPU formatting them.  The operations would only be formatted to text if the operations end up being slow and printed.</li>
</ul>
<p><strong>Files</strong></p>
<ul>
<li><a href="http://williamhathaway.com/downloads/TextSlowAccessLogPublisher.java">TextSlowAccessLogPublisher.java</a> (currently quick-n-dirty quality)</li>
<li><a href="http://williamhathaway.com/downloads/activate_opends_slow_query_log.ldif">LDIF</a> to enable the slow query log</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.williamhathaway.com/wordpress/2009/11/02/creating-a-slow-operation-log-for-opends/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sun Messaging Server login hang</title>
		<link>http://www.williamhathaway.com/wordpress/2009/06/28/sun-messaging-server-login-hang/</link>
		<comments>http://www.williamhathaway.com/wordpress/2009/06/28/sun-messaging-server-login-hang/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 12:52:33 +0000</pubDate>
		<dc:creator>William Hathaway</dc:creator>
				<category><![CDATA[ldap]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://www.williamhathaway.com/wordpress/?p=451</guid>
		<description><![CDATA[30 second summary for those that don&#8217;t want to read the troubleshooting details When using replicated LDAP servers in a Sun Communications Suite deployment, it is important that every connection from a given Convergence (webmail component) instance go to the same LDAP server ,otherwise address book creation can partially fail causing some user logins to [...]]]></description>
			<content:encoded><![CDATA[<p><strong>30 second summary for those that don&#8217;t want to read the troubleshooting details</strong></p>
<p>When using replicated LDAP servers in a Sun Communications Suite deployment, it is important that every connection from a given Convergence (webmail component) instance go to the same LDAP server ,otherwise address book creation can partially fail causing some user logins to webmail to hang.  To fix this, use one of the following techniques:</p>
<p>1) Configure Convergence&#8217;s application level failover to point to individual LDAP servers (be sure to switch the host order on alternating Convergence instances to spread the load)</p>
<p><strong>/opt/sun/comms/iwc/sbin/iwcadmin -u admin -W pwdfile  -o ugldap.host -v ldap1:$port ,ldap2:$port</strong></p>
<p>(you will also need to restart the web container for this to take effect)</p>
<p>2) Use <a href="http://www.sun.com/software/products/directory_srvr_ee/dir_proxy/index.xml">Directory Proxy Server</a> to route writes to a preferred master</p>
<p>3) If pointing at a HW load balancer virtual IP, use a distribution algorithm that has backend server persistence based on originating IP.  Note that with a few machines this might not actually balance out well, so verify you aren&#8217;t overloading one LDAP instance.</p>
<p><strong>Background</strong></p>
<p>A customer of mine is deploying Sun&#8217;s Communications Suite (aka Messaging, Calendar, and IM servers) and was testing their custom provisioning tool.  A few accounts had been created that worked fine but one of the accounts would just hang when trying to login to webmail.  The screen would show the application initialization progress bar stuck at 84% and indicate it was dealing with the address book.</p>
<p>I verified that the account would hang and then took a look at the account&#8217;s main LDAP entry, which looked fine.  I then checked the account&#8217;s LDAP address book data.  The bad account had 3 LDAP entries in the address book branch, but a good account should have 4. Taking a look at the iwc.log from Convergence, I could see an error:</p>
<p>ADDRESS_BOOK: ERROR from com.sun.comms.client.ab.wabp.WABPEngineServlet  Thread httpSSLWorkerThread-80-4 at 2009-06-27 14:33:05,586 &#8211; pstore object couldn&#8217;t be created for user :baduser</p>
<p>At this site we have a pair of replicated LDAP servers behind a pair of load balancers that are used by the messaging components. Sun&#8217;s Directory Server has a loose replication model that usually works fine, but you can run into a rare race condition when applications are adding inter-related entries to different masters in a rapid fire succession.  Convergence was initially pointing at the load balancer virtual IP to reach the LDAP servers.</p>
<p>When I checked the logs on the LDAP servers, I could see that  Convergence had tried to create address book entries when the user first logged in, but had done so over several different LDAP connections which via the load balancer went to different LDAP servers. It created a parent entry on ldap1, then in a connection to ldap2 tried to create a dependent entry, which failed.  Convergence then created  another version of the parent entry on ldap2 (which worked, but caused a replication conflict).  Later attempts to login ended up adding some dependent entries, but it was still in an usuable state.</p>
<p>When things are working correctly, you will see a LDAP operation pattern that looks like:</p>
<p>[27/Jun/2009:16:21:39 -0400] conn=566625 op=5 msgId=948 &#8211; ADD dn=&#8221;piPStoreOwner=$user,o=$domain,o=PiServerDb&#8221;<br />
[27/Jun/2009:16:21:39 -0400] conn=566636 op=1 msgId=950 &#8211; ADD dn=&#8221;piEntryID=random1,piPStoreOwner=$user,o=$domain,o=PiServerDb&#8221;<br />
[27/Jun/2009:16:21:39 -0400] conn=566636 op=2 msgId=951 &#8211; ADD dn=&#8221;piEntryID=random2,piPStoreOwner=$user,o=$domain,o=PiServerDb&#8221;<br />
[27/Jun/2009:16:21:39 -0400] conn=566636 op=3 msgId=952 &#8211; ADD dn=&#8221;piEntryID=random3,piPStoreOwner=$user,o=$domain,o=PiServerDb&#8221;</p>
<p><strong>The fix</strong></p>
<p>In order to fix the account and the problem in general, we ended up deleting the skeleton address book entries for the user in question and used iwcadmin to change Convergence to point to individual LDAP servers in a failover mode. Since we had two Convergence instances and two LDAP instances, it was easy to flip the perferred order so that LDAP load will be well-balanced.</p>
<p><strong>Things that could be improved</strong></p>
<p>1) Convergence could give a better error experience to the user instead of a just hanging.  Perhaps timing out after 30 seconds with a message &#8220;There is a problem with initializing your address book, please ask your administrator to investigate&#8221;.</p>
<p>2) Convergence could use a single LDAP connection when performing address book creation for any given user</p>
<p>3) Sun&#8217;s Directory Server could have an assured replication model (this is <a href="https://www.opends.org/wiki/page/AssuredReplication#section-AssuredReplication-OpenDSAssuredReplication">available</a> in the OpenDS 2.0 release candidates)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.williamhathaway.com/wordpress/2009/06/28/sun-messaging-server-login-hang/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sun Directory Server support tool &#8211; Dirtracer</title>
		<link>http://www.williamhathaway.com/wordpress/2009/04/29/sun-directory-server-support-tool-dirtrace/</link>
		<comments>http://www.williamhathaway.com/wordpress/2009/04/29/sun-directory-server-support-tool-dirtrace/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 20:00:35 +0000</pubDate>
		<dc:creator>William Hathaway</dc:creator>
				<category><![CDATA[dsee]]></category>
		<category><![CDATA[ldap]]></category>

		<guid isPermaLink="false">http://www.williamhathaway.com/wordpress/?p=357</guid>
		<description><![CDATA[I just watched Lee Trujillo give a presentation and demo of his Dirtrace, his cool tool for gathering support data on Sun&#8217;s DS.  The data captured is very helpful for troubleshooting Sun DS problems in a variety of situations ranging from hangs to replication problems to performance problems.  I&#8217;ve used it in the past, but [...]]]></description>
			<content:encoded><![CDATA[<p>I just watched <a href="http://blogs.sun.com/Dirtracer/">Lee Trujillo</a> give a presentation and demo of his Dirtrace, his cool tool for gathering support data on Sun&#8217;s DS.  The data captured is very helpful for troubleshooting Sun DS problems in a variety of situations ranging from hangs to replication problems to performance problems.  I&#8217;ve used it in the past, but the latest version looks even easier to use and captures more data.  If you manage Sun&#8217;s Directory Server on Solaris, Linux, or HP/UX, pull down a copy and check it out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.williamhathaway.com/wordpress/2009/04/29/sun-directory-server-support-tool-dirtrace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using IBM Quickr with Sun Directory Server</title>
		<link>http://www.williamhathaway.com/wordpress/2009/04/02/using-ibm-quickr-with-sun-directory-server/</link>
		<comments>http://www.williamhathaway.com/wordpress/2009/04/02/using-ibm-quickr-with-sun-directory-server/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 12:03:10 +0000</pubDate>
		<dc:creator>William Hathaway</dc:creator>
				<category><![CDATA[dsee]]></category>
		<category><![CDATA[ldap]]></category>

		<guid isPermaLink="false">http://williamhathaway.com/2009/04/02/using-ibm-quickr-with-sun-directory-server/</guid>
		<description><![CDATA[A customer was testing out Lotus/IBM&#8217;s Quickr collaboration software and using Sun&#8217;s Directory Server as the user store.  One of the system admins mentioned that queries searching for people were glacially slow.  We investigated by checking out the access log to look for slow queries and saw that Quickr was running un-indexed queries that searched [...]]]></description>
			<content:encoded><![CDATA[<p>A customer was testing out Lotus/IBM&#8217;s <a href="http://www-01.ibm.com/software/lotus/products/quickr/">Quickr</a> collaboration software and using Sun&#8217;s Directory Server as the user store.  One of the system admins mentioned that queries searching for people were glacially slow.  We investigated by checking out the access log to look for slow queries and saw that Quickr was running un-indexed queries that searched against cn,  givenName, and displayName.  These queries were taking about 30 seconds to run since the directory server had to do the DB equivalent of full-table scans.  We checked the indexes and saw that displayName wasn&#8217;t indexed.  After adding an index for the displayName attribute the queries were snappy, taking less than a second.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.williamhathaway.com/wordpress/2009/04/02/using-ibm-quickr-with-sun-directory-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Troubleshooting file descriptor problems in Sun Directory Server</title>
		<link>http://www.williamhathaway.com/wordpress/2009/04/01/file-descriptor-problems-in-sun-directory-server/</link>
		<comments>http://www.williamhathaway.com/wordpress/2009/04/01/file-descriptor-problems-in-sun-directory-server/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 11:34:21 +0000</pubDate>
		<dc:creator>William Hathaway</dc:creator>
				<category><![CDATA[dsee]]></category>
		<category><![CDATA[ldap]]></category>

		<guid isPermaLink="false">http://williamhathaway.com/2009/04/01/file-descriptor-problems-in-sun-directory-server/</guid>
		<description><![CDATA[I have a customer that was encountering a problem where their test directory server (running Sun DS 5.2p4) was constantly running out of file descriptors.  They had bumped the allowed number of file descriptors up to 4096, and that slowed the occurrence of the error, but the  root cause had not been diagnosed yet.  We [...]]]></description>
			<content:encoded><![CDATA[<p>I have a customer that was encountering a problem where their test directory server (running Sun DS 5.2p4) was constantly running out of file descriptors.  They had bumped the allowed number of file descriptors up to 4096, and that slowed the occurrence of the error, but the  root cause had not been diagnosed yet.  We first took a look using netstat and saw:</p>
<p><strong><code><br />
netstat -an | grep ^$THEIR_IP.389 | grep -c ESTAB</code></strong></p>
<p><strong>4012</strong></p>
<p>So we have confirmed the problem is as stated.  Often this problem is caused by applications that don&#8217;t use connection pools properly and open way too many connections.</p>
<p>Next we checked under cn=monitor to see which accounts were connected to the directory server:</p>
<p><code><strong>/bin/ldapsearch -T -D cn=directory\ manager  -h ldap -b cn=monitor -s base objectclass=* connection | awk -F: '{ print $7 }' | sort | uniq  -c</strong></code></p>
<p><strong>2500  uid=application_xyz,ou=apps,dc=example,dc=com</strong></p>
<p><strong>1200  uid=application_foo,ou=apps,dc=example,dc=com</strong></p>
<p><strong>220  uid=application_shizzle,ou=apps,dc=example,dc=com</strong></p>
<p>&#8230;</p>
<p>So it looks like applications xyz and foo are the primary culprits.</p>
<p>We&#8217;ll also count the established connections by IP address to tell which machines are creating the most connections:</p>
<p><code><strong> netstat -an | nawk  '$1 == "<em>$LDAP_IP</em>.389" &amp;&amp; /ESTAB/ { print $2}' | cut -d. -f1-4 | sort | uniq -c<br />
2700   10.10.1.168<br />
400    10.10.1.169<br />
300    192.168.1.1<br />
...</strong></code></p>
<p>We  know that the server 10.10.1.168 is the machine with the most connections coming from it.  We then hoped over to 10.10.1.168 (running an application server) and took a look from its point of view:</p>
<p><strong>netstat -an | grep -c <em>$LDAP_IP</em>.389 </strong></p>
<p><strong>2 </strong></p>
<p>Woah!  Houston we have a problem.  From the LDAP server&#8217;s point of view, it has 2700 connections from the app server.  From  the app server&#8217;s point of view, it has 2 connection to the LDAP server.  If we had seen symmetry between the app server&#8217;s network connections and the directory server&#8217;s network connections, it would have been an application level problem of allocating too many connections.  In this case, since the connection count is extremely unsymmetrical, it looks like there is a firewall/load-balancer or other network device in the path between these two machines which is killing connections from the application server but not symetrically telling the LDAP server the connection is dead.  We ask the network team to investigate and in the meantime put in a work-around of setting an <a href="http://docs.sun.com/app/docs/doc/820-0384/nsslapd-idletimeout-5dsconf?a=view">idle timeout</a> on the LDAP server.  This lets the directory server kill any connections that it hasn&#8217;t received an operation from in some time period (we set it to a generous 12 hours) and we immediately see the number of established connections drop down to a few hundred.  Problem solved.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.williamhathaway.com/wordpress/2009/04/01/file-descriptor-problems-in-sun-directory-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Viewing the current status of LDAP servers in Directory Proxy Server 6.3</title>
		<link>http://www.williamhathaway.com/wordpress/2009/03/20/viewing-the-current-status-of-ldap-servers-in-directory-proxy-server-63/</link>
		<comments>http://www.williamhathaway.com/wordpress/2009/03/20/viewing-the-current-status-of-ldap-servers-in-directory-proxy-server-63/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 00:22:55 +0000</pubDate>
		<dc:creator>William Hathaway</dc:creator>
				<category><![CDATA[dsee]]></category>
		<category><![CDATA[ldap]]></category>

		<guid isPermaLink="false">http://williamhathaway.com/2009/03/20/viewing-the-current-status-of-ldap-servers-in-directory-proxy-server-63/</guid>
		<description><![CDATA[The dpconf command for managing DSEE Directory Proxy Servers (DPS) shows you a lot of information about the ldap-data-sources (the back-end directory servers), including whether or not they are administratively enabled or disabled.  One status that I couldn&#8217;t find was whether a given back-end server was actually considered on-line by the DPS itself.  It turns [...]]]></description>
			<content:encoded><![CDATA[<p>The dpconf command for managing DSEE Directory Proxy Servers (DPS) shows you a lot of information about the ldap-data-sources (the back-end directory servers), including whether or not they are administratively enabled or disabled.  One status that I couldn&#8217;t find was whether a given back-end server was actually considered on-line by the DPS itself.  It turns out the current status information is available, but only by digging through the cn=monitor entry on the DPS instance.  Bear in mind you will need to authentication as the proxy&#8217;s root DN (default is &#8220;cn=proxy manager&#8221;) to dig it up.   Also, it appears that logic that implements cn=monitor doesn&#8217;t hande all search criteria perfectly, so we will use a little bit of grep magic to reduce the result set to what we want.  Here is an example ldapsearch to get the current status of servers:</p>
<p>ldapsearch -D &#8220;cn=proxy manager&#8221; -j ~/.dmpass -b cn=monitor serveravailable=*  \<br />
| egrep  &#8220;^backendServer|^serverAvailable&#8221;</p>
<pre>backendServer: testdscc01:3998/
serverAvailable: true
backendServer: testds05:389/
serverAvailable: true
backendServer: testds06:389/
serverAvailable: <strong>false</strong>
backendServer: testds07:389/
serverAvailable: true</pre>
<p>In this case it would be good idea to check testds06 and see if the server is down, or perhaps it is failing a DPS health check for some other reason.</p>
<p>If you want to dig a little deeper into cn=monitor, you can find a lot of detailed information about the thread that is monitoring a particular data source.  Here is an example of one pointing to an LDAP server that is unavailable:</p>
<p>dn: cn=Proactive Monitor for testds06:389/,cn=Monitor Thread,cn=Resource,<br />
&nbsp;cn=testdps01:/opt/dsee/instances/dps,cn=Instance,cn=DPS6.0,cn=Product,cn=monitor<br />
objectClass: top<br />
objectClass: extensibleObject<br />
cn: Proactive Monitor for testds06:389/<br />
started: true<br />
running: true<br />
startTime: [03/19/2009:12:20:36 -0700]<br />
operationalStatus: OK<br />
statusDescription: The monitor thread is fully operational<br />
threadId: 19<br />
threadStack: java.lang.Thread.sleep(Native Method) / &nbsp;com.sun.directory.proxy.server.ProactiveMonitorThread.runThread(ProactiveMonitorThread.java:122) / &nbsp;com.sun.directory.proxy.util.DistributionThread.run(DistributionThread.java:225) /<br />
backendServer: testds06:389/<br />
serverAvailable: false<br />
checkInterval: 30000<br />
additionalCheckType: op connection<br />
totalChecks: 594<br />
availabilityChecksFailed: 2<br />
additionalChecksFailed: 0</p>
]]></content:encoded>
			<wfw:commentRss>http://www.williamhathaway.com/wordpress/2009/03/20/viewing-the-current-status-of-ldap-servers-in-directory-proxy-server-63/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Command line completion in bash for DSEE and ZFS</title>
		<link>http://www.williamhathaway.com/wordpress/2009/03/17/command-line-completion-in-bash-for-dsee-and-zfs/</link>
		<comments>http://www.williamhathaway.com/wordpress/2009/03/17/command-line-completion-in-bash-for-dsee-and-zfs/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 16:39:10 +0000</pubDate>
		<dc:creator>William Hathaway</dc:creator>
				<category><![CDATA[dsee]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://williamhathaway.com/?p=272</guid>
		<description><![CDATA[I&#8217;m working on an environment for a customer where we are using Directory Server Enterprise Edition (DSEE) and ZFS.   On the DSEE side, my co-worker Mitch and I were inspired by Ludovic&#8217;s post a while back about setting up command line completion for  dsconf and dpconf.   One small item Mitch noticed was that in [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on an environment for a customer where we are using Directory Server Enterprise Edition (DSEE) and ZFS.   On the DSEE side, my co-worker Mitch and I were inspired by <a href="http://blogs.sun.com/Ludo">Ludovic&#8217;s</a> post a while back about setting up <a href="http://blogs.sun.com/Ludo/entry/dsee_6_0_cli_made">command line completion for  dsconf and dpcon</a>f.   One small item Mitch noticed was that in the original examples, if you had a command name that didn&#8217;t contain a hypen (like dsconf import), it wouldn&#8217;t be completed (but command like dsconf get-server-prop would be).</p>
<p>Here is what Mitch came up with:<br />
<code><br />
for cmd in dsconf dsadm dpconf dpadm; do<br />
&nbsp;&nbsp;complete -W "`$cmd --help | \<br />
&nbsp;&nbsp;&nbsp;&nbsp;perl -lane 'print $F[0] if \<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(/^The accepted values for SUBCMD/ .. \<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/^The accepted values for GLOBAL_OPTS/ \<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and not /^The /)'`" $cmd<br />
done<br />
</code><br />
For ZFS, check out this <a href="http://www.sun.com/bigadmin/scripts/sunScripts/zfs_completion.bash.txt">script</a> on Big Admin by Mark Musante.<br />
Mitch did a small update to the script which made the list of sub-commands on the fly to account for additions.  Mitch&#8217;s updated version is available <a href="http://williamhathaway.com/downloads/zfs_completion.sh">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.williamhathaway.com/wordpress/2009/03/17/command-line-completion-in-bash-for-dsee-and-zfs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating an LDAP environment to test a tool</title>
		<link>http://www.williamhathaway.com/wordpress/2009/03/05/creating-an-ldap-environment-to-test-a-tool/</link>
		<comments>http://www.williamhathaway.com/wordpress/2009/03/05/creating-an-ldap-environment-to-test-a-tool/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 15:18:40 +0000</pubDate>
		<dc:creator>William Hathaway</dc:creator>
				<category><![CDATA[dsee]]></category>
		<category><![CDATA[ldap]]></category>

		<guid isPermaLink="false">http://williamhathaway.com/?p=262</guid>
		<description><![CDATA[Yesterday I spent some time helping a developer who is creating a tool for synchronizing accounts between a RDBMS and an LDAP server and thought I would document the process.  The tool basically makes a request to the RDBMS for all the accounts sorted by a specific attribute, then makes a similar request to the [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I spent some time helping a developer who is creating a tool for synchronizing accounts between a RDBMS and an LDAP server and thought I would document the process.  The tool basically makes a request to the RDBMS for all the accounts sorted by a specific attribute, then makes a similar request to the LDAP server.  The customer expected the number of records to max out at about 200,000 entries.</p>
<p>The first thing we did was spin up local copies of Mysql and the LDAP server.  I&#8217;m not going to document the mysql part since there are a million pages available on that.</p>
<p>Note that the <a href="http://www.sun.com/software/products/directory_srvr_ee/index.jsp">DSEE 6.3</a> binaries were already installed on my test machine under /opt/dsee6.  I personally prefer the zip based distribution.</p>
<p>Here are the steps for the LDAP server:</p>
<p>Step 1 &#8211; create a new instance and add a suffix for the data</p>
<p># <strong>export PATH=$PATH:/opt/dsee63/ds6/bin </strong></p>
<p><strong># dsadm create -w /tmp/dspassword /data/ds3</strong></p>
<p><strong># dsadm start /data/ds3</strong></p>
<p><strong># dsconf create-suffix dc=example,dc=com</strong></p>
<p>Step 2 &#8211; create an sample LDIF with 200k entries</p>
<p><strong># cd /opt/dsee63/dsrk6/bin/example_files</strong></p>
<p><strong># cp example.template 200k.template</strong></p>
<p><strong># vi 200k.template (change numusers value to be 200000 and added employeeNumber as a sequentially valued attribute) </strong></p>
<p><strong> # ../makeldif -t 200k.template -o 200k.ldif</strong></p>
<p>Step 3 import the sample data</p>
<p><strong># dsadm stop /data/ds3</strong></p>
<p><strong># dsadm import -i /data/ds3 /opt/dsee63/dsrk6/bin/example_files/200k.ldif<br />
</strong></p>
<p><strong> # dsadm start /data/ds3</strong></p>
<p>Step 4 create an account with proper settings</p>
<p>We created an account uid=dbsync,ou=admins,dc=example,dc=com that will be used by the application to perform the search and updates.</p>
<p>Note that we had to adjust 2 attributes on the dbsync account. We added the following operational attributes/values:</p>
<p><strong>nsSizeLimit: -1</strong></p>
<p><strong>nsLookThroughLimit: -1 </strong></p>
<p>We also added an ACI to the ou=people,dc=example,dc=com branch giving the dbsync user  full permissions.</p>
<p><strong>aci: (targetattr !=&#8221;aci&#8221;)(version<br />
3.0;acl &#8220;db sync &#8211; full permissions&#8221;;allow (all)(userdn = &#8220;ldap:///uid=dbsync,ou=admins,dc=example,dc=com&#8221;);)</strong></p>
<p>The tool was now able to pull back all 200,000 entries, but was not able to make server-side sort request.</p>
<p>To enable server-side sorting we had to create a VLV index.</p>
<p>Step 5 &#8211; VLV index creation</p>
<p>We used the following LDIF to create a VLV index sorting on employeenumber</p>
<p><strong>dn: cn=people_browsing_index,cn=example,cn=ldbm database,cn=plugins,cn=config<br />
objectClass: top<br />
objectClass: vlvSearch<br />
cn: Browsing ou=People<br />
vlvBase: ou=People,dc=example,dc=com<br />
vlvScope: 1<br />
vlvFilter: (objectclass=inetOrgPerson)<br />
aci: (targetattr=&#8221;*&#8221;)(version 3.0; acl &#8220;VLV for Anonymous&#8221;;<br />
allow (read,search,compare) userdn=&#8221;ldap:///all&#8221;;)</strong></p>
<p><strong>dn: cn=Sort employeenumber,cn=people_browsing_index,<br />
cn=example,cn=ldbm database,cn=plugins,cn=config<br />
objectClass: top<br />
objectClass: vlvIndex<br />
cn: Sort employeenumber<br />
vlvSort: employeenumber</strong><br />
We then had to use dsadm to create the index</p>
<p><strong># dsadm stop /data/ds3</strong></p>
<p><strong># dsadm reindex -l  -t &#8220;Sort employeeNumber&#8221;  /data/ds3 dc=example,dc=com </strong></p>
<p><strong># dsadm start  /data/ds3</strong></p>
<p>After these changes the tool was now able to query all 200,000 entries and have the server return it as a sorted list.</p>
<p>We also ended up doing 2 small performance tweaks to the server, but these weren&#8217;t strictly required:</p>
<p><strong>dsconf set-server-prop db-env-path:/tmp/ds_cache</strong></p>
<p><strong>dsconf set-server-prop db-batched-transaction-count:5 </strong></p>
<p><strong>dsadm restart /data/ds3 </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.williamhathaway.com/wordpress/2009/03/05/creating-an-ldap-environment-to-test-a-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New LDAP vendor &#8211; Unbound ID</title>
		<link>http://www.williamhathaway.com/wordpress/2009/01/21/new-ldap-vendor-unbound-id/</link>
		<comments>http://www.williamhathaway.com/wordpress/2009/01/21/new-ldap-vendor-unbound-id/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 01:42:46 +0000</pubDate>
		<dc:creator>William Hathaway</dc:creator>
				<category><![CDATA[ldap]]></category>

		<guid isPermaLink="false">http://williamhathaway.com/?p=257</guid>
		<description><![CDATA[I saw that Unbound ID&#8217;s website is now live.  There isn&#8217;t much data available except for the management team, which is a collection of ex-Sun big brains.  I&#8217;ve interacted with a few of those folks in the past on mailing lists and a couple of phone calls.  I&#8217;m looking forward to hearing more details of [...]]]></description>
			<content:encoded><![CDATA[<p>I saw that Unbound ID&#8217;s <a href="http://unboundid.com">website</a> is now live.  There isn&#8217;t much data available except for the <a href="http://unboundid.com/company/management-team.php">management team</a>, which is a collection of ex-Sun big brains.  I&#8217;ve interacted with a few of those folks in the past on mailing lists and a couple of phone calls.  I&#8217;m looking forward to hearing more details of their solution set in the future. I think they have a good pulse on customer needs , a strong sense of practicality, and some amazing engineering talent.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.williamhathaway.com/wordpress/2009/01/21/new-ldap-vendor-unbound-id/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sun Directory Server &#8211; Replication over WAN</title>
		<link>http://www.williamhathaway.com/wordpress/2008/11/19/sun-directory-server-replication-over-wan/</link>
		<comments>http://www.williamhathaway.com/wordpress/2008/11/19/sun-directory-server-replication-over-wan/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 04:26:26 +0000</pubDate>
		<dc:creator>William Hathaway</dc:creator>
				<category><![CDATA[dsee]]></category>
		<category><![CDATA[ldap]]></category>

		<guid isPermaLink="false">http://williamhathaway.com/?p=235</guid>
		<description><![CDATA[Yesterday we had to modify a huge number of entries in our directory server environment.  The updates were all done in one data center, and they went extremely fast.  When I later went to check on the replication, I noticed  the data was replicated much slower to the remote data center than I expected.  Given [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday we had to modify a huge number of entries in our directory server environment.  The updates were all done in one data center, and they went extremely fast.  When I later went to check on the replication, I noticed  the data was replicated much slower to the remote data center than I expected.  Given that the other data center is a pretty decent WAN hop awa,  I decided to try changing some of the replication agreement parameters.  To do this you use:</p>
<p>dsconf set-repl-agmt-properties $suffix  $property:$value</p>
<p>You can see more information on the properties and suggested values at the<a href="http://docs.sun.com/app/docs/doc/820-2763/bcari?a=view"> Replication Over a WAN</a> page of the DSEE Admin Guide.</p>
<p>In our case, I did some quick experimenting and found the values suggested for WANs seemed to work pretty well and gave us about a 3x-4x boost in performance versus the defaults.  The changes take place immediately, there was no need to restart the servers or replication agreements.</p>
<p>To measure how fast replication was going I would go to the remote server and run something like</p>
<p>grep 2008:10:23 logs/access | grep -c MOD</p>
<p>where 10:23 was the previous minute, to count how many MOD operations had come through in one minute.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.williamhathaway.com/wordpress/2008/11/19/sun-directory-server-replication-over-wan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
