LDAP 架构和 LDIF 之间有什么区别?

What is the difference between LDAP schema and LDIF?

设置 LDAP 服务器 我必须导入几个模式,例如 eduPersonThere is an LDIF file issued by the developers, that says:

# This LDIF file can be used to add to add the eduPerson schema to 
# an OpenLDAP server > 2.4 that uses the new configuration format. 
# Put this file to /etc/ldap/schema/ and then execute the following 
# comand to add this schema:
# ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/eduperson.ldif

另一方面,我听说 LDAP 管理员通过将模式包含到 LDAP 配置(例如 /etc/openldap/slapd.conf)并重新启动 LDAP 恶魔来导入模式。

因此,根据我的研究,在我看来,包含架构是正确的方法,而 LDIF 更适合用于导入数据,而不是架构本身。那是对的吗?两者之间有什么区别,我应该在什么时候使用它们?

LDIF 是表示 LDAP 操作或数据的标准文本格式。 大多数目录服务器使用 LDIF 来保存它们的一些配置,尤其是 Schema,但 LDIF 可以用于其他目的,例如添加、导入、导出、修改数据。

来自不同标准和产品的大多数模式定义都分布在 LDIF 文件中。如何将这些文件加载​​到服务器未在 LDAP 规范中定义,因此由服务器定义。

您的问题似乎是针对 OpenLDAP 的,答案可能因 OpenLDAP 的版本而异。