12.10. 动态重新加载架构


默认情况下,Directory 服务器实例使用的 schema 文件会在目录启动时加载到目录中。这意味着,添加到 schema 目录的任何新架构文件都不可用,除非服务器重启。目录服务器有手动重新载入 Directory Server 实例的完整模式的任务,包括自定义文件,而无需重启服务器。
您可以使用以下方法之一重新载入模式:
注意
目录服务器额外重新载入存储在 /usr/share/dirsrv/schema/ 目录中的所有模式文件。
使用 dsconf 模式 reload 命令重新载入模式:
# dsconf -D "cn=Directory Manager" ldap://server.example.com schema reload
Attempting to add task entry... This will fail if Schema Reload plug-in is not enabled.
Successfully added task entry cn=schema_reload_2018-08-28T09:45:48.027962,cn=schema reload task,cn=tasks,cn=config
To verify that the schema reload operation was successful, please check the error logs
Copy to Clipboard Toggle word wrap
默认情况下,Directory 服务器重新加载存储在 nsslapd-schemadir 参数中设置的目录中的 schema 文件。(可选)将 -d 目录 选项传给命令,以重新加载存储在其他目录中的架构。

12.10.2. 使用 cn=tasks 条目动态重新加载 Schema

Directory Server 配置中的 cn=tasks,cn=config 条目是服务器用来管理任务的临时条目的容器条目。要启动模式重新加载操作,请在 cn=schema reload 任务,cn=tasks,cn=config 条目中创建一个任务。
默认情况下,Directory 服务器重新加载存储在 nsslapd-schemadir 参数中设置的目录中的 schema 文件。例如,要重新载入存储在这个参数中设置的目录中的 schema 文件:
# ldapadd -D "cn=Directory Manager" -W -p 389 -h server.example.com -x

dn: cn=example_schema_reload,cn=schema reload task,cn=tasks,cn=config
objectclass: extensibleObject
cn: cn=example_schema_reload
Copy to Clipboard Toggle word wrap
(可选)指定 schemadir 参数,以重新加载存储在不同目录中的 schema。例如:
# ldapadd -D "cn=Directory Manager" -W -p 389 -h server.example.com -x

dn: cn=example_schema_reload,cn=schema reload task,cn=tasks,cn=config
objectclass: extensibleObject
cn: cn=example_schema_reload
schemadir: /example/schema/
Copy to Clipboard Toggle word wrap
任务完成后,该条目会从目录配置中删除。
有关 cn=schema reload task ,cn=tasks,cn=config 条目的详情,请查看 Red Hat Directory Server 配置、命令和文件参考中的 cn=schema 重新加载任务部分

12.10.3. 在 Replication Topology 中重新加载架构

schema reload 任务是一个本地操作,因此如果模式被添加到一个供应商,则架构更改不会复制到多层次环境中。在所有供应商服务器上载入新的模式文件:
  1. 复制新的模式文件,并为每个供应商和副本服务器运行 schema 重新加载任务。请参阅:

12.10.4. 模式 Reload Errors

当 schema reload 任务运行时,服务器不会返回它是否已成功完成。要验证 schema reload 操作是否成功,请检查错误日志。模式重新加载有两个任务,首先验证 schema 文件,然后载入它。
成功消息显示已传递的验证和任务完成。
[06/Jan/2009:17:52:04.001214874 -0500] schemareload - Schema reload task starts (schema dir: default) ...
[06/Jan/2009:17:52:04.754335904 -0500] schemareload - Schema validation passed.
[06/Jan/2009:17:52:04.894255328 -0500] schemareload - Schema reload task finished.
Copy to Clipboard Toggle word wrap
如果有失败,日志会显示哪个步骤失败以及原因。
[..] schemareload - Schema reload task starts (schema dir: /bogus) ...
[..] schema - No schema files were found in the directory /bogus
[..] schema_reload - schema file validation failed
[..] schemareload - Schema validation failed.
Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat