You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

CentOS7环境下ApacheDS LDAP无法启动问题求助

ApacheDS LDAP 启动故障排查指南

故障背景

  • 已长期稳定运行的ApacheDS LDAP服务突发无法启动
  • 查阅现有运行日志,未匹配到相似场景的参考解决方案

关键日志输出

[17:08:44] WARN [org.apache.directory.api.ldap.model.entry.DefaultAttribute] - ERR_13207_VALUE_ALREADY_EXISTS The value '1.3.6.1.4.1.42.2.27.8.5.1' already exists in the attribute (supportedControl)
[17:08:44] WARN [org.apache.directory.api.ldap.model.entry.DefaultAttribute] - ERR_13207_VALUE_ALREADY_EXISTS The value '1.2.840.113556.1.4.841' already exists in the attribute (supportedControl)
[17:08:44] WARN [org.apache.directory.api.ldap.model.entry.DefaultAttribute] - ERR_13207_VALUE_ALREADY_EXISTS The value '1.3.6.1.4.1.4203.1.9.1.2' already exists in the attribute (supportedControl)
[17:08:44] WARN [org.apache.directory.api.ldap.model.entry.DefaultAttribute] - ERR_13207_VALUE_ALREADY_EXISTS The value '1.2.840.113556.1.4.319' already exists in the attribute (supportedControl)
[17:08:44] WARN [org.apache.directory.api.ldap.model.entry.DefaultAttribute] - ERR_13207_VALUE_ALREADY_EXISTS The value '1.2.840.113556.1.4.528' already exists in the attribute (supportedControl)
[17:08:44] ERROR [org.apache.directory.server.wrapper.ApacheDsTanukiWrapper] - Failed to start the service.
org.apache.directory.api.ldap.model.exception.LdapOtherException: maximum size must not be negative
	at org.apache.directory.server.core.api.partition.AbstractPartition.initialize(AbstractPartition.java:91)
	at org.apache.directory.server.core.DefaultDirectoryService.initialize(DefaultDirectoryService.java:1986)
	at org.apache.directory.server.core.DefaultDirectoryService.startup(DefaultDirectoryService.java:1244)
	at org.apache.directory.server.ApacheDsService.initDirectoryService(ApacheDsService.java:390)
	at org.apache.directory.server.ApacheDsService.start(ApacheDsService.java:205)
	at org.apache.directory.server.ApacheDsService.start(ApacheDsService.java:152)
	at org.apache.directory.server.wrapper.ApacheDsTanukiWrapper.start(ApacheDsTanukiWrapper.java:175)
	at org.tanukisoftware.wrapper.WrapperManager$12.run(WrapperManager.java:2788)
Caused by: org.apache.directory.api.ldap.model.exception.LdapOtherException: maximum size must not be negative
	at org.apache.directory.server.core.api.partition.AbstractPartition.initialize(AbstractPartition.java:91)
	at org.apache.directory.server.core.shared.partition.DefaultPartitionNexus.addContextPartition(DefaultPartitionNexus.java:834)
	at org.apache.directory.server.core.shared.partition.DefaultPartitionNexus.doInit(DefaultPartitionNexus.java:242)
	at org.apache.directory.server.core.api.partition.AbstractPartition.initialize(AbstractPartition.java:86)
	... 7 more
Caused by: java.lang.IllegalArgumentException: maximum size must not be negative
	at com.github.benmanes.caffeine.cache.Caffeine.requireArgument(Caffeine.java:173)
	at com.github.benmanes.caffeine.cache.Caffeine.maximumSize(Caffeine.java:316)
	at org.apache.directory.server.core.partition.impl.btree.AbstractBTreePartition.doInit(AbstractBTreePartition.java:632)
	at org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition.doInit(JdbmPartition.java:511)
	at org.apache.directory.server.core.api.partition.AbstractPartition.initialize(AbstractPartition.java:86)

问题定位

  • 日志中supportedControl属性重复的WARN级提示属于非致命性的常规冗余告警,是系统内置元数据加载时的重复值校验提示,和最终启动失败无直接因果关系。
  • 真正触发启动中断的报错链路为:JDBM类型分区初始化阶段,调用Caffeine缓存组件设置最大容量参数时,传入了负值,触发maximum size must not be negative参数校验异常中断流程。
  • 这类异常的常见触发原因:
    • 磁盘空间占满,导致配置文件读取时出现截断、数值损坏
    • 此前服务异常强退,造成分区对应的缓存配置文件写坏,原本存储的缓存容量数值被改写为负数
    • 运维操作时误修改了分区的缓存容量配置项,写入了非法的负值参数

修复操作步骤

  • 首先检查ApacheDS数据目录所在磁盘的剩余可用空间,确保预留空间不低于存储目录总大小的20%,排除磁盘满导致的文件读写异常。
  • 定位全部分区的配置文件,路径通常为ApacheDS安装目录/partitions/<对应分区名>/ou=config.ldif,逐一检查文件中javaCacheSize、cacheSize这类缓存容量相关的配置项,确认是否存在负值、乱码等非法值;如果配置值异常,将其修正为正整数(常规场景设置为10000即可满足使用需求)。
  • 如果没有定位到可识别的配置异常,可在备份分区全量数据后,临时移除损坏的缓存元数据文件,重启服务;服务启动后会自动生成默认的缓存配置,不会影响已存储的LDAP条目数据。
  • 重启后校验运行日志,确认不存在maximum size must not be negative的错误堆栈,同时执行基础LDAP查询验证服务可用性。

内容的提问来源于stack exchange,提问作者Tom

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.24 03:36:02