0

I have created a base database with like this olcDatabase={0}config.ldif

# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
    # CRC32 5ebe5cbf
    dn: olcDatabase={0}config
    objectClass: olcDatabaseConfig
    olcDatabase: {0}config
    olcAccess: {0}to * by dn.exact=gidNumber=0+uidNumber=0,cn=peercred,cn=external
     ,cn=auth manage by * break
    structuralObjectClass: olcDatabaseConfig
    entryUUID: bc33e700-aabc-1034-9ffd-0bb5002b311b
    creatorsName: cn=config
    createTimestamp: 20150619105025Z
    olcRootPW:: e1NTSEF9ekgzcEZnbVJIYkszRjR1YmZsazRadE5XR1JpZWVJN3Y=
    olcRootDN: cn=Manager,cn=config
    entryCSN: 20150622150014.466148Z#000000#000#000000
    modifiersName: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
    modifyTimestamp: 20150622150014Z

olcDatabase={1}hdb.ldif

# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
# CRC32 78ca14ea
dn: olcDatabase={1}hdb
objectClass: olcDatabaseConfig
objectClass: olcHdbConfig
olcDatabase: {1}hdb
olcDbDirectory: /var/lib/ldap
olcSuffix: dc=igr,dc=com
olcAccess: {0}to attrs=userPassword,shadowLastChange by self write by anonymou
 s auth by dn="cn=admin,dc=igr,dc=com" write by * none
olcAccess: {1}to dn.base="" by * read
olcAccess: {2}to * by self write by dn="cn=admin,dc=igr,dc=com" write by *
  read
olcLastMod: TRUE
olcRootDN: cn=admin,dc=igr,dc=com
olcRootPW:: e1NTSEF9bHdWcWlMeTVUM0RhUXU1ZzZabFkrV1ZwT09xWW04Zk4=
olcDbCheckpoint: 512 30
olcDbConfig: {0}set_cachesize 0 2097152 0
olcDbConfig: {1}set_lk_max_objects 1500
olcDbConfig: {2}set_lk_max_locks 1500
olcDbConfig: {3}set_lk_max_lockers 1500
olcDbIndex: objectClass eq
structuralObjectClass: olcHdbConfig
entryUUID: bc34c3be-aabc-1034-8005-0bb5002b311b
creatorsName: cn=config
createTimestamp: 20150619105025Z
entryCSN: 20150619105025.210222Z#000000#000#000000
modifiersName: cn=config
modifyTimestamp: 20150619105025Z

to create another database i tried this, created a fio.ldif

dn: olcDatabase={2}hdb
objectClass: olcDatabaseConfig
objectClass: olcHdbConfig
olcDatabase: {2}hdb
olcDbDirectory: /var/ldap/lld
olcDbIndex: objectClass eq,pres
olcDbIndex: ou,cn,mail,surname,givenname eq,pres,sub
structuralObjectClass: olcHdbConfig
creatorsName: cn=config
olcSuffix: dc=linux,dc=com
olcRootDN: cn=Man,dc=linux,dc=com

when i added this new database as a seprated DIT i got this error.

ashokkrishna@10:36:04:~/Desktop$ ldapadd -x -D "cn=Manager,cn=config" -f fio.ldif -W
Enter LDAP Password: 
adding new entry "olcDatabase={2}hdb"
ldap_add: Server is unwilling to perform (53)
    additional info: no global superior knowledge

how to solve this? when i changed the olcDatabase={2}hdb to "olcDatabase={2}hdb,cn=config"

ashokkrishna@10:07:38:~/Desktop$ ldapadd -x -D "cn=Manager,cn=config" -f filp.ldif -W
Enter LDAP Password: 
adding new entry "olcDatabase={2}hdb,cn=config"
ldap_add: Constraint violation (19)
    additional info: structuralObjectClass: no user modification allowed
ashok
  • 229
  • 2
  • 4
  • 10

1 Answers1

0

slapd isn't complaining about your olcsuffix. It's upset by your choosen dn.

You'll want to modify your .ldif to use dn: olcDatabase={2}hdb,cn=config.


Additionally, you cannot add or modify any operational attributes. (structuralObjectClass and creatorsName are two such attributes.)

84104
  • 12,905
  • 6
  • 45
  • 76
  • I got an error by changing above. – ashok Jun 26 '15 at 04:39
  • after removing the specified attributes it succesfully added the database. but i am unable to login to the database and my old database lost its contents. – ashok Jun 29 '15 at 05:07
  • i got the error This base cannot be created with PLA for igr.com – ashok Jun 29 '15 at 05:09
  • may be this is because olcDbDirectory: /var/lib/ldap same folder. – ashok Jun 29 '15 at 05:10
  • @ashok It is definitely that. You should not have two databases trying to store data in the same place. (Your question had two different locations.) – 84104 Jun 29 '15 at 17:55
  • no when i put that new database into new place its not working well. – ashok Jul 01 '15 at 17:14