Promoting Replica to LDAP Master 6.0: Difference between revisions

Line 118: Line 118:
olcAccessLogPurge: 01+00:00  00+04:00<br />
olcAccessLogPurge: 01+00:00  00+04:00<br />
|}
|}
:g. Edit the server’s local config file
:g. Update the localconfig values for this server:


{| class="screen" style="margin-left: .5in; border-collapse: collapse; mso-yfti-tbllook: 480; mso-padding-alt: 0in 5.4pt 0in 5.4pt"
{| class="screen" style="margin-left: .5in; border-collapse: collapse; mso-yfti-tbllook: 480; mso-padding-alt: 0in 5.4pt 0in 5.4pt"
|- style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes; page-break-inside: avoid"
|- style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes; page-break-inside: avoid"
| style="width: 4.9in; background: #E6E6E6; padding: 0in 5.4pt 0in 5.4pt" width="588" |
| style="width: 4.9in; background: #E6E6E6; padding: 0in 5.4pt 0in 5.4pt" width="588" |
zmlocalconfig –e ldap_master_url= <new_master_directory_address> <br>zmlocalconfig –e ldap_url= <new_master_directory_address><br>zmlocalconfig –e ldap_is_master= true
zmlocalconfig –e ldap_master_url= <new_master_directory_address> <br>zmlocalconfig –e ldap_url= <new_master_directory_address><br>zmlocalconfig –e ldap_is_master= true<br>
zmlocalconfig –e ldap_host= <newmaster_directory_host>
|}
|}
 
:h. On all other servers, update the localconfig values:
:h. Change the LDAP host
 
{| class="screen" style="margin-left: .5in; border-collapse: collapse; mso-yfti-tbllook: 480; mso-padding-alt: 0in 5.4pt 0in 5.4pt"
{| class="screen" style="margin-left: .5in; border-collapse: collapse; mso-yfti-tbllook: 480; mso-padding-alt: 0in 5.4pt 0in 5.4pt"
|- style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes; page-break-inside: avoid"
|- style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes; page-break-inside: avoid"
| style="width: 4.9in; background: #E6E6E6; padding: 0in 5.4pt 0in 5.4pt" width="588" |
| style="width: 4.9in; background: #E6E6E6; padding: 0in 5.4pt 0in 5.4pt" width="588" |
zmlocalconfig –e ldap_master_url= <new_master_directory_address> <br>zmlocalconfig –e ldap_url= <new_master_directory_address><br>
zmlocalconfig –e ldap_host= <newmaster_directory_host>
zmlocalconfig –e ldap_host= <newmaster_directory_host>
|}
|}

Revision as of 16:38, 2 October 2009

Only one master LDAP server can exist and this LDAP server is authoritative for user information, server configuration, etc. The instructions that follow explain how to promote a replica LDAP server to master and disable the previous LDAP master.

Promoting a Replica Server – Demoting the Master Server

Before you can promote a replica LDAP server to become the master LDAP server, your LDAP replication servers must be up and working correctly; that is the replica LDAP server(s) must be receiving LDAP updates from the master. See the Multi-Server Installation Guide, LDAP Replication Installation chapter.

To promote a replica server to be master

  1. Shut down all services on all ZCS servers by running zmcontrol stop.
  2. On the replica LDAP server that will be the new master LDAP server, do the following as the zimbra user:
a. Start ldap: ldap start
b. Note the ldap root password, as it will be used extensively: zmlocalconfig -s ldap_root_password
c. Update the main ldap database to be a master:

ldapmodify -x -H ldapi:/// -D "cn=config" -w "ldap root password"
dn: olcDatabase={2}hdb,cn=config
changetype:modify
delete: olcSyncrepl

ldapmodify -x -H ldapi:/// -D "cn=config" -w "ldap root password"
dn: olcDatabase={2}hdb,cn=config
changetype:modify
delete: olcUpdateRef

ldapmodify -x -H ldapi:/// -D "cn=config" -w "ldap root password"
dn: olcOverlay={0}syncprov,olcDatabase={2}hdb,cn=config
changetype:modify
add: olcSpCheckpoint
olcSpCheckpoint: 20 10

ldapmodify -x -H ldapi:/// -D "cn=config" -w "ldap root password"
dn: olcOverlay={0}syncprov,olcDatabase={2}hdb,cn=config
changetype:modify
add: olcSpSessionLog
olcSpSessionlog: 500

d. Prepare the accesslog database for the new master:

ldap stop

