You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by Steve Hayden <hs...@yahoo.com> on 2011/10/04 17:31:54 UTC

Re: ApacheDS "Tools" "dump" question


Greetings,

I am pursuing the option you suggested of going to ApacheDS 2.0, and in the documentation ("http://directory.apache.org/apacheds/1.5/mitosis-development-guide.html") it indicates the way to setup replication is as follows:


Configuration
The replication system is a Multi-Master replication, ie, each server can 
update any server it is connected to. The way you tell a server to replicate to 
others is simple :
<replicationInterceptor>
<configuration>
<replicationConfiguration logMaxAge="5"
replicaId="instance_a"
replicationInterval="2"
responseTimeout="10"
serverPort="10390">
<s:property name="peerReplicas">
<s:set>
<s:value>instance_b@localhost:1234</s:value>
<s:value>instance_c@localhost:1234</s:value>
</s:set>
</s:property>
</replicationConfiguration>
</configuration>
</replicationInterceptor>



However, it does not indicate where this code should go (or am I blind?).
This looks like normal XML, but I do not find any XML files in the ApacheDS 2.0 folders/directories  (or again, am I blind?).

Any insight would be appreciated.

Kindest regards/thanks,
Steve


________________________________
From: Kiran Ayyagari <ka...@apache.org>
To: Steve Hayden <hs...@yahoo.com>
Sent: Thursday, September 29, 2011 10:33 AM
Subject: Re: ApacheDS "Tools" "dump" question

replication in 1.5.7 is broken, version 2.0-M2 has support for
replication(it is an implementation of RFC4533 (a.k.a syncrepl ) )
If upgrading to 2.0-M2 is not an option then I would suggest you to
write a program to take the dump of the directory data(in LDIF)
Implementing this using ApacheDirectory project's client-api [1] is
quite easy, let me know if you have any questions.

[1] http://directory.apache.org/api/java-api.html
On Thu, Sep 29, 2011 at 10:17 AM, Steve Hayden <hs...@yahoo.com> wrote:
> Greetings,
> Thanks for your prompt reply and information.
> Unfortunately using the Studio export/import is not an option in my
> application. What I am actually trying to do is to create a failover
> mechanism for when a "master" directory fails and must switch to another
> LDAP server (perhaps a sloave) that contains the same (or most of) the data
> contained in the master.  In the ApacheDS source code, there is some
> "replication" code, but it does not seem to do much/anything.
>
> Do you have any advice on how to implement failover/redundancy?
> Thanks in advance.
> Steve
> ________________________________
> From: Kiran Ayyagari <ka...@apache.org>
> To: users@directory.apache.org; Steve Hayden <hs...@yahoo.com>
> Sent: Wednesday, September 28, 2011 5:58 PM
> Subject: Re: ApacheDS "Tools" "dump" question
>
> the tools project is quite old(broken) and not maintained at the moment
> if you want to take a dump would suggest to use Studio's export feature
>
> HTH
> On Wed, Sep 28, 2011 at 4:11 PM, Steve Hayden <hs...@yahoo.com> wrote:
>> Greetings,
>>
>> I am attempting to use the "dump" utility contained in the
>> "apacheds-tools.jar"and am having some
>> difficulties. I am attempting this on a Windows 7 environment (and will
>> also need to do it on Linux).
>> I have tried this with the 1.5.5 and 1.5.7 versions of ApacheDS, and
>> "dump" does not seems to work on
>> either.  I have the "apacheds-tools.jar" in the folder:
>>
>> "C:\Software_Downloads\ApacheDS\apacheds_1.5.7\bin"
>>
>> and am using using the command:
>>
>> java -jar apacheds-tools.jar dump -p system -i C:\app\data\ldap
>>
>>
>> (the "schema" and "system" files that ApacheDS creates are in that "ldap"
>> folder). Executing the command
>> above results in the following exception:
>>
>> ***************** Begin of output/exceptions *************
>>        _                     _          ____  ____    _____           _
>>       / \   _ __   __ _  ___| |__   ___|  _ \/ ___|  |_   _|__   ___ |
>> |___
>>      / _ \ | '_ \ / _` |/ __| '_ \ / _ \ | | \___ \    | |/ _ \ / _ \| /
>> __|
>>     / ___ \| |_) | (_| | (__| | | |  __/ |_| |___) |   | | (_) | (_) | \__
>> \
>>    /_/   \_\ .__/ \__,_|\___|_| |_|\___|____/|____/    |_|\___/
>> \___/|_|___/
>>            |_|
>>
>> Exception in thread "main" java.lang.IllegalStateException:
>> C:\ofm\data\ldap\bin does not exist!
>>         at
>> org.apache.directory.daemon.InstallationLayout.verifyInstallation(InstallationLayout.java:294)
>>         at
>> org.apache.directory.server.tools.DumpCommand.execute(DumpCommand.java:156)
>>         at
>> org.apache.directory.server.tools.ApachedsTools.main(ApachedsTools.java:112)
>>
>> ******************* End of output/exceptions *************
>>
>> As there does not appear to be a "bin" folder created by the ApacheDS
>> startup (or upon creation of a
>> new LDAP), it seems that the tool (given the ouput above) is expecting
>> that folder to exist.
>>
>> Is there something I'm doing wrong?
>>
>> Any insight/clue would be appreciated.
>>
>> Kindest regards/thanks,
>> Steve
>>
>
>
>
> --
> Kiran Ayyagari
>
>
>



-- 
Kiran Ayyagari

Re: ApacheDS "Tools" "dump" question

Posted by Kiran Ayyagari <ka...@apache.org>.
just a note that the current implementation works in Master-Slave mode only

On Tue, Oct 4, 2011 at 12:57 PM, Kiran Ayyagari <ka...@apache.org> wrote:
> On Tue, Oct 4, 2011 at 12:35 PM, Steve Hayden <hs...@yahoo.com> wrote:
>> Greetings,
>> Thanks for prompt response and information.
>>
>> As far as the steps below,
>>
>> 1) is the first step performed on the "master", and the second performed on the (for lack of better term) "slave"?
> yes
>> 2) if the answer to the first question is "yes", then I presume that in the second step, as it indicates "localhost", that both servers are running on the same machine in this case?
> yeah, I just provided that as an example, it can be a different host name
>> 3) as both steps below include LDIF, I presume I could "import" the associated LDIF's using the import function in Apache Directory Studio (once modified to the specifics of my environment)?
> yeap
>> 4) for the parameter/value "ads-replRefreshInterval: 60000", what is the time increment (does "60000" equal 60 (e.g. "refresh every 60 seconds)?
> yes, the value is given in milli seconds
>> 5) for the parameter/value "ads-searchBaseDN: ou=system", does that mean "only update/replicate data/updates in the "ou=system" part of the DIT? (and if so, how does one replicate both "ou=system" and "ou=schema" for example)
>>
> again this was just an example, you can give any partition that you
> want to replicate.with and currently there exists support for
> replicating
> with multiple partitions, however I think the config reader won't
> support at the moment (thanks for bringing this up, this reminded me
> about the
> forgotten issue with the config reader), will fix this in the trunk
>>
>> Thanks in advance for your invaluable information.
>>
>> Kindest regards,
>> Steve
>>
>> ----- Original Message -----
>> From: Kiran Ayyagari <ka...@apache.org>
>> To: Steve Hayden <hs...@yahoo.com>; users@directory.apache.org
>> Cc:
>> Sent: Tuesday, October 4, 2011 12:05 PM
>> Subject: Re: ApacheDS "Tools" "dump" question
>>
>> Hi Steve,
>>
>>     The configuration for version 2.0 is stored in an LDIF file. This
>> configuration is also exposed as a partition named ou=config
>>
>>     1. To make a server respond to replication requests add the
>> attribute ads-replReqHandler with the value
>>         org.apache.directory.server.ldap.replication.provider.SyncReplRequestHandler
>>
>>     (you can also directly execute the below LDIF directly )
>>
>> dn: ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
>> changetype: modify
>> add: ads-replReqHandler
>> ads-replReqHandler:
>> org.apache.directory.server.ldap.replication.provider.SyncReplRequestHandler
>>
>>
>>     2. To replicate with another server add an entry with the
>> objectclass 'ads-replConsumer' under
>> ou=replConsumers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
>>
>>   an example would be
>>
>> dn: ads-replConsumerId=1,ou=replConsumers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
>> objectClass: ads-base
>> objectClass: ads-replConsumer
>> objectClass: top
>> ads-replAliasDerefMode: never
>> ads-replAttributes: *
>> ads-replConsumerId: 1
>> ads-replProvHostName: localhost
>> ads-replProvPort: 1090
>> ads-replRefreshInterval: 60000
>> ads-replRefreshNPersist: true
>> ads-replSearchFilter: (objectClass=*)
>> ads-replSearchScope: sub
>> ads-replSearchSizeLimit: 0
>> ads-replSearchTimeOut: 0
>> ads-replUserDn: uid=admin,ou=system
>> ads-replUserPassword:: c2VjcmV0
>> ads-searchBaseDN: ou=system
>>
>>
>>         finally the server needs to be restarted to make these changes effective
>>
>> Let us know if you have any other questions
>>
>> On Tue, Oct 4, 2011 at 11:31 AM, Steve Hayden <hs...@yahoo.com> wrote:
>>>
>>>
>>> Greetings,
>>>
>>> I am pursuing the option you suggested of going to ApacheDS 2.0, and in the documentation ("http://directory.apache.org/apacheds/1.5/mitosis-development-guide.html") it indicates the way to setup replication is as follows:
>>>
>>>
>>> Configuration
>>> The replication system is a Multi-Master replication, ie, each server can
>>> update any server it is connected to. The way you tell a server to replicate to
>>> others is simple :
>>> <replicationInterceptor>
>>> <configuration>
>>> <replicationConfiguration logMaxAge="5"
>>> replicaId="instance_a"
>>> replicationInterval="2"
>>> responseTimeout="10"
>>> serverPort="10390">
>>> <s:property name="peerReplicas">
>>> <s:set>
>>> <s:value>instance_b@localhost:1234</s:value>
>>> <s:value>instance_c@localhost:1234</s:value>
>>> </s:set>
>>> </s:property>
>>> </replicationConfiguration>
>>> </configuration>
>>> </replicationInterceptor>
>>>
>>>
>>>
>>> However, it does not indicate where this code should go (or am I blind?).
>>> This looks like normal XML, but I do not find any XML files in the ApacheDS 2.0 folders/directories  (or again, am I blind?).
>>>
>>> Any insight would be appreciated.
>>>
>>> Kindest regards/thanks,
>>> Steve
>>>
>>>
>>> ________________________________
>>> From: Kiran Ayyagari <ka...@apache.org>
>>> To: Steve Hayden <hs...@yahoo.com>
>>> Sent: Thursday, September 29, 2011 10:33 AM
>>> Subject: Re: ApacheDS "Tools" "dump" question
>>>
>>> replication in 1.5.7 is broken, version 2.0-M2 has support for
>>> replication(it is an implementation of RFC4533 (a.k.a syncrepl ) )
>>> If upgrading to 2.0-M2 is not an option then I would suggest you to
>>> write a program to take the dump of the directory data(in LDIF)
>>> Implementing this using ApacheDirectory project's client-api [1] is
>>> quite easy, let me know if you have any questions.
>>>
>>> [1] http://directory.apache.org/api/java-api.html
>>> On Thu, Sep 29, 2011 at 10:17 AM, Steve Hayden <hs...@yahoo.com> wrote:
>>>> Greetings,
>>>> Thanks for your prompt reply and information.
>>>> Unfortunately using the Studio export/import is not an option in my
>>>> application. What I am actually trying to do is to create a failover
>>>> mechanism for when a "master" directory fails and must switch to another
>>>> LDAP server (perhaps a sloave) that contains the same (or most of) the data
>>>> contained in the master.  In the ApacheDS source code, there is some
>>>> "replication" code, but it does not seem to do much/anything.
>>>>
>>>> Do you have any advice on how to implement failover/redundancy?
>>>> Thanks in advance.
>>>> Steve
>>>> ________________________________
>>>> From: Kiran Ayyagari <ka...@apache.org>
>>>> To: users@directory.apache.org; Steve Hayden <hs...@yahoo.com>
>>>> Sent: Wednesday, September 28, 2011 5:58 PM
>>>> Subject: Re: ApacheDS "Tools" "dump" question
>>>>
>>>> the tools project is quite old(broken) and not maintained at the moment
>>>> if you want to take a dump would suggest to use Studio's export feature
>>>>
>>>> HTH
>>>> On Wed, Sep 28, 2011 at 4:11 PM, Steve Hayden <hs...@yahoo.com> wrote:
>>>>> Greetings,
>>>>>
>>>>> I am attempting to use the "dump" utility contained in the
>>>>> "apacheds-tools.jar"and am having some
>>>>> difficulties. I am attempting this on a Windows 7 environment (and will
>>>>> also need to do it on Linux).
>>>>> I have tried this with the 1.5.5 and 1.5.7 versions of ApacheDS, and
>>>>> "dump" does not seems to work on
>>>>> either.  I have the "apacheds-tools.jar" in the folder:
>>>>>
>>>>> "C:\Software_Downloads\ApacheDS\apacheds_1.5.7\bin"
>>>>>
>>>>> and am using using the command:
>>>>>
>>>>> java -jar apacheds-tools.jar dump -p system -i C:\app\data\ldap
>>>>>
>>>>>
>>>>> (the "schema" and "system" files that ApacheDS creates are in that "ldap"
>>>>> folder). Executing the command
>>>>> above results in the following exception:
>>>>>
>>>>> ***************** Begin of output/exceptions *************
>>>>>        _                     _          ____  ____    _____           _
>>>>>       / \   _ __   __ _  ___| |__   ___|  _ \/ ___|  |_   _|__   ___ |
>>>>> |___
>>>>>      / _ \ | '_ \ / _` |/ __| '_ \ / _ \ | | \___ \    | |/ _ \ / _ \| /
>>>>> __|
>>>>>     / ___ \| |_) | (_| | (__| | | |  __/ |_| |___) |   | | (_) | (_) | \__
>>>>> \
>>>>>    /_/   \_\ .__/ \__,_|\___|_| |_|\___|____/|____/    |_|\___/
>>>>> \___/|_|___/
>>>>>            |_|
>>>>>
>>>>> Exception in thread "main" java.lang.IllegalStateException:
>>>>> C:\ofm\data\ldap\bin does not exist!
>>>>>         at
>>>>> org.apache.directory.daemon.InstallationLayout.verifyInstallation(InstallationLayout.java:294)
>>>>>         at
>>>>> org.apache.directory.server.tools.DumpCommand.execute(DumpCommand.java:156)
>>>>>         at
>>>>> org.apache.directory.server.tools.ApachedsTools.main(ApachedsTools.java:112)
>>>>>
>>>>> ******************* End of output/exceptions *************
>>>>>
>>>>> As there does not appear to be a "bin" folder created by the ApacheDS
>>>>> startup (or upon creation of a
>>>>> new LDAP), it seems that the tool (given the ouput above) is expecting
>>>>> that folder to exist.
>>>>>
>>>>> Is there something I'm doing wrong?
>>>>>
>>>>> Any insight/clue would be appreciated.
>>>>>
>>>>> Kindest regards/thanks,
>>>>> Steve
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Kiran Ayyagari
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Kiran Ayyagari
>>>
>>
>>
>>
>> --
>> Kiran Ayyagari
>>
>>
>
>
>
> --
> Kiran Ayyagari
>



-- 
Kiran Ayyagari

Re: ApacheDS "Tools" "dump" question

Posted by Emmanuel Lécharny <el...@apache.org>.
On 10/6/11 6:02 AM, Steve Hayden wrote:
> Greetings,
>
> I attempted to import the data you defined in your earlier email (I placed the following in a file named "Apache--Master-LDAP.ldif") as follows:
>
> dn: ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
> changetype: modify
> add: ads-replReqHandler
> ads-replReqHandler:
> org.apache.directory.server.ldap.replication.provider.SyncReplRequestHandler
You should have a space at the beginning of the last line, if there is a 
new line (unless it's an artifact because you are using an editor).

Otherwise, there is a missing '-' at the end of the ldif. It should be :

dn: ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
changetype: modify
add: ads-replReqHandler
ads-replReqHandler: org.apache.directory.server.ldap.replication.provider.SyncReplRequestHandler
-



-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com


Re: ApacheDS "Tools" "dump" question

Posted by Steve Hayden <hs...@yahoo.com>.
Greetings,

I attempted to import the data you defined in your earlier email (I placed the following in a file named "Apache--Master-LDAP.ldif") as follows:

dn: ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
changetype: modify
add: ads-replReqHandler
ads-replReqHandler: 
org.apache.directory.server.ldap.replication.provider.SyncReplRequestHandler


In Apache Directory Studio ("Version: 1.5.3.v20100330"), I attempted to import the above file and received the following exception:

************** Begin of exception ****************
Error while importing LDIF
 - Record is invalid
  javax.naming.NamingException: Record is invalid
    at org.apache.directory.studio.ldapbrowser.core.jobs.ImportLdifJob.importLdifRecord(ImportLdifJob.java:403)
    at org.apache.directory.studio.ldapbrowser.core.jobs.ImportLdifJob.importLdif(ImportLdifJob.java:267)
    at org.apache.directory.studio.ldapbrowser.core.jobs.ImportLdifJob.executeNotificationJob(ImportLdifJob.java:204)
    at org.apache.directory.studio.ldapbrowser.core.jobs.AbstractNotificationJob.executeAsyncJob(AbstractNotificationJob.java:43)
    at org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob.run(AbstractEclipseJob.java:101)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

  Record is invalid


************** End of exception ****************

(I pretty much just cut/pasted the above LDIF file contents from your earlier note. Is the syntax correct?)

To assure I have created/started the servers properly, please give me a sanity check on my method.

1) I made a copy of the folder "~\ApacheDS\instances\default", and copied that whole folder hierarchy to another folder.

2) In the new "ApacheDS\instances" folder I made a copy of the "default" folder, renamed it "instances\ApacheDS_Server2" (the "master"), and in the "instances\ApacheDS_Server2\conf\config.ldif" file, changed the "ads-systemport" to the following:

