[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: how to best create a new slave server?



I keep an unused local replica on my master server to help create new
servers.  This way, I don't ever have to shutdown the master to copy
all of the files.

I have been recently wanted to try this method, which I think is much
better than copying the whole directory:

Modify slurpd config to replicate to your new host.  It will start
backlogging when you bring it back up.
Shutdown backup replica.
(possibly leave the hosts entry of the new server out, or block
network communication at first)
tar cf ldap.tar ./dn2id* #start the tar file
find ./ -name dn2id* | xargs tar uf ldap.tar #get the rest of the
database in there
scp ldap.tar.. and then tar xf #extract the tar into a new replica
slapindex

This way, you can tailor your replicas index configuration
I haven't tested it yet, but it will make the files easier to deal
with since they'll be a lot smaller.  Good luck.

On 10/18/05, Tomasz Chmielewski <mangoo@wpkg.org> wrote:
> What is the best and fastest way to create a slave OpenLDAP server?
>
> I mean, what should one do if he/she has a master OpenLDAP and several
> slaves, and want to create another slave?
>
> So far I was doing it more or less like this:
>
> 1) stopping OpenLDAP on the master,
> 2) tarring/bzipping /var/lib/ldap to ldap.tar.bz2,
> 3) adding a new replica to the slapd.conf on the master
> 4) scp-copying ldap.tar.bz2 to a new slave
> 5) uncompressing ldap.tar.bz2 to /var/lib/ldap on a new slave
> 6) starting OpenLDAP on the master
> 7) starting OpenLDAP on a new slave
>
> Which works perfectly, but I feel it's not just a "right way" (it would
> perhaps fail if OpenLDAP/database versions differ too much).
>
>
> So I tried a "better way":
>
> slapcat > db.ldif on a master
>
> and then it failed on a new slave:
>
> # ldapadd -x -D "cn=Manager,dc=some,dc=company" -W -f db.ldif
> Enter LDAP Password:
> adding new entry "dc=some,dc=company"
> ldap_add: Referral (10)
>          referrals:
>                  ldap://192.168.1.10:389/dc=some,dc=company
>
>
> so I reconfigured a new slave to be a standalone server for a while:
>
>
> # ldapadd -x -D "cn=Manager,dc=some,dc=company" -W -f db.ldif
> Enter LDAP Password:
> adding new entry "dc=some,dc=company"
> ldap_add: Constraint violation (19)
>          additional info: structuralObjectClass: no user modification
> allowed
>
>
> and it also failed.
>
>
> What is the best approach to create a new slave server?
>
>
> --
> Tomek
> http://wpkg.org
> WPKG - software deployment and upgrades with Samba
>