cd /opt/zimbra/data/ldap
mkdir -p accesslog/db
mkdir -p accesslog/logs

e. Copy in the relevant DB_CONFIG file. For a custom DB_CONFIG:

cp /opt/zimbra/conf/custom/ldap/DB_CONFIG.accesslog /opt/zimbra/accesslog/db/DB_CONFIG

For the default DB_CONFIG:

cp /opt/zimbra/openldap/var/openldap-data/DB_CONFIG.accesslog /opt/zimbra/accesslog/db/DB_CONFIG

Start ldap again:

ldap start

f. Add the accesslog database:

ldapadd -x -H ldapi:/// -D "cn=config" -w "ldap root password" dn: olcDatabase={2}hdb,cn=config
changetype: add
objectClass: olcDatabaseConfig
objectClass: olcHdbConfig
olcDatabase: {2}hdb
olcDbDirectory: /opt/zimbra/data/ldap/accesslog/db
olcSuffix: cn=accesslog
olcAccess: {0}to dn.subtree="cn=accesslog" by dn.exact="uid=zimbra,cn=admins,cn=zimbra" read by dn.exact="cn=config" read by dn.exact="uid=zmreplica,cn=admins,cn=zimbra" read
olcLastMod: TRUE
olcMaxDerefDepth: 15
olcReadOnly: FALSE
olcRootDN: cn=config
olcSizeLimit: unlimited
olcTimeLimit: unlimited
olcMonitoring: TRUE
olcDbCacheSize: 10000
olcDbCheckpoint: 64 5
olcDbNoSync: FALSE
olcDbDirtyRead: FALSE
olcDbIDLcacheSize: 10000
olcDbIndex: entryCSN eq
olcDbIndex: objectClass eq
olcDbIndex: reqEnd eq
olcDbIndex: reqResult eq
olcDbIndex: reqStart eq
olcDbLinearIndex: FALSE
olcDbMode: 0600
olcDbSearchStack: 16
olcDbShmKey: 0
olcDbCacheFree: 1
olcDbDNcacheSize: 0

ldapadd -x -H ldapi:/// -D "cn=config" -w "ldap root password"
dn: olcOverlay=syncprov,olcDatabase={2}hdb,cn=config
changetype: add
objectClass: olcOverlayConfig
objectClass: olcSyncProvConfig
olcOverlay: syncprov
olcSpNoPresent: TRUE
olcSpReloadHint: TRUE

ldapadd -x -H ldapi:/// -D "cn=config" -w "ldap root password"
dn: olcOverlay=accesslog,olcDatabase={3}hdb,cn=config
changetype: add
objectClass: olcOverlayConfig
objectClass: olcAccessLogConfig
olcOverlay: accesslog
olcAccessLogDB: cn=accesslog
olcAccessLogOps: writes
olcAccessLogSuccess: TRUE
olcAccessLogPurge: 01+00:00 00+04:00

g. Update the localconfig values for this server:

zmlocalconfig –e ldap_master_url= <new_master_directory_address>
zmlocalconfig –e ldap_url= <new_master_directory_address>
zmlocalconfig –e ldap_is_master= true
zmlocalconfig –e ldap_host= <newmaster_directory_host>

h. On all other servers, update the localconfig values:

zmlocalconfig –e ldap_master_url= <new_master_directory_address>
zmlocalconfig –e ldap_url= <new_master_directory_address>
zmlocalconfig –e ldap_host= <newmaster_directory_host>

3. Now you run zmmtainit to edit the ldap*.cf files in /opt/zimbra/conf to set the new master LDAP server as the authority for the MTA.These files tell Postfix how to connect to the LDAP server for various commands. If you are moving the directories, you might have Postfix pointing to a server that no longer runs LDAP, which will cause mail delivery to stop.

Note: zmmtainit should be run on the hosts that are running an MTA, but is not required on the other hosts.

As zimbra, type the following. The "XX" is a dummy value. The zmmtainit command will use the ldap_url value from localconfig in spite of this.

/opt/zimbra/libexec/zmmtainit XX

4. Start the new LDAP master, type zmcontrol start. Then start up the services on all the other servers. At this point, services should be up and running on all hosts, and they should all be working off the new Master LDAP server.

Shut down the previous master

The old LDAP master must be disabled.

Related Articles

LDAP


Verified Against: Zimbra Collaboration Suite 6.0.2 Date Created: 10/1/2009
Article ID: https://wiki.zimbra.com/index.php?title=Promoting_Replica_to_LDAP_Master_6.0 Date Modified: 2009-10-02



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search