dn: ads-transportid=ldap,ou=transports,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
ads-systemport: 20389

3) I successfully started this server by (from CLI prompt) issuing the command:

java -jar apacheds-service-2.0.0-M3.jar instances/ApacheDS_Server2/

and could successfully connect to it with Apache Directory Studio using the port 20389.

4) I repeated step 2 above and created a new instance "instances\ApacheDS_Server3" (the "slave"), and changed it's "ads-systemport" to the following: 

dn: ads-transportid=ldap,ou=transports,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
ads-systemport: 30389

And started this server by (from CLI prompt) issuing the command:

java -jar apacheds-service-2.0.0-M3.jar instances/ApacheDS_Server3/

I then used the Apache Directory Studio to import the LDIF file above to the "ApacheDS_Server2" and got the exceptions posted above. Upon review of what I had done in the above steps, I noticed that in the "config.ldif" files, there were several occurrences of the text "default", so was wondering if I should have replaced all occurrences of "ads-directoryServiceId=default" with "ads-directoryServiceId=ApacheDS_Server2" for the "master", (and "ApacheDS_Server3" for the slave in it's "config.ldif" file).

Again, thanks for any insight/advice/comments.

Kindest regards,
Steve



----- Original Message -----")apache.org>
To: Steve Hayden <hs...@yahoo.com>; "users@directory.apache.org" <us...@directory.apache.org>
Cc: 
Sent: Wednesday, October 5, 2011 7:04 PM
Subject: Re: ApacheDS "Tools" "dump" question

On Wed, Oct 5, 2011 at 2:50 PM, Steve Hayden <hs...@yahoo.com> wrote:
> Greetings,
>
> First, let me say I'm sorry to keep pestering you with additional questions and express my gratitude for your help.
>
np, you are welcome!
> With regard to your statements "the config reader won't support at the moment", and "will fix this in the trunk", please help me understand these.
>
>
> 1) Is the "config reader" the "utility" within Apache Directory Studio that will be reading in the LDIF snippets you provided, and that data will be added to the "ou=config" within the LDAP as seen in Apache Directory Studio (more specifically, where in hierarchy as seen in Apache Directory Studio does the replication configuration data go)?
consider Studio as just an 'editor' for this scenario, the config
reader that am talking about is the one present inside the server that
reads
the configuration from config.ldif file
And coming to the location where the config data/entry goes, I have
given the DN in the earlier mail
(ou=replConsumers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config)

