如何在 rts openldap 服务器中创建两个 dit

如何在 rts openldap 服务器中创建两个 dit

我已经创建了一个像这样的基础数据库 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

为了创建另一个数据库,我尝试了这个,创建了一个 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

当我将这个新数据库作为单独的 DIT 添加时,出现了这个错误。

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

如何解决这个问题?当我将 olcDatabase={2}hdb 更改为“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

答案1

slapd不会抱怨您的 olcsuffix。它只是对您选择的 DN 感到不满。

您将需要修改 .ldif 以使用dn: olcDatabase={2}hdb,cn=config


此外,您不能添加或修改任何操作属性。(structuralObjectClasscreatorsName是两个这样的属性。)

相关内容