<?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>Chifeng's Blog &#187; OpenLDAP</title>
	<atom:link href="http://blog.chifeng.name/tag/openldap/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.chifeng.name</link>
	<description></description>
	<lastBuildDate>Fri, 13 Aug 2010 07:27:07 +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>OpenLDAP Replication</title>
		<link>http://blog.chifeng.name/2008/06/openldap-replication/</link>
		<comments>http://blog.chifeng.name/2008/06/openldap-replication/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 09:39:42 +0000</pubDate>
		<dc:creator>chifeng</dc:creator>
				<category><![CDATA[MailSystem]]></category>
		<category><![CDATA[OpenLDAP]]></category>
		<category><![CDATA[Replication]]></category>

		<guid isPermaLink="false">http://blog.chifeng.name/?p=229</guid>
		<description><![CDATA[花了点时间测试了一下OpenLDAP的主辅库同步，记录一下配置文件。 0，假设两台机器分别为：ldap-master.extmail.org  ldap-slave1.extmail.org 1，首先要做的是把主库上的数据和配置文件全部拷贝一份到辅库上去，并放到对应的目录下，包含如下文件 /var/db/openldap-data/* /usr/local/etc/openldap/* 然后重启一下slapd，再进行下面的配置 2，主库上配置slapd.conf类似如下内容，主要是增加了replogfile和replica，前者是指定了同步日志的位置，slurpd会读取这个日志文件，后者则指定了辅库的hostname和binddn，这个binddn需要和辅库上的updatedn一致，表示从这个节点开始同步。 include         /usr/local/etc/openldap/schema/core.schema include         /usr/local/etc/openldap/schema/cosine.schema include         /usr/local/etc/openldap/schema/nis.schema include         /usr/local/etc/openldap/schema/extmail.schema pidfile         /var/run/openldap/slapd.pid argsfile        /var/run/openldap/slapd.args modulepath      /usr/local/libexec/openldap moduleload      back_bdb database        bdb suffix          &#8220;dc=extmail.org&#8221; rootdn          &#8220;cn=Manager,dc=extmail.org&#8221; rootpw          secret replogfile      /var/db/openldap-data/replog replica host=ldap-slave1.extmail.org:389 binddn=&#8221;cn=Manager,dc=extmail.org&#8221; bindmethod=simple credentials=secret directory       /var/db/openldap-data index   objectClass     eq index   mail,active,virtualDomain,mailLocalAddress         eq,pres 3，辅库的配置，只多了一个updatedn命令 include         /usr/local/etc/openldap/schema/core.schema include         /usr/local/etc/openldap/schema/cosine.schema include         /usr/local/etc/openldap/schema/nis.schema include         [...]]]></description>
			<content:encoded><![CDATA[<p>花了点时间测试了一下OpenLDAP的主辅库同步，记录一下配置文件。</p>
<p>0，假设两台机器分别为：ldap-master.extmail.org  ldap-slave1.extmail.org</p>
<p>1，首先要做的是把主库上的数据和配置文件全部拷贝一份到辅库上去，并放到对应的目录下，包含如下文件</p>
<p>/var/db/openldap-data/*</p>
<p>/usr/local/etc/openldap/*</p>
<p>然后重启一下slapd，再进行下面的配置</p>
<p>2，主库上配置slapd.conf类似如下内容，主要是增加了replogfile和replica，前者是指定了同步日志的位置，slurpd会读取这个日志文件，后者则指定了辅库的hostname和binddn，这个binddn需要和辅库上的updatedn一致，表示从这个节点开始同步。</p>
<p>include         /usr/local/etc/openldap/schema/core.schema<br />
include         /usr/local/etc/openldap/schema/cosine.schema<br />
include         /usr/local/etc/openldap/schema/nis.schema<br />
include         /usr/local/etc/openldap/schema/extmail.schema<br />
pidfile         /var/run/openldap/slapd.pid<br />
argsfile        /var/run/openldap/slapd.args<br />
modulepath      /usr/local/libexec/openldap<br />
moduleload      back_bdb<br />
database        bdb<br />
suffix          &#8220;dc=extmail.org&#8221;<br />
rootdn          &#8220;cn=Manager,dc=extmail.org&#8221;<br />
rootpw          secret<br />
replogfile      /var/db/openldap-data/replog<br />
replica host=ldap-slave1.extmail.org:389<br />
binddn=&#8221;cn=Manager,dc=extmail.org&#8221;<br />
bindmethod=simple credentials=secret<br />
directory       /var/db/openldap-data<br />
index   objectClass     eq<br />
index   mail,active,virtualDomain,mailLocalAddress         eq,pres</p>
<p>3，辅库的配置，只多了一个updatedn命令</p>
<p>include         /usr/local/etc/openldap/schema/core.schema<br />
include         /usr/local/etc/openldap/schema/cosine.schema<br />
include         /usr/local/etc/openldap/schema/nis.schema<br />
include         /usr/local/etc/openldap/schema/extmail.schema<br />
pidfile         /var/run/openldap/slapd.pid<br />
argsfile        /var/run/openldap/slapd.args<br />
modulepath      /usr/local/libexec/openldap<br />
moduleload      back_bdb<br />
database        bdb<br />
suffix          &#8220;dc=extmail.org&#8221;<br />
rootdn          &#8220;cn=Manager,dc=extmail.org&#8221;<br />
rootpw          secret<br />
updatedn        &#8220;cn=Manager,dc=extmail.org&#8221;<br />
directory       /var/db/openldap-data<br />
index   objectClass     eq<br />
index   mail,active,virtualDomain,mailLocalAddress         eq,pres</p>
<p>4，重启slapd，slurpd。然后在主库上更新一条记录，查看是否同步过来。</p>
<p>master: /var/db/openldap-slurp/replica/slurpd.replog</p>
<p>slave: /var/log/debug.log</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chifeng.name/2008/06/openldap-replication/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