Note that you can also edit the configuration file config.ldif with a
text editor but it is ideal to use Studio cause it is easy and also
prevents
some editing mistakes
> 2) As far as the "will fix this in the trunk", how/when could one lay hands on the update?
grab the sources from trunk and build it [1]
> 3) Is there an "alternate" way to (for lack of better word) "ingest" the LDIF into a directory other than Apache Directory Studio "import LDIF" (e.g could a Java program/method "populate" that data into a directory)?
you can use ldapadd command or any other ldap client program
> 4) And if one can "programmatically" add (or update existing) "replication" data, one could do this anytime (for example, once I've populated the LDAP with the data in step 2 below (the slave), if I wanted the slave to become the master, and create another server to become a new slave, could I simply apply the associated #1 and #2 LDIF files to the appropriate servers/machines?
yes
> 5) Would you consider ApacheDS 2.0 ready for production?
>
there are no serious bugs that would prevent its usage in production,
if you want to use it then I would suggest to have some safe backup
mechanism
for the data. Having said all this personally I won't hesitate to use
this in production environment.
>
> (I apologize if I've used the wrong/confusing jargon, please bear with me.)
>
again you are welcome, and glad that you have asked these questions

> Kindest regards/thanks,
> Steve
>
>

[1] svn checkout
http://svn.apache.org/repos/asf/directory/apacheds/trunk-with-dependencies
    Let us know if you have issues in building it

>
> ----- Original Message -----
> From: Kiran Ayyagari <ka...@apache.org>
> To: Steve Hayden <hs...@yahoo.com>; users@directory.apache.org
> Cc:
> Sent: Tuesday, October 4, 2011 12:57 PM
> Subject: Re: ApacheDS "Tools" "dump" question
>
> On Tue, Oct 4, 2011 at 12:35 PM, Steve Hayden <hs...@yahoo.com> wrote:
>> Greetings,
>> Thanks for prompt response and information.
>>
>> As far as the steps below,
>>
>> 1) is the first step performed on the "master", and the second performed on the (for lack of better term) "slave"?
> yes
>> 2) if the answer to the first question is "yes", then I presume that in the second step, as it indicates "localhost", that both servers are running on the same machine in this case?
> yeah, I just provided that as an example, it can be a different host name
>> 3) as both steps below include LDIF, I presume I could "import" the associated LDIF's using the import function in Apache Directory Studio (once modified to the specifics of my environment)?
> yeap
>> 4) for the parameter/value "ads-replRefreshInterval: 60000", what is the time increment (does "60000" equal 60 (e.g. "refresh every 60 seconds)?
> yes, the value is given in milli seconds
>> 5) for the parameter/value "ads-searchBaseDN: ou=system", does that mean "only update/replicate data/updates in the "ou=system" part of the DIT? (and if so, how does one replicate both "ou=system" and "ou=schema" for example)
>>
> again this was just an example, you can give any partition that you
> want to replicate.with and currently there exists support for
> replicating
> with multiple partitions, however I think the config reader won't
> support at the moment (thanks for bringing this up, this reminded me
> about the
> forgotten issue with the config reader), will fix this in the trunk
>>
>> Thanks in advance for your invaluable information.
>>
>> Kindest regards,
>> Steve
>>
>> ----- Original Message -----
>> From: Kiran Ayyagari <ka...@apache.org>
>> To: Steve Hayden <hs...@yahoo.com>; users@directory.apache.org
>> Cc:
>> Sent: Tuesday, October 4, 2011 12:05 PM
>> Subject: Re: ApacheDS "Tools" "dump" question
>>
>> Hi Steve,
>>
>>     The configuration for version 2.0 is stored in an LDIF file. This
>> configuration is also exposed as a partition named ou=config
>>
>>     1. To make a server respond to replication requests add the
>> attribute ads-replReqHandler with the value
>>         org.apache.directory.server.ldap.replication.provider.SyncReplRequestHandler
>>
>>     (you can also directly execute the below LDIF directly )
>>
>> dn: ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
>> changetype: modify
>> add: ads-replReqHandler
>> ads-replReqHandler:
>> org.apache.directory.server.ldap.replication.provider.SyncReplRequestHandler
>>
>>
>>     2. To replicate with another server add an entry with the
>> objectclass 'ads-replConsumer' under
>> ou=replConsumers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
>>
>>   an example would be
>>
>> dn: ads-replConsumerId=1,ou=replConsumers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
>> objectClass: ads-base
>> objectClass: ads-replConsumer
>> objectClass: top
>> ads-replAliasDerefMode: never
>> ads-replAttributes: *
>> ads-replConsumerId: 1
>> ads-replProvHostName: localhost
>> ads-replProvPort: 1090
>> ads-replRefreshInterval: 60000
>> ads-replRefreshNPersist: true
>> ads-replSearchFilter: (objectClass=*)
>> ads-replSearchScope: sub
>> ads-replSearchSizeLimit: 0
>> ads-replSearchTimeOut: 0
>> ads-replUserDn: uid=admin,ou=system
>> ads-replUserPassword:: c2VjcmV0
>> ads-searchBaseDN: ou=system
>>
>>
>>         finally the server needs to be restarted to make these changes effective
>>
>> Let us know if you have any other questions
>>
>> On Tue, Oct 4, 2011 at 11:31 AM, Steve Hayden <hs...@yahoo.com> wrote:
>>>
>>>
>>> Greetings,
>>>
>>> I am pursuing the option you suggested of going to ApacheDS 2.0, and in the documentation ("http://directory.apache.org/apacheds/1.5/mitosis-development-guide.html") it indicates the way to setup replication is as follows:
>>>
>>>
>>> Configuration
>>> The replication system is a Multi-Master replication, ie, each server can
>>> update any server it is connected to. The way you tell a server to replicate to
>>> others is simple :
>>> <replicationInterceptor>
>>> <configuration>
>>> <replicationConfiguration logMaxAge="5"
>>> replicaId="instance_a"
>>> replicationInterval="2"
>>> responseTimeout="10"
>>> serverPort="10390">
>>> <s:property name="peerReplicas">
>>> <s:set>
>>> <s:value>instance_b@localhost:1234</s:value>
>>> <s:value>instance_c@localhost:1234</s:value>
>>> </s:set>
>>> </s:property>
>>> </replicationConfiguration>
>>> </configuration>
>>> </replicationInterceptor>
>>>
>>>
>>>
>>> However, it does not indicate where this code should go (or am I blind?).
>>> This looks like normal XML, but I do not find any XML files in the ApacheDS 2.0 folders/directories  (or again, am I blind?).
>>>
>>> Any insight would be appreciated.
>>>
>>> Kindest regards/thanks,
>>> Steve
>>>
>>>
>>> ________________________________
>>> From: Kiran Ayyagari <ka...@apache.org>
>>> To: Steve Hayden <hs...@yahoo.com>
>>> Sent: Thursday, September 29, 2011 10:33 AM
>>> Subject: Re: ApacheDS "Tools" "dump" question
>>>
>>> replication in 1.5.7 is broken, version 2.0-M2 has support for
>>> replication(it is an implementation of RFC4533 (a.k.a syncrepl ) )
>>> If upgrading to 2.0-M2 is not an option then I would suggest you to
>>> write a program to take the dump of the directory data(in LDIF)
>>> Implementing this using ApacheDirectory project's client-api [1] is
>>> quite easy, let me know if you have any questions.
>>>
>>> [1] http://directory.apache.org/api/java-api.html
>>> On Thu, Sep 29, 2011 at 10:17 AM, Steve Hayden <hs...@yahoo.com> wrote:
>>>> Greetings,
>>>> Thanks for your prompt reply and information.
>>>> Unfortunately using the Studio export/import is not an option in my
>>>> application. What I am actually trying to do is to create a failover
>>>> mechanism for when a "master" directory fails and must switch to another
>>>> LDAP server (perhaps a sloave) that contains the same (or most of) the data
>>>> contained in the master.  In the ApacheDS source code, there is some
>>>> "replication" code, but it does not seem to do much/anything.
>>>>
>>>> Do you have any advice on how to implement failover/redundancy?
>>>> Thanks in advance.
>>>> Steve
>>>> ________________________________
>>>> From: Kiran Ayyagari <ka...@apache.org>
>>>> To: users@directory.apache.org; Steve Hayden <hs...@yahoo.com>
>>>> Sent: Wednesday, September 28, 2011 5:58 PM
>>>> Subject: Re: ApacheDS "Tools" "dump" question
>>>>
>>>> the tools project is quite old(broken) and not maintained at the moment
>>>> if you want to take a dump would suggest to use Studio's export feature
>>>>
>>>> HTH
>>>> On Wed, Sep 28, 2011 at 4:11 PM, Steve Hayden <hs...@yahoo.com> wrote:
>>>>> Greetings,
>>>>>
>>>>> I am attempting to use the "dump" utility contained in the
>>>>> "apacheds-tools.jar"and am having some
>>>>> difficulties. I am attempting this on a Windows 7 environment (and will
>>>>> also need to do it on Linux).
>>>>> I have tried this with the 1.5.5 and 1.5.7 versions of ApacheDS, and
>>>>> "dump" does not seems to work on
>>>>> either.  I have the "apacheds-tools.jar" in the folder:
>>>>>
>>>>> "C:\Software_Downloads\ApacheDS\apacheds_1.5.7\bin"
>>>>>
>>>>> and am using using the command:
>>>>>
>>>>> java -jar apacheds-tools.jar dump -p system -i C:\app\data\ldap
>>>>>
>>>>>
>>>>> (the "schema" and "system" files that ApacheDS creates are in that "ldap"
>>>>> folder). Executing the command
>>>>> above results in the following exception:
>>>>>
>>>>> ***************** Begin of output/exceptions *************
>>>>>        _                     _          ____  ____    _____           _
>>>>>       / \   _ __   __ _  ___| |__   ___|  _ \/ ___|  |_   _|__   ___ |
>>>>> |___
>>>>>      / _ \ | '_ \ / _` |/ __| '_ \ / _ \ | | \___ \    | |/ _ \ / _ \| /
>>>>> __|
>>>>>     / ___ \| |_) | (_| | (__| | | |  __/ |_| |___) |   | | (_) | (_) | \__
>>>>> \
>>>>>    /_/   \_\ .__/ \__,_|\___|_| |_|\___|____/|____/    |_|\___/
>>>>> \___/|_|___/
>>>>>            |_|
>>>>>
>>>>> Exception in thread "main" java.lang.IllegalStateException:
>>>>> C:\ofm\data\ldap\bin does not exist!
>>>>>         at
>>>>> org.apache.directory.daemon.InstallationLayout.verifyInstallation(InstallationLayout.java:294)
>>>>>         at
>>>>> org.apache.directory.server.tools.DumpCommand.execute(DumpCommand.java:156)
>>>>>         at
>>>>> org.apache.directory.server.tools.ApachedsTools.main(ApachedsTools.java:112)
>>>>>
>>>>> ******************* End of output/exceptions *************
>>>>>
>>>>> As there does not appear to be a "bin" folder created by the ApacheDS
>>>>> startup (or upon creation of a
>>>>> new LDAP), it seems that the tool (given the ouput above) is expecting
>>>>> that folder to exist.
>>>>>
>>>>> Is there something I'm doing wrong?
>>>>>
>>>>> Any insight/clue would be appreciated.
>>>>>
>>>>> Kindest regards/thanks,
>>>>> Steve
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Kiran Ayyagari
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Kiran Ayyagari
>>>
>>
>>
>>
>> --
>> Kiran Ayyagari
>>
>>
>
>
>
> --
> Kiran Ayyagari
>



-- 
Kiran Ayyagari


Re: ApacheDS "Tools" "dump" question

Posted by Kiran Ayyagari <ka...@apache.org>.
On Wed, Oct 5, 2011 at 2:50 PM, Steve Hayden <hs...@yahoo.com> wrote:
> Greetings,
>
> First, let me say I'm sorry to keep pestering you with additional questions and express my gratitude for your help.
>
np, you are welcome!
> With regard to your statements "the config reader won't support at the moment", and "will fix this in the trunk", please help me understand these.
>
>
> 1) Is the "config reader" the "utility" within Apache Directory Studio that will be reading in the LDIF snippets you provided, and that data will be added to the "ou=config" within the LDAP as seen in Apache Directory Studio (more specifically, where in hierarchy as seen in Apache Directory Studio does the replication configuration data go)?
consider Studio as just an 'editor' for this scenario, the config
reader that am talking about is the one present inside the server that
reads
the configuration from config.ldif file
And coming to the location where the config data/entry goes, I have
given the DN in the earlier mail
(ou=replConsumers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config)

