第 19 章 使用健康检查功能来识别问题

dsctl healthcheck 命令分析目录服务器实例,以了解潜在的问题,并推荐解决方案来解决它们。
下表显示了检查健康检查功能执行:

表 19.1. 检查概述

组件 重要性 结果代码 描述
后端 DSBLE0003 数据库没有初始化。创建数据库,但数据库为空。
后端 Medium DSBLE0001 配置中缺少后端的映射树条目。
config DSCLE0001 禁用高分辨率时间戳。
config DSVIRTLE0001 虚拟属性被错误地索引。角色或服务(CoS)定义使用的索引属性可能会破坏搜索结果。
操作系统 Medium DSPERMLE0001 /etc/resolve.conf 文件中设置的权限与 0644 不同。
操作系统 DSDSLE0001 磁盘空间较低
操作系统 DSPERMLE0002 /etc/dirsrv/slapd-instance_name/pin.txt/etc/dirsrv/slapd-instance_name/pwdfile.txt 文件设置的权限与 0400 不同。
插件 DSRILE0001 参考完整性 插件设置了更新延迟。这可能导致复制问题。
插件 DSRILE0002 参考完整性 插件丢失索引。如果没有索引,插件会为每个删除操作查询某些属性。这可能导致硬检测的未索引搜索和高 CPU 用量。
复制 DSREPLLE0002 数据库中存在冲突条目。
复制 DSSKEWLE0001 复制时间偏移时间大于 6 小时,小于 12 小时。
复制 Medium DSCLLE0001 changelog 修剪被禁用。在这种情况下,changelog 会在没有限制的情况下增长。
复制 Medium DSREPLLE0004 健康检查无法检索复制状态。
复制 Medium DSREPLLE0003 拓扑不同步,但复制工作正常。
复制 Medium DSREPLLE0005 无法访问远程副本。
复制 Medium DSSKEWLE0002 复制时间偏移时间大于 12 小时,小于 24 小时。
复制 DSREPLLE0001 拓扑不同步,复制无法正常工作。
复制 DSSKEWLE0003 复制时间偏移时间大于 24 小时。复制会话可能会破坏。
安全性 Medium DSELE0001 最小 TLS 版本设置为小于 TLS 1.2 的值。
安全性 DSCLE0002 配置了弱密码存储方案。
Server DSBLE0002 健康检查无法查询后端。
TLS 证书 Medium DSCERTLE0001 服务器证书在下一个 30 天内过期。
TLS 证书 DSCERTLE0002 服务器证书已过期。

19.1. 运行目录服务器健康检查

要运行健康检查,请输入:
# dsctl instance_name healthcheck
Beginning lint report, this could take a while ...
Checking Backends ...
Checking Config ...
Checking Encryption ...
Checking FSChecks ...
Checking ReferentialIntegrityPlugin ...
Checking MonitorDiskSpace ...
Checking Replica ...
Checking Changelog5 ...
Checking NssSsl ...
Healthcheck complete.
1 Issue found!  Generating report ...

例 19.1. 健康检查可能的报告

以下显示了一个健康检查报告示例:
[1] DS Lint Error: DSELE0001
--------------------------------------------------------------------------------
Severity: MEDIUM 
Affects:
 -- cn=encryption,cn=config

Details:
-----------
This Directory Server may not be using strong TLS protocol versions. TLS1.0 is known to
have a number of issues with the protocol. Please see:

https://tools.ietf.org/html/rfc7457

It is advised you set this value to the maximum possible.

Resolution:
-----------
There are two options for setting the TLS minimum version allowed.  You,
can set "sslVersionMin" in "cn=encryption,cn=config" to a version greater than "TLS1.0"
You can also use 'dsconf' to set this value.  Here is an example:

    # dsconf slapd-instance_name security set --tls-protocol-min=TLS1.2

You must restart the Directory Server for this change to take effect.

Or, you can set the system wide crypto policy to FUTURE which will use a higher TLS
minimum version, but doing this affects the entire system:

    # update-crypto-policies --set FUTURE


===== End Of Report (1 Issue found) =====
要以 JSON 格式显示输出,请将 --json 参数传递给命令:
# dsctl --json instance_name healthcheck

例 19.2. JSON 格式可能的健康检查报告

以下显示了一个 JSON 格式显示健康检查报告示例:
[
    {
        "dsle": "DSELE0001",
        "severity": "MEDIUM",
        "items": [
            "cn=encryption,cn=config"
        ],
        "detail": "This Directory Server may not be using strong TLS protocol versions. TLS1.0 is known to\nhave a number of issues with the protocol. Please see:\n\nhttps://tools.ietf.org/html/rfc7457\n\nIt is advised you set this value to the maximum possible.",
        "fix": "There are two options for setting the TLS minimum version allowed.  You,\ncan set \"sslVersionMin\" in \"cn=encryption,cn=config\" to a version greater than \"TLS1.0\"\nYou can also use 'dsconf' to set this value.  Here is an example:\n\n    # dsconf slapd-instance_name security set --tls-protocol-min=TLS1.2\n\nYou must restart the Directory Server for this change to take effect.\n\nOr, you can set the system wide crypto policy to FUTURE which will use a higher TLS\nminimum version, but doing this affects the entire system:\n\n    # update-crypto-policies --set FUTURE"
    }
]