配置LDAP时出现Berkeley DB不匹配错误 [英] Berkeley DB mismatch error while configuring LDAP
问题描述
我正在配置OPENLDAP 2.4.35.在Redhat Linux上,我已经作为前提条件安装了Berkley DB 4.8.30.我还检查了OPENLDAP的README文件的版本兼容性,该文件为:
I'm configuring OPENLDAP 2.4.35. on Redhat Linux, I have already installed Berkley DB 4.8.30 as a prerequisite. I also checked the version compatibility from OPENLDAP's README file, which says:
SLAPD:
BDB and HDB backends require Oracle Berkeley DB 4.4 - 4.8,
or 5.0 - 5.1. It is highly recommended to apply the
patches from Oracle for a given release.
仍然出现此错误:
checking db.h usability... yes
checking db.h presence... yes
checking for db.h... yes
checking for Berkeley DB major version in db.h... 4
checking for Berkeley DB minor version in db.h... 8
checking if Berkeley DB version supported by BDB/HDB backends... yes
checking for Berkeley DB link (-ldb-4.8)... yes
*checking for Berkeley DB library and header version match... no
configure: error: Berkeley DB version mismatch*
请帮助
推荐答案
现在配置正常.我必须正确导出Berkeley DB的库路径:
Now the configuration is working fine. I had to export the library path for Berkeley DB properly:
export LD_LIBRARY_PATH="/root/db-6.0.20/build_unix/.libs"
目录build_unix/.libs
包含OpenLDAP必需的库,还包含在Berkeley安装过程中产生的许多其他文件.我宁愿建议使用在安装过程中创建的目标Berkeley lib目录(该目录应等于PREFIX/lib),因为您有一天会删除/更新Berkeley源目录,从而破坏OpenLDAP运行时(请参见编辑的结尾). )
The directory build_unix/.libs
contains the necessary libs for OpenLDAP but also lots of other files produced during the Berkeley installation. I rather suggest to use the destination Berkeley lib directory which is created during the installation (it should be equal to PREFIX/lib), because you would remove/update your Berkeley source directory one day, breaking OpenLDAP runtime (see the end of my edit)
您可以通过以下方式导出LD_LIBRARY_PATH变量,或仅在OpenLDAP的配置时进行设置:
You can either export the LD_LIBRARY_PATH variable, or set it only at the configure time of OpenLDAP, this way :
LD_LIBRARY_PATH="/root/db-6.0.20.installed/lib" ./configure
通常会有其他配置选项,我在这里省略了.
Usually there would be other configuration options, I am omitting them here.
一旦正确安装,OpenLDAP仍可能无法启动,并在日志中显示以下错误消息:
Once installed correctly, OpenLDAP may still fail to start with the following error message in the log :
5d34473d bdb_back_initialize: BDB library version mismatch: expected Berkeley DB 5.3.28: (September 9, 2013), got Berkeley DB 5.3.21: (May 11, 2012)
要解决此问题,解决方案是再次在启动脚本中强制使用LD_LIBRARY_PATH变量(例如,无论您身在何处,例如/etc/init.d/openldap).当我们谈论运行时时,在这里重要的是要注意我们不应该调用被认为是临时的build_unix/.libs
目录,而应该调用已创建的/lib
目录.
To solve this issue, the solution is again to force the LD_LIBRARY_PATH variable, this time in the startup script (wherever is yours, /etc/init.d/openldap for example). As we are talking about the runtime, it's important here to note we shouldn't call the build_unix/.libs
directory which is considered temporary, but the created /lib
directory.
这篇关于配置LDAP时出现Berkeley DB不匹配错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!