conf 和腳本中的主機 ID 必須匹配

conf 和腳本中的主機 ID 必須匹配

首先,我不是 OpenLDAP 專家。

slapd在一台已經運行多年的伺服器上運行了 openldap ( )。今天,我運行了它yum update,它更新了很多軟體包,包括 openldap 軟體包。一旦完成(沒有錯誤),我們的 LDAP 伺服器就不再運作。我嘗試了一個簡單的service slapd start(和/etc/init.d/slapd start),但兩者都突然失敗了。

如果我查看該/var/log/ldap.log文件,我會看到以下條目:

@(#) $OpenLDAP: slapd 2.4.40 (May 10 2016 23:30:49) $#012#[email protected]:/builddir/build/BUILD/openldap-2.4.40/openldap-2.4.40/build-servers/servers/slapd
read_config: no serverID / URL match found. Check slapd -h arguments.
slapd stopped.
connections_destroy: nothing to destroy.

slaptest和都slaptest -u成功了:

# slaptest
config file testing succeeded
# slaptest -u
config file testing succeeded

以下是 openldap 版本:

openldap-clients-2.4.40-12.el6.x86_64
openldap-servers-2.4.40-12.el6.x86_64
openldap-devel-2.4.40-12.el6.x86_64
compat-openldap-2.3.43-2.el6.x86_64
openldap-2.4.40-12.el6.x86_64

這也是我slapd.conf在 yum 更新之前工作的檔案:

include         /etc/openldap/schema/core.schema
include         /etc/openldap/schema/cosine.schema
include         /etc/openldap/schema/inetorgperson.schema
include         /etc/openldap/schema/nis.schema
include         /etc/openldap/schema/misc.schema
include         /etc/openldap/schema/passwordSelfReset.schema

allow bind_v2

pidfile     /var/run/openldap/slapd.pid
argsfile    /var/run/openldap/slapd.args

modulepath /usr/lib64/openldap

moduleload syncprov.la
moduleload unique.la

database monitor
access to *
        by dn.exact="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" read
        by dn.exact="cn=admin,dc=am5up,dc=com" read
        by * none

database    bdb
suffix      "dc=am5up,dc=com"
rootdn      "cn=admin,dc=am5up,dc=com"
rootpw {SSHA}0yFFC0BTYdZLDRNtSHVz1I6YC4zJ3Z0AZ09123
directory   /var/lib/ldap

index objectClass                       eq,pres
index ou,cn,mail,surname,givenname      eq,pres,sub
index uidNumber,gidNumber               eq,pres
index uid,memberUid                     eq,pres,sub
index nisMapName,nisMapEntry            eq,pres,sub

overlay unique
unique_attributes mail

ServerID        1 "ldap://ldap.am5up.com"

overlay         syncprov
syncprov-checkpoint     10 1
syncprov-sessionlog     100

有人可以提供任何建議嗎?

非常感激!

答案1

conf 和腳本中的主機 ID 必須匹配

對於遇到此問題的其他人:我已經解決了問題。在升級過程中,稍新的版本要求主機比對設定檔中的伺服器定義。

例如,在您的slapd.conf文件中有這樣一行:

ServerID 1 "ldap://myldapserver"

然後你的啟動腳本(或當你啟動 slapd 時)你必須將主機定義為「ldap://myldapserver」。

這似乎是有道理的;但是,透過今天的麻煩,我了解到/etc/init.d/slapd在初始安裝期間添加的預設檔案將主機列為空白。因此,預設啟動腳本基本上執行:

slapd -h "" -u <user> -g <group>

一旦我編輯了啟動腳本以確保-h開關slapd與我的配置文件中的內容匹配,一切就重新開始工作。

相關內容