Note that you can also edit the configuration file config.ldif with a
text editor but it is ideal to use Studio cause it is easy and also
prevents
some editing mistakes
> 2) As far as the "will fix this in the trunk", how/when could one lay hands on the update?
grab the sources from trunk and build it [1]
> 3) Is there an "alternate" way to (for lack of better word) "ingest" the LDIF into a directory other than Apache Directory Studio "import LDIF" (e.g could a Java program/method "populate" that data into a directory)?
you can use ldapadd command or any other ldap client program
> 4) And if one can "programmatically" add (or update existing) "replication" data, one could do this anytime (for example, once I've populated the LDAP with the data in step 2 below (the slave), if I wanted the slave to become the master, and create another server to become a new slave, could I simply apply the associated #1 and #2 LDIF files to the appropriate servers/machines?
yes
> 5) Would you consider ApacheDS 2.0 ready for production?
>
there are no serious bugs that would prevent its usage in production,
if you want to use it then I would suggest to have some safe backup
mechanism
for the data. Having said all this personally I won't hesitate to use
this in production environment.
>
> (I apologize if I've used the wrong/confusing jargon, please bear with me.)
>
again you are welcome, and glad that you have asked these questions

> Kindest regards/thanks,
> Steve
>
>

[1] svn checkout
http://svn.apache.org/repos/asf/directory/apacheds/trunk-with-dependencies
    Let us know if you have issues in building it

>
> ----- Original Message -----
> From: Kiran Ayyagari <ka...@apache.org>
> To: Steve Hayden <hs...@yahoo.com>; users@directory.apache.org
> Cc:
> Sent: Tuesday, October 4, 2011 12:57 PM
> Subject: Re: ApacheDS "Tools" "dump" question
>
> On Tue, Oct 4, 2011 at 12:35 PM, Steve Hayden <hs...@yahoo.com> wrote:
>> Greetings,
>> Thanks for prompt response and information.
>>
>> As far as the steps below,
>>
>> 1) is the first step performed on the "master", and the second performed on the (for lack of better term) "slave"?
> yes
>> 2) if the answer to the first question is "yes", then I presume that in the second step, as it indicates "localhost", that both servers are running on the same machine in this case?
> yeah, I just provided that as an example, it can be a different host name
>> 3) as both steps below include LDIF, I presume I could "import" the associated LDIF's using the import function in Apache Directory Studio (once modified to the specifics of my environment)?
> yeap
>> 4) for the parameter/value "ads-replRefreshInterval: 60000", what is the time increment (does "60000" equal 60 (e.g. "refresh every 60 seconds)?
> yes, the value is given in milli seconds
>> 5) for the parameter/value "ads-searchBaseDN: ou=system", does that mean "only update/replicate data/updates in the "ou=system" part of the DIT? (and if so, how does one replicate both "ou=system" and "ou=schema" for example)
>>
> again this was just an example, you can give any partition that you
> want to replicate.with and currently there exists support for
> replicating
> with multiple partitions, however I think the config reader won't
> support at the moment (thanks for bringing this up, this reminded me
> about the
> forgotten issue with the config reader), will fix this in the trunk
>>
>> Thanks in advance for your invaluable information.
>>
>> Kindest regards,
>> Steve
>>
>> ----- Original Message -----
>> From: Kiran Ayyagari <ka...@apache.org>
>> To: Steve Hayden <hs...@yahoo.com>; users@directory.apache.org
>> Cc:
>> Sent: Tuesday, October 4, 2011 12:05 PM
>> Subject: Re: ApacheDS "Tools" "dump" question
>>
>> Hi Steve,
>>
>>     The configuration for version 2.0 is stored in an LDIF file. This
>> configuration is also exposed as a partition named ou=config
>>
>>     1. To make a server respond to replication requests add the
>> attribute ads-replReqHandler with the value
>>         org.apache.directory.server.ldap.replication.provider.SyncReplRequestHandler
>>
>>     (you can also directly execute the below LDIF directly )
>>
>> dn: ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
>> changetype: modify
>> add: ads-replReqHandler
>> ads-replReqHandler:
>> org.apache.directory.server.ldap.replication.provider.SyncReplRequestHandler
>>
>>
>>     2. To replicate with another server add an entry with the
>> objectclass 'ads-replConsumer' under
>> ou=replConsumers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
>>
>>   an example would be
>>
>> dn: ads-replConsumerId=1,ou=replConsumers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
>> objectClass: ads-base
>> objectClass: ads-replConsumer
>> objectClass: top
>> ads-replAliasDerefMode: never
>> ads-replAttributes: *
>> ads-replConsumerId: 1
>> ads-replProvHostName: localhost
>> ads-replProvPort: 1090
>> ads-replRefreshInterval: 60000
>> ads-replRefreshNPersist: true
>> ads-replSearchFilter: (objectClass=*)
>> ads-replSearchScope: sub
>> ads-replSearchSizeLimit: 0
>> ads-replSearchTimeOut: 0
>> ads-replUserDn: uid=admin,ou=system
>> ads-replUserPassword:: c2VjcmV0
>> ads-searchBaseDN: ou=system
>>
>>
>>         finally the server needs to be restarted to make these changes effective
>>
>> Let us know if you have any other questions
>>
>> On Tue, Oct 4, 2011 at 11:31 AM, Steve Hayden <hs...@yahoo.com> wrote:
>>>
>>>
>>> Greetings,
>>>
>>> I am pursuing the option you suggested of going to ApacheDS 2.0, and in the documentation ("http://directory.apache.org/apacheds/1.5/mitosis-development-guide.html") it indicates the way to setup replication is as follows:
>>>
>>>
>>> Configuration
>>> The replication system is a Multi-Master replication, ie, each server can
>>> update any server it is connected to. The way you tell a server to replicate to
>>> others is simple :
>>> <replicationInterceptor>
>>> <configuration>
>>> <replicationConfiguration logMaxAge="5"
>>> replicaId="instance_a"
>>> replicationInterval="2"
>>> responseTimeout="10"
>>> serverPort="10390">
>>> <s:property name="peerReplicas">
>>> <s:set>
>>> <s:value>instance_b@localhost:1234</s:value>
>>> <s:value>instance_c@localhost:1234</s:value>
>>> </s:set>
>>> </s:property>
>>> </replicationConfiguration>
>>> </configuration>
>>> </replicationInterceptor>
>>>
>>>
>>>
>>> However, it does not indicate where this code should go (or am I blind?).
>>> This looks like normal XML, but I do not find any XML files in the ApacheDS 2.0 folders/directories  (or again, am I blind?).
>>>
>>> Any insight would be appreciated.
>>>
>>> Kindest regards/thanks,
>>> Steve
>>>
>>>
>>> ________________________________
>>> From: Kiran Ayyagari <ka...@apache.org>
>>> To: Steve Hayden <hs...@yahoo.com>
>>> Sent: Thursday, September 29, 2011 10:33 AM
>>> Subject: Re: ApacheDS "Tools" "dump" question
>>>
>>> replication in 1.5.7 is broken, version 2.0-M2 has support for
>>> replication(it is an implementation of RFC4533 (a.k.a syncrepl ) )
>>> If upgrading to 2.0-M2 is not an option then I would suggest you to
>>> write a program to take the dump of the directory data(in LDIF)
>>> Implementing this using ApacheDirectory project's client-api [1] is
>>> quite easy, let me know if you have any questions.
>>>
>>> [1] http://directory.apache.org/api/java-api.html
>>> On Thu, Sep 29, 2011 at 10:17 AM, Steve Hayden <hs...@yahoo.com> wrote:
>>>> Greetings,
>>>> Thanks for your prompt reply and information.
>>>> Unfortunately using the Studio export/import is not an option in my
>>>> application. What I am actually trying to do is to create a failover
>>>> mechanism for when a "master" directory fails and must switch to another
>>>> LDAP server (perhaps a sloave) that contains the same (or most of) the data
>>>> contained in the master.  In the ApacheDS source code, there is some
>>>> "replication" code, but it does not seem to do much/anything.
>>>>
>>>> Do you have any advice on how to implement failover/redundancy?
>>>> Thanks in advance.
>>>> Steve
>>>> ________________________________
>>>> From: Kiran Ayyagari <ka...@apache.org>
>>>> To: users@directory.apache.org; Steve Hayden <hs...@yahoo.com>
>>>> Sent: Wednesday, September 28, 2011 5:58 PM
>>>> Subject: Re: ApacheDS "Tools" "dump" question
>>>>
>>>> the tools project is quite old(broken) and not maintained at the moment
>>>> if you want to take a dump would suggest to use Studio's export feature
>>>>
>>>> HTH
>>>> On Wed, Sep 28, 2011 at 4:11 PM, Steve Hayden <hs...@yahoo.com> wrote:
>>>>> Greetings,
>>>>>
>>>>> I am attempting to use the "dump" utility contained in the
>>>>> "apacheds-tools.jar"and am having some
>>>>> difficulties. I am attempting this on a Windows 7 environment (and will
>>>>> also need to do it on Linux).
>>>>> I have tried this with the 1.5.5 and 1.5.7 versions of ApacheDS, and
>>>>> "dump" does not seems to work on
>>>>> either.  I have the "apacheds-tools.jar" in the folder:
>>>>>
>>>>> "C:\Software_Downloads\ApacheDS\apacheds_1.5.7\bin"
>>>>>
>>>>> and am using using the command:
>>>>>
>>>>> java -jar apacheds-tools.jar dump -p system -i C:\app\data\ldap
>>>>>
>>>>>
>>>>> (the "schema" and "system" files that ApacheDS creates are in that "ldap"
>>>>> folder). Executing the command
>>>>> above results in the following exception:
>>>>>
>>>>> ***************** Begin of output/exceptions *************
>>>>>        _                     _          ____  ____    _____           _
>>>>>       / \   _ __   __ _  ___| |__   ___|  _ \/ ___|  |_   _|__   ___ |
>>>>> |___
>>>>>      / _ \ | '_ \ / _` |/ __| '_ \ / _ \ | | \___ \    | |/ _ \ / _ \| /
>>>>> __|
>>>>>     / ___ \| |_) | (_| | (__| | | |  __/ |_| |___) |   | | (_) | (_) | \__
>>>>> \
>>>>>    /_/   \_\ .__/ \__,_|\___|_| |_|\___|____/|____/    |_|\___/
>>>>> \___/|_|___/
>>>>>            |_|
>>>>>
>>>>> Exception in thread "main" java.lang.IllegalStateException:
>>>>> C:\ofm\data\ldap\bin does not exist!
>>>>>         at
>>>>> org.apache.directory.daemon.InstallationLayout.verifyInstallation(InstallationLayout.java:294)
>>>>>         at
>>>>> org.apache.directory.server.tools.DumpCommand.execute(DumpCommand.java:156)
>>>>>         at
>>>>> org.apache.directory.server.tools.ApachedsTools.main(ApachedsTools.java:112)
>>>>>
>>>>> ******************* End of output/exceptions *************
>>>>>
>>>>> As there does not appear to be a "bin" folder created by the ApacheDS
>>>>> startup (or upon creation of a
>>>>> new LDAP), it seems that the tool (given the ouput above) is expecting
>>>>> that folder to exist.
>>>>>
>>>>> Is there something I'm doing wrong?
>>>>>
>>>>> Any insight/clue would be appreciated.
>>>>>
>>>>> Kindest regards/thanks,
>>>>> Steve
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Kiran Ayyagari
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Kiran Ayyagari
>>>
>>
>>
>>
>> --
>> Kiran Ayyagari
>>
>>
>
>
>
> --
> Kiran Ayyagari
>



-- 
Kiran Ayyagari

Re: ApacheDS "Tools" "dump" question

Posted by Steve Hayden <hs...@yahoo.com>.
Greetings,

First, let me say I'm sorry to keep pestering you with additional questions and express my gratitude for your help.

With regard to your statements "the config reader won't support at the moment", and "will fix this in the trunk", please help me understand these. 


1) Is the "config reader" the "utility" within Apache Directory Studio that will be reading in the LDIF snippets you provided, and that data will be added to the "ou=config" within the LDAP as seen in Apache Directory Studio (more specifically, where in hierarchy as seen in Apache Directory Studio does the replication configuration data go)?
2) As far as the "will fix this in the trunk", how/when could one lay hands on the update?
3) Is there an "alternate" way to (for lack of better word) "ingest" the LDIF into a directory other than Apache Directory Studio "import LDIF" (e.g could a Java program/method "populate" that data into a directory)?
4) And if one can "programmatically" add (or update existing) "replication" data, one could do this anytime (for example, once I've populated the LDAP with the data in step 2 below (the slave), if I wanted the slave to become the master, and create another server to become a new slave, could I simply apply the associated #1 and #2 LDIF files to the appropriate servers/machines?
5) Would you consider ApacheDS 2.0 ready for production?


