OpenLDAP给出重复的attributeType错误

我正在设置一个login节点,并使用Ubuntu 14.04上的存储库中的openLDAP,并且遇到了重复的attributeTypes问题。

问题似乎在于“gecos”字段属性。 当我尝试运行slapcat或slapadd或slapindex时,我得到这个输出:

$ slapcat 53ecd288 olcAttributeTypes: value #0 olcAttributeTypes: Duplicate attributeType: "1.3.6.1.1.1.1.2" 53ecd288 config error processing cn={3}nis,cn=schema,cn=config: olcAttributeTypes: Duplicate attributeType: "1.3.6.1.1.1.1.2" slapcat: bad configuration file! 

而当我grep为1.3.6.1.1.1.1.2我得到

 $ cd /etc/ldap/ && grep -r '1.3.6.1.1.1.1.2' * schema/nis.schema:attributetype ( 1.3.6.1.1.1.1.2 NAME 'gecos' schema/nis.ldif:olcAttributeTypes: ( 1.3.6.1.1.1.1.2 NAME 'gecos' DESC 'The GECOS field; th slapd.d/cn=config/cn=schema/cn={3}nis.ldif:olcAttributeTypes: {0}( 1.3.6.1.1.1.1.2 NAME 'gecos' DESC 'The GECOS field; th slapd.d/cn=config/cn=schema/cn={2}nis.ldif:olcAttributeTypes: {0}( 1.3.6.1.1.1.1.2 NAME 'gecos' DESC 'The GECOS field; th 

不用说,slapd无法启动。

我不知道该怎么去解决这个问题。 在search这个问题时,我发现在尝试使用来自其他旧服务器的core.schema文件时,人们遇到了类似的问题。 我没有使用来自不同服务器的任何文件,也没有编辑core.schema或任何其他核心文件,除了ldap.conf和slapd.conf。

有没有人有这个问题的见解? 我能做些什么来解决它?

一旦在cn=config,cn=schema,cn={3}nis ,看起来好像问题在于您已经使用OID 1.3.6.1.1.1.1.2定义了两个“不同的”属性cn=config,cn=schema,cn={3}nis ,一次在cn=config,cn=schema,cn={2}nis 。 OID引用属性必须是唯一的。

在这里,我不知道你在迁移过程中处于什么阶段,但是看起来你可能以某种方式两次导入了相同的模式。 如果您只是做了某种迁移,您可能需要再试一次,注意只迁移一次模式。

如果刚刚将一堆模式文件转换为LDIF以便导入到cn=config,cn=schema ,请检查cn=config/cn=schema文件夹中是否没有NIS(或任何其他模式组件)那里。 我认为你有文件cn={2}nis.ldifcn={3}nis.ldif ; 使用差异来查看它们是相同的(或者它们是如何不同的),如果需要的话合并它们,并且试着仅仅input其中一个(新鲜的)。