On 12/28/2011 02:18 PM, Graham Leggett wrote:
Hi all,

I'm trying to add an index, and am currently epically failing at doing so.

The only documentation I can find is the obsolete

Why is it obsolete?

Redhat Directory Server guide at http://docs.redhat.com/docs/en-US/Red_Hat_Directory_Server/9.0/html/Administration_Guide/applying-indexes.html, linked to from the 389-ds documentation website.

The docs recommend I use the db2index.pl script, which doesn't work for me:

/usr/lib64/dirsrv/slapd-myinstance/db2index.pl -D "cn=Directory Manager" -w `cat /etc/ldap.secret` -n myinstance -t myattribute
adding new entry cn=db2index_2011_12_28_14_49_34, cn=index, cn=tasks, cn=config
ldap_add: No such object

A look at the error log reveals this error:

[28/Dec/2011:14:50:35 -0600] - can't import to nonexistent backend myinstance

I am completely stumped. If my backend isn't called "myinstance" then I have no idea what it's referring to. Given there is only one instance on the server, I have no idea why 389ds can't figure this out for itself. In fact, I can't understand why 389ds didn't just handle indexes all on its own anyway.

How should 389ds handle indexes all on its own?  Can you explain please?

The docs suggest doing this:

cd /etc/dirsrv/slapd-instance_name
db2index.pl-D "cn=Directory Manager" -w secret -n ExampleServer -t sn

No idea where "ExampleServer" comes from, and no idea why it's not the same as "instance_name".
Which doc is this?  URL please?
I also find a shell script called db2index, as well as the perl script called db2index.pl. Any idea why there are two scripts that in theory do the same thing?
db2index is for when the server is offline - db2index.pl is for when the server is online.
Is there an up to date recipe somewhere that explains how to add an index to 389ds?

/usr/lib64/dirsrv/slapd-myinstance/db2index.pl -D "cn=Directory Manager" -w `cat /etc/ldap.secret` -n userRoot -t myattribute

I'm assuming you know that you need to 
* replace "cn=directory manager" with your directory manager DN if you have changed it from the default
* replace `cat /etc/ldap.secret` with your real directory manager password if it is not stored in /etc/ldap.secret
* replace myattribute with your real attribute name
Regards,
Graham
--

-- 389 users mailing list 389-users@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/389-users