(I apologize if I've used the wrong/confusing jargon, please bear with me.)

Kindest regards/thanks,
Steve



----- Original Message -----
From: Kiran Ayyagari <ka...@apache.org>
To: Steve Hayden <hs...@yahoo.com>; users@directory.apache.org
Cc: 
Sent: Tuesday, October 4, 2011 12:57 PM
Subject: Re: ApacheDS "Tools" "dump" question

On Tue, Oct 4, 2011 at 12:35 PM, Steve Hayden <hs...@yahoo.com> wrote:
> Greetings,
> Thanks for prompt response and information.
>
> As far as the steps below,
>
> 1) is the first step performed on the "master", and the second performed on the (for lack of better term) "slave"?
yes
> 2) if the answer to the first question is "yes", then I presume that in the second step, as it indicates "localhost", that both servers are running on the same machine in this case?
yeah, I just provided that as an example, it can be a different host name
> 3) as both steps below include LDIF, I presume I could "import" the associated LDIF's using the import function in Apache Directory Studio (once modified to the specifics of my environment)?
yeap
> 4) for the parameter/value "ads-replRefreshInterval: 60000", what is the time increment (does "60000" equal 60 (e.g. "refresh every 60 seconds)?
yes, the value is given in milli seconds
> 5) for the parameter/value "ads-searchBaseDN: ou=system", does that mean "only update/replicate data/updates in the "ou=system" part of the DIT? (and if so, how does one replicate both "ou=system" and "ou=schema" for example)
>
again this was just an example, you can give any partition that you
want to replicate.with and currently there exists support for
replicating
with multiple partitions, however I think the config reader won't
support at the moment (thanks for bringing this up, this reminded me
about the
forgotten issue with the config reader), will fix this in the trunk
>
> Thanks in advance for your invaluable information.
>
> Kindest regards,
> Steve
>
> ----- Original Message -----
> From: Kiran Ayyagari <ka...@apache.org>
> To: Steve Hayden <hs...@yahoo.com>; users@directory.apache.org
> Cc:
> Sent: Tuesday, October 4, 2011 12:05 PM
> Subject: Re: ApacheDS "Tools" "dump" question
>
> Hi Steve,
>
>     The configuration for version 2.0 is stored in an LDIF file. This
> configuration is also exposed as a partition named ou=config
>
>     1. To make a server respond to replication requests add the
> attribute ads-replReqHandler with the value
>         org.apache.directory.server.ldap.replication.provider.SyncReplRequestHandler
>
>     (you can also directly execute the below LDIF directly )
>
> dn: ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
> changetype: modify
> add: ads-replReqHandler
> ads-replReqHandler:
> org.apache.directory.server.ldap.replication.provider.SyncReplRequestHandler
>
>
>     2. To replicate with another server add an entry with the
> objectclass 'ads-replConsumer' under
> ou=replConsumers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
>
>   an example would be
>
> dn: ads-replConsumerId=1,ou=replConsumers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
> objectClass: ads-base
> objectClass: ads-replConsumer
> objectClass: top
> ads-replAliasDerefMode: never
> ads-replAttributes: *
> ads-replConsumerId: 1
> ads-replProvHostName: localhost
> ads-replProvPort: 1090
> ads-replRefreshInterval: 60000
> ads-replRefreshNPersist: true
> ads-replSearchFilter: (objectClass=*)
> ads-replSearchScope: sub
> ads-replSearchSizeLimit: 0
> ads-replSearchTimeOut: 0
> ads-replUserDn: uid=admin,ou=system
> ads-replUserPassword:: c2VjcmV0
> ads-searchBaseDN: ou=system
>
>
>         finally the server needs to be restarted to make these changes effective
>
> Let us know if you have any other questions
>
> On Tue, Oct 4, 2011 at 11:31 AM, Steve Hayden <hs...@yahoo.com> wrote:
>>
>>
>> Greetings,
>>
>> I am pursuing the option you suggested of going to ApacheDS 2.0, and in the documentation ("http://directory.apache.org/apacheds/1.5/mitosis-development-guide.html") it indicates the way to setup replication is as follows:
>>
>>
>> Configuration
>> The replication system is a Multi-Master replication, ie, each server can
>> update any server it is connected to. The way you tell a server to replicate to
>> others is simple :
>> <replicationInterceptor>
>> <configuration>
>> <replicationConfiguration logMaxAge="5"
>> replicaId="instance_a"
>> replicationInterval="2"
>> responseTimeout="10"
>> serverPort="10390">
>> <s:property name="peerReplicas">
>> <s:set>
>> <s:value>instance_b@localhost:1234</s:value>
>> <s:value>instance_c@localhost:1234</s:value>
>> </s:set>
>> </s:property>
>> </replicationConfiguration>
>> </configuration>
>> </replicationInterceptor>
>>
>>
>>
>> However, it does not indicate where this code should go (or am I blind?).
>> This looks like normal XML, but I do not find any XML files in the ApacheDS 2.0 folders/directories  (or again, am I blind?).
>>
>> Any insight would be appreciated.
>>
>> Kindest regards/thanks,
>> Steve
>>
>>
>> ________________________________
>> From: Kiran Ayyagari <ka...@apache.org>
>> To: Steve Hayden <hs...@yahoo.com>
>> Sent: Thursday, September 29, 2011 10:33 AM
>> Subject: Re: ApacheDS "Tools" "dump" question
>>
>> replication in 1.5.7 is broken, version 2.0-M2 has support for
>> replication(it is an implementation of RFC4533 (a.k.a syncrepl ) )
>> If upgrading to 2.0-M2 is not an option then I would suggest you to
>> write a program to take the dump of the directory data(in LDIF)
>> Implementing this using ApacheDirectory project's client-api [1] is
>> quite easy, let me know if you have any questions.
>>
>> [1] http://directory.apache.org/api/java-api.html
>> On Thu, Sep 29, 2011 at 10:17 AM, Steve Hayden <hs...@yahoo.com> wrote:
>>> Greetings,
>>> Thanks for your prompt reply and information.
>>> Unfortunately using the Studio export/import is not an option in my
>>> application. What I am actually trying to do is to create a failover
>>> mechanism for when a "master" directory fails and must switch to another
>>> LDAP server (perhaps a sloave) that contains the same (or most of) the data
>>> contained in the master.  In the ApacheDS source code, there is some
>>> "replication" code, but it does not seem to do much/anything.
>>>
>>> Do you have any advice on how to implement failover/redundancy?
>>> Thanks in advance.
>>> Steve
>>> ________________________________
>>> From: Kiran Ayyagari <ka...@apache.org>
>>> To: users@directory.apache.org; Steve Hayden <hs...@yahoo.com>
>>> Sent: Wednesday, September 28, 2011 5:58 PM
>>> Subject: Re: ApacheDS "Tools" "dump" question
>>>
>>> the tools project is quite old(broken) and not maintained at the moment
>>> if you want to take a dump would suggest to use Studio's export feature
>>>
>>> HTH
>>> On Wed, Sep 28, 2011 at 4:11 PM, Steve Hayden <hs...@yahoo.com> wrote:
>>>> Greetings,
>>>>
>>>> I am attempting to use the "dump" utility contained in the
>>>> "apacheds-tools.jar"and am having some
>>>> difficulties. I am attempting this on a Windows 7 environment (and will
>>>> also need to do it on Linux).
>>>> I have tried this with the 1.5.5 and 1.5.7 versions of ApacheDS, and
>>>> "dump" does not seems to work on
>>>> either.  I have the "apacheds-tools.jar" in the folder:
>>>>
>>>> "C:\Software_Downloads\ApacheDS\apacheds_1.5.7\bin"
>>>>
>>>> and am using using the command:
>>>>
>>>> java -jar apacheds-tools.jar dump -p system -i C:\app\data\ldap
>>>>
>>>>
>>>> (the "schema" and "system" files that ApacheDS creates are in that "ldap"
>>>> folder). Executing the command
>>>> above results in the following exception:
>>>>
>>>> ***************** Begin of output/exceptions *************
>>>>        _                     _          ____  ____    _____           _
>>>>       / \   _ __   __ _  ___| |__   ___|  _ \/ ___|  |_   _|__   ___ |
>>>> |___
>>>>      / _ \ | '_ \ / _` |/ __| '_ \ / _ \ | | \___ \    | |/ _ \ / _ \| /
>>>> __|
>>>>     / ___ \| |_) | (_| | (__| | | |  __/ |_| |___) |   | | (_) | (_) | \__
>>>> \
>>>>    /_/   \_\ .__/ \__,_|\___|_| |_|\___|____/|____/    |_|\___/
>>>> \___/|_|___/
>>>>            |_|
>>>>
>>>> Exception in thread "main" java.lang.IllegalStateException:
>>>> C:\ofm\data\ldap\bin does not exist!
>>>>         at
>>>> org.apache.directory.daemon.InstallationLayout.verifyInstallation(InstallationLayout.java:294)
>>>>         at
>>>> org.apache.directory.server.tools.DumpCommand.execute(DumpCommand.java:156)
>>>>         at
>>>> org.apache.directory.server.tools.ApachedsTools.main(ApachedsTools.java:112)
>>>>
>>>> ******************* End of output/exceptions *************
>>>>
>>>> As there does not appear to be a "bin" folder created by the ApacheDS
>>>> startup (or upon creation of a
>>>> new LDAP), it seems that the tool (given the ouput above) is expecting
>>>> that folder to exist.
>>>>
>>>> Is there something I'm doing wrong?
>>>>
>>>> Any insight/clue would be appreciated.
>>>>
>>>> Kindest regards/thanks,
>>>> Steve
>>>>
>>>
>>>
>>>
>>> --
>>> Kiran Ayyagari
>>>
>>>
>>>
>>
>>
>>
>> --
>> Kiran Ayyagari
>>
>
>
>
> --
> Kiran Ayyagari
>
>



-- 
Kiran Ayyagari

Re: ApacheDS "Tools" "dump" question

Posted by Kiran Ayyagari <ka...@apache.org>.
On Tue, Oct 4, 2011 at 12:35 PM, Steve Hayden <hs...@yahoo.com> wrote:
> Greetings,
> Thanks for prompt response and information.
>
> As far as the steps below,
>
> 1) is the first step performed on the "master", and the second performed on the (for lack of better term) "slave"?
yes
> 2) if the answer to the first question is "yes", then I presume that in the second step, as it indicates "localhost", that both servers are running on the same machine in this case?
yeah, I just provided that as an example, it can be a different host name
> 3) as both steps below include LDIF, I presume I could "import" the associated LDIF's using the import function in Apache Directory Studio (once modified to the specifics of my environment)?
yeap
> 4) for the parameter/value "ads-replRefreshInterval: 60000", what is the time increment (does "60000" equal 60 (e.g. "refresh every 60 seconds)?
yes, the value is given in milli seconds
> 5) for the parameter/value "ads-searchBaseDN: ou=system", does that mean "only update/replicate data/updates in the "ou=system" part of the DIT? (and if so, how does one replicate both "ou=system" and "ou=schema" for example)
>
again this was just an example, you can give any partition that you
want to replicate.with and currently there exists support for
replicating
with multiple partitions, however I think the config reader won't
support at the moment (thanks for bringing this up, this reminded me
about the
forgotten issue with the config reader), will fix this in the trunk
>
> Thanks in advance for your invaluable information.
>
> Kindest regards,
> Steve
>
> ----- Original Message -----
> From: Kiran Ayyagari <ka...@apache.org>
> To: Steve Hayden <hs...@yahoo.com>; users@directory.apache.org
> Cc:
> Sent: Tuesday, October 4, 2011 12:05 PM
> Subject: Re: ApacheDS "Tools" "dump" question
>
> Hi Steve,
>
>     The configuration for version 2.0 is stored in an LDIF file. This
> configuration is also exposed as a partition named ou=config
>
>     1. To make a server respond to replication requests add the
> attribute ads-replReqHandler with the value
>         org.apache.directory.server.ldap.replication.provider.SyncReplRequestHandler
>
>     (you can also directly execute the below LDIF directly )
>
> dn: ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
> changetype: modify
> add: ads-replReqHandler
> ads-replReqHandler:
> org.apache.directory.server.ldap.replication.provider.SyncReplRequestHandler
>
>
>     2. To replicate with another server add an entry with the
> objectclass 'ads-replConsumer' under
> ou=replConsumers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
>
>   an example would be
>
> dn: ads-replConsumerId=1,ou=replConsumers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
> objectClass: ads-base
> objectClass: ads-replConsumer
> objectClass: top
> ads-replAliasDerefMode: never
> ads-replAttributes: *
> ads-replConsumerId: 1
> ads-replProvHostName: localhost
> ads-replProvPort: 1090
> ads-replRefreshInterval: 60000
> ads-replRefreshNPersist: true
> ads-replSearchFilter: (objectClass=*)
> ads-replSearchScope: sub
> ads-replSearchSizeLimit: 0
> ads-replSearchTimeOut: 0
> ads-replUserDn: uid=admin,ou=system
> ads-replUserPassword:: c2VjcmV0
> ads-searchBaseDN: ou=system
>
>
>         finally the server needs to be restarted to make these changes effective
>
> Let us know if you have any other questions
>
> On Tue, Oct 4, 2011 at 11:31 AM, Steve Hayden <hs...@yahoo.com> wrote:
>>
>>
>> Greetings,
>>
>> I am pursuing the option you suggested of going to ApacheDS 2.0, and in the documentation ("http://directory.apache.org/apacheds/1.5/mitosis-development-guide.html") it indicates the way to setup replication is as follows:
>>
>>
>> Configuration
>> The replication system is a Multi-Master replication, ie, each server can
>> update any server it is connected to. The way you tell a server to replicate to
>> others is simple :
>> <replicationInterceptor>
>> <configuration>
>> <replicationConfiguration logMaxAge="5"
>> replicaId="instance_a"
>> replicationInterval="2"
>> responseTimeout="10"
>> serverPort="10390">
>> <s:property name="peerReplicas">
>> <s:set>
>> <s:value>instance_b@localhost:1234</s:value>
>> <s:value>instance_c@localhost:1234</s:value>
>> </s:set>
>> </s:property>
>> </replicationConfiguration>
>> </configuration>
>> </replicationInterceptor>
>>
>>
>>
>> However, it does not indicate where this code should go (or am I blind?).
>> This looks like normal XML, but I do not find any XML files in the ApacheDS 2.0 folders/directories  (or again, am I blind?).
>>
>> Any insight would be appreciated.
>>
>> Kindest regards/thanks,
>> Steve
>>
>>
>> ________________________________
>> From: Kiran Ayyagari <ka...@apache.org>
>> To: Steve Hayden <hs...@yahoo.com>
>> Sent: Thursday, September 29, 2011 10:33 AM
>> Subject: Re: ApacheDS "Tools" "dump" question
>>
>> replication in 1.5.7 is broken, version 2.0-M2 has support for
>> replication(it is an implementation of RFC4533 (a.k.a syncrepl ) )
>> If upgrading to 2.0-M2 is not an option then I would suggest you to
>> write a program to take the dump of the directory data(in LDIF)
>> Implementing this using ApacheDirectory project's client-api [1] is
>> quite easy, let me know if you have any questions.
>>
>> [1] http://directory.apache.org/api/java-api.html
>> On Thu, Sep 29, 2011 at 10:17 AM, Steve Hayden <hs...@yahoo.com> wrote:
>>> Greetings,
>>> Thanks for your prompt reply and information.
>>> Unfortunately using the Studio export/import is not an option in my
>>> application. What I am actually trying to do is to create a failover
>>> mechanism for when a "master" directory fails and must switch to another
>>> LDAP server (perhaps a sloave) that contains the same (or most of) the data
>>> contained in the master.  In the ApacheDS source code, there is some
>>> "replication" code, but it does not seem to do much/anything.
>>>
>>> Do you have any advice on how to implement failover/redundancy?
>>> Thanks in advance.
>>> Steve
>>> ________________________________
>>> From: Kiran Ayyagari <ka...@apache.org>
>>> To: users@directory.apache.org; Steve Hayden <hs...@yahoo.com>
>>> Sent: Wednesday, September 28, 2011 5:58 PM
>>> Subject: Re: ApacheDS "Tools" "dump" question
>>>
>>> the tools project is quite old(broken) and not maintained at the moment
>>> if you want to take a dump would suggest to use Studio's export feature
>>>
>>> HTH
>>> On Wed, Sep 28, 2011 at 4:11 PM, Steve Hayden <hs...@yahoo.com> wrote:
>>>> Greetings,
>>>>
>>>> I am attempting to use the "dump" utility contained in the
>>>> "apacheds-tools.jar"and am having some
>>>> difficulties. I am attempting this on a Windows 7 environment (and will
>>>> also need to do it on Linux).
>>>> I have tried this with the 1.5.5 and 1.5.7 versions of ApacheDS, and
>>>> "dump" does not seems to work on
>>>> either.  I have the "apacheds-tools.jar" in the folder:
>>>>
>>>> "C:\Software_Downloads\ApacheDS\apacheds_1.5.7\bin"
>>>>
>>>> and am using using the command:
>>>>
>>>> java -jar apacheds-tools.jar dump -p system -i C:\app\data\ldap
>>>>
>>>>
>>>> (the "schema" and "system" files that ApacheDS creates are in that "ldap"
>>>> folder). Executing the command
>>>> above results in the following exception:
>>>>
>>>> ***************** Begin of output/exceptions *************
>>>>        _                     _          ____  ____    _____           _
>>>>       / \   _ __   __ _  ___| |__   ___|  _ \/ ___|  |_   _|__   ___ |
>>>> |___
>>>>      / _ \ | '_ \ / _` |/ __| '_ \ / _ \ | | \___ \    | |/ _ \ / _ \| /
>>>> __|
>>>>     / ___ \| |_) | (_| | (__| | | |  __/ |_| |___) |   | | (_) | (_) | \__
>>>> \
>>>>    /_/   \_\ .__/ \__,_|\___|_| |_|\___|____/|____/    |_|\___/
>>>> \___/|_|___/
>>>>            |_|
>>>>
>>>> Exception in thread "main" java.lang.IllegalStateException:
>>>> C:\ofm\data\ldap\bin does not exist!
>>>>         at
>>>> org.apache.directory.daemon.InstallationLayout.verifyInstallation(InstallationLayout.java:294)
>>>>         at
>>>> org.apache.directory.server.tools.DumpCommand.execute(DumpCommand.java:156)
>>>>         at
>>>> org.apache.directory.server.tools.ApachedsTools.main(ApachedsTools.java:112)
>>>>
>>>> ******************* End of output/exceptions *************
>>>>
>>>> As there does not appear to be a "bin" folder created by the ApacheDS
>>>> startup (or upon creation of a
>>>> new LDAP), it seems that the tool (given the ouput above) is expecting
>>>> that folder to exist.
>>>>
>>>> Is there something I'm doing wrong?
>>>>
>>>> Any insight/clue would be appreciated.
>>>>
>>>> Kindest regards/thanks,
>>>> Steve
>>>>
>>>
>>>
>>>
>>> --
>>> Kiran Ayyagari
>>>
>>>
>>>
>>
>>
>>
>> --
>> Kiran Ayyagari
>>
>
>
>
> --
> Kiran Ayyagari
>
>



-- 
Kiran Ayyagari

Re: ApacheDS "Tools" "dump" question

Posted by Steve Hayden <hs...@yahoo.com>.
Greetings,
Thanks for prompt response and information.

As far as the steps below,

1) is the first step performed on the "master", and the second performed on the (for lack of better term) "slave"?
2) if the answer to the first question is "yes", then I presume that in the second step, as it indicates "localhost", that both servers are running on the same machine in this case?
3) as both steps below include LDIF, I presume I could "import" the associated LDIF's using the import function in Apache Directory Studio (once modified to the specifics of my environment)?
4) for the parameter/value "ads-replRefreshInterval: 60000", what is the time increment (does "60000" equal 60 (e.g. "refresh every 60 seconds)?
5) for the parameter/value "ads-searchBaseDN: ou=system", does that mean "only update/replicate data/updates in the "ou=system" part of the DIT? (and if so, how does one replicate both "ou=system" and "ou=schema" for example)


Thanks in advance for your invaluable information.

Kindest regards,
Steve

----- Original Message -----
From: Kiran Ayyagari <ka...@apache.org>
To: Steve Hayden <hs...@yahoo.com>; users@directory.apache.org
Cc: 
Sent: Tuesday, October 4, 2011 12:05 PM
Subject: Re: ApacheDS "Tools" "dump" question

Hi Steve,

    The configuration for version 2.0 is stored in an LDIF file. This
configuration is also exposed as a partition named ou=config

    1. To make a server respond to replication requests add the
attribute ads-replReqHandler with the value
        org.apache.directory.server.ldap.replication.provider.SyncReplRequestHandler

    (you can also directly execute the below LDIF directly )

dn: ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
changetype: modify
add: ads-replReqHandler
ads-replReqHandler:
org.apache.directory.server.ldap.replication.provider.SyncReplRequestHandler


    2. To replicate with another server add an entry with the
objectclass 'ads-replConsumer' under
ou=replConsumers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config

  an example would be

dn: ads-replConsumerId=1,ou=replConsumers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
objectClass: ads-base
objectClass: ads-replConsumer
objectClass: top
ads-replAliasDerefMode: never
ads-replAttributes: *
ads-replConsumerId: 1
ads-replProvHostName: localhost
ads-replProvPort: 1090
ads-replRefreshInterval: 60000
ads-replRefreshNPersist: true
ads-replSearchFilter: (objectClass=*)
ads-replSearchScope: sub
ads-replSearchSizeLimit: 0
ads-replSearchTimeOut: 0
ads-replUserDn: uid=admin,ou=system
ads-replUserPassword:: c2VjcmV0
ads-searchBaseDN: ou=system


        finally the server needs to be restarted to make these changes effective

Let us know if you have any other questions

On Tue, Oct 4, 2011 at 11:31 AM, Steve Hayden <hs...@yahoo.com> wrote:
>
>
> Greetings,
>
> I am pursuing the option you suggested of going to ApacheDS 2.0, and in the documentation ("http://directory.apache.org/apacheds/1.5/mitosis-development-guide.html") it indicates the way to setup replication is as follows:
>
>
> Configuration
> The replication system is a Multi-Master replication, ie, each server can
> update any server it is connected to. The way you tell a server to replicate to
> others is simple :
> <replicationInterceptor>
> <configuration>
> <replicationConfiguration logMaxAge="5"
> replicaId="instance_a"
> replicationInterval="2"
> responseTimeout="10"
> serverPort="10390">
> <s:property name="peerReplicas">
> <s:set>
> <s:value>instance_b@localhost:1234</s:value>
> <s:value>instance_c@localhost:1234</s:value>
> </s:set>
> </s:property>
> </replicationConfiguration>
> </configuration>
> </replicationInterceptor>
>
>
>
> However, it does not indicate where this code should go (or am I blind?).
> This looks like normal XML, but I do not find any XML files in the ApacheDS 2.0 folders/directories  (or again, am I blind?).
>
> Any insight would be appreciated.
>
> Kindest regards/thanks,
> Steve
>
>
> ________________________________
> From: Kiran Ayyagari <ka...@apache.org>
> To: Steve Hayden <hs...@yahoo.com>
> Sent: Thursday, September 29, 2011 10:33 AM
> Subject: Re: ApacheDS "Tools" "dump" question
>
> replication in 1.5.7 is broken, version 2.0-M2 has support for
> replication(it is an implementation of RFC4533 (a.k.a syncrepl ) )
> If upgrading to 2.0-M2 is not an option then I would suggest you to
> write a program to take the dump of the directory data(in LDIF)
> Implementing this using ApacheDirectory project's client-api [1] is
> quite easy, let me know if you have any questions.
>
> [1] http://directory.apache.org/api/java-api.html
> On Thu, Sep 29, 2011 at 10:17 AM, Steve Hayden <hs...@yahoo.com> wrote:
>> Greetings,
>> Thanks for your prompt reply and information.
>> Unfortunately using the Studio export/import is not an option in my
>> application. What I am actually trying to do is to create a failover
>> mechanism for when a "master" directory fails and must switch to another
>> LDAP server (perhaps a sloave) that contains the same (or most of) the data
>> contained in the master.  In the ApacheDS source code, there is some
>> "replication" code, but it does not seem to do much/anything.
>>
>> Do you have any advice on how to implement failover/redundancy?
>> Thanks in advance.
>> Steve
>> ________________________________
>> From: Kiran Ayyagari <ka...@apache.org>
>> To: users@directory.apache.org; Steve Hayden <hs...@yahoo.com>
>> Sent: Wednesday, September 28, 2011 5:58 PM
>> Subject: Re: ApacheDS "Tools" "dump" question
>>
>> the tools project is quite old(broken) and not maintained at the moment
>> if you want to take a dump would suggest to use Studio's export feature
>>
>> HTH
>> On Wed, Sep 28, 2011 at 4:11 PM, Steve Hayden <hs...@yahoo.com> wrote:
>>> Greetings,
>>>
>>> I am attempting to use the "dump" utility contained in the
>>> "apacheds-tools.jar"and am having some
>>> difficulties. I am attempting this on a Windows 7 environment (and will
>>> also need to do it on Linux).
>>> I have tried this with the 1.5.5 and 1.5.7 versions of ApacheDS, and
>>> "dump" does not seems to work on
>>> either.  I have the "apacheds-tools.jar" in the folder:
>>>
>>> "C:\Software_Downloads\ApacheDS\apacheds_1.5.7\bin"
>>>
>>> and am using using the command:
>>>
>>> java -jar apacheds-tools.jar dump -p system -i C:\app\data\ldap
>>>
>>>
>>> (the "schema" and "system" files that ApacheDS creates are in that "ldap"
>>> folder). Executing the command
>>> above results in the following exception:
>>>
>>> ***************** Begin of output/exceptions *************
>>>        _                     _          ____  ____    _____           _
>>>       / \   _ __   __ _  ___| |__   ___|  _ \/ ___|  |_   _|__   ___ |
>>> |___
>>>      / _ \ | '_ \ / _` |/ __| '_ \ / _ \ | | \___ \    | |/ _ \ / _ \| /
>>> __|
>>>     / ___ \| |_) | (_| | (__| | | |  __/ |_| |___) |   | | (_) | (_) | \__
>>> \
>>>    /_/   \_\ .__/ \__,_|\___|_| |_|\___|____/|____/    |_|\___/
>>> \___/|_|___/
>>>            |_|
>>>
>>> Exception in thread "main" java.lang.IllegalStateException:
>>> C:\ofm\data\ldap\bin does not exist!
>>>         at
>>> org.apache.directory.daemon.InstallationLayout.verifyInstallation(InstallationLayout.java:294)
>>>         at
>>> org.apache.directory.server.tools.DumpCommand.execute(DumpCommand.java:156)
>>>         at
>>> org.apache.directory.server.tools.ApachedsTools.main(ApachedsTools.java:112)
>>>
>>> ******************* End of output/exceptions *************
>>>
>>> As there does not appear to be a "bin" folder created by the ApacheDS
>>> startup (or upon creation of a
>>> new LDAP), it seems that the tool (given the ouput above) is expecting
>>> that folder to exist.
>>>
>>> Is there something I'm doing wrong?
>>>
>>> Any insight/clue would be appreciated.
>>>
>>> Kindest regards/thanks,
>>> Steve
>>>
>>
>>
>>
>> --
>> Kiran Ayyagari
>>
>>
>>
>
>
>
> --
> Kiran Ayyagari
>



-- 
Kiran Ayyagari


Re: ApacheDS "Tools" "dump" question

Posted by Kiran Ayyagari <ka...@apache.org>.
Hi Steve,

    The configuration for version 2.0 is stored in an LDIF file. This
configuration is also exposed as a partition named ou=config

    1. To make a server respond to replication requests add the
attribute ads-replReqHandler with the value
        org.apache.directory.server.ldap.replication.provider.SyncReplRequestHandler

    (you can also directly execute the below LDIF directly )

dn: ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
changetype: modify
add: ads-replReqHandler
ads-replReqHandler:
org.apache.directory.server.ldap.replication.provider.SyncReplRequestHandler


    2. To replicate with another server add an entry with the
objectclass 'ads-replConsumer' under
ou=replConsumers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config

  an example would be

dn: ads-replConsumerId=1,ou=replConsumers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
objectClass: ads-base
objectClass: ads-replConsumer
objectClass: top
ads-replAliasDerefMode: never
ads-replAttributes: *
ads-replConsumerId: 1
ads-replProvHostName: localhost
ads-replProvPort: 1090
ads-replRefreshInterval: 60000
ads-replRefreshNPersist: true
ads-replSearchFilter: (objectClass=*)
ads-replSearchScope: sub
ads-replSearchSizeLimit: 0
ads-replSearchTimeOut: 0
ads-replUserDn: uid=admin,ou=system
ads-replUserPassword:: c2VjcmV0
ads-searchBaseDN: ou=system


        finally the server needs to be restarted to make these changes effective

Let us know if you have any other questions

On Tue, Oct 4, 2011 at 11:31 AM, Steve Hayden <hs...@yahoo.com> wrote:
>
>
> Greetings,
>
> I am pursuing the option you suggested of going to ApacheDS 2.0, and in the documentation ("http://directory.apache.org/apacheds/1.5/mitosis-development-guide.html") it indicates the way to setup replication is as follows:
>
>
> Configuration
> The replication system is a Multi-Master replication, ie, each server can
> update any server it is connected to. The way you tell a server to replicate to
> others is simple :
> <replicationInterceptor>
> <configuration>
> <replicationConfiguration logMaxAge="5"
> replicaId="instance_a"
> replicationInterval="2"
> responseTimeout="10"
> serverPort="10390">
> <s:property name="peerReplicas">
> <s:set>
> <s:value>instance_b@localhost:1234</s:value>
> <s:value>instance_c@localhost:1234</s:value>
> </s:set>
> </s:property>
> </replicationConfiguration>
> </configuration>
> </replicationInterceptor>
>
>
>
> However, it does not indicate where this code should go (or am I blind?).
> This looks like normal XML, but I do not find any XML files in the ApacheDS 2.0 folders/directories  (or again, am I blind?).
>
> Any insight would be appreciated.
>
> Kindest regards/thanks,
> Steve
>
>
> ________________________________
> From: Kiran Ayyagari <ka...@apache.org>
> To: Steve Hayden <hs...@yahoo.com>
> Sent: Thursday, September 29, 2011 10:33 AM
> Subject: Re: ApacheDS "Tools" "dump" question
>
> replication in 1.5.7 is broken, version 2.0-M2 has support for
> replication(it is an implementation of RFC4533 (a.k.a syncrepl ) )
> If upgrading to 2.0-M2 is not an option then I would suggest you to
> write a program to take the dump of the directory data(in LDIF)
> Implementing this using ApacheDirectory project's client-api [1] is
> quite easy, let me know if you have any questions.
>
> [1] http://directory.apache.org/api/java-api.html
> On Thu, Sep 29, 2011 at 10:17 AM, Steve Hayden <hs...@yahoo.com> wrote:
>> Greetings,
>> Thanks for your prompt reply and information.
>> Unfortunately using the Studio export/import is not an option in my
>> application. What I am actually trying to do is to create a failover
>> mechanism for when a "master" directory fails and must switch to another
>> LDAP server (perhaps a sloave) that contains the same (or most of) the data
>> contained in the master.  In the ApacheDS source code, there is some
>> "replication" code, but it does not seem to do much/anything.
>>
>> Do you have any advice on how to implement failover/redundancy?
>> Thanks in advance.
>> Steve
>> ________________________________
>> From: Kiran Ayyagari <ka...@apache.org>
>> To: users@directory.apache.org; Steve Hayden <hs...@yahoo.com>
>> Sent: Wednesday, September 28, 2011 5:58 PM
>> Subject: Re: ApacheDS "Tools" "dump" question
>>
>> the tools project is quite old(broken) and not maintained at the moment
>> if you want to take a dump would suggest to use Studio's export feature
>>
>> HTH
>> On Wed, Sep 28, 2011 at 4:11 PM, Steve Hayden <hs...@yahoo.com> wrote:
>>> Greetings,
>>>
>>> I am attempting to use the "dump" utility contained in the
>>> "apacheds-tools.jar"and am having some
>>> difficulties. I am attempting this on a Windows 7 environment (and will
>>> also need to do it on Linux).
>>> I have tried this with the 1.5.5 and 1.5.7 versions of ApacheDS, and
>>> "dump" does not seems to work on
>>> either.  I have the "apacheds-tools.jar" in the folder:
>>>
>>> "C:\Software_Downloads\ApacheDS\apacheds_1.5.7\bin"
>>>
>>> and am using using the command:
>>>
>>> java -jar apacheds-tools.jar dump -p system -i C:\app\data\ldap
>>>
>>>
>>> (the "schema" and "system" files that ApacheDS creates are in that "ldap"
>>> folder). Executing the command
>>> above results in the following exception:
>>>
>>> ***************** Begin of output/exceptions *************
>>>        _                     _          ____  ____    _____           _
>>>       / \   _ __   __ _  ___| |__   ___|  _ \/ ___|  |_   _|__   ___ |
>>> |___
>>>      / _ \ | '_ \ / _` |/ __| '_ \ / _ \ | | \___ \    | |/ _ \ / _ \| /
>>> __|
>>>     / ___ \| |_) | (_| | (__| | | |  __/ |_| |___) |   | | (_) | (_) | \__
>>> \
>>>    /_/   \_\ .__/ \__,_|\___|_| |_|\___|____/|____/    |_|\___/
>>> \___/|_|___/
>>>            |_|
>>>
>>> Exception in thread "main" java.lang.IllegalStateException:
>>> C:\ofm\data\ldap\bin does not exist!
>>>         at
>>> org.apache.directory.daemon.InstallationLayout.verifyInstallation(InstallationLayout.java:294)
>>>         at
>>> org.apache.directory.server.tools.DumpCommand.execute(DumpCommand.java:156)
>>>         at
>>> org.apache.directory.server.tools.ApachedsTools.main(ApachedsTools.java:112)
>>>
>>> ******************* End of output/exceptions *************
>>>
>>> As there does not appear to be a "bin" folder created by the ApacheDS
>>> startup (or upon creation of a
>>> new LDAP), it seems that the tool (given the ouput above) is expecting
>>> that folder to exist.
>>>
>>> Is there something I'm doing wrong?
>>>
>>> Any insight/clue would be appreciated.
>>>
>>> Kindest regards/thanks,
>>> Steve
>>>
>>
>>
>>
>> --
>> Kiran Ayyagari
>>
>>
>>
>
>
>
> --
> Kiran Ayyagari
>



-- 
Kiran Ayyagari