0

我已经使用 slapd.conf 和 slurpd 配置了主/从。

问题是如果主服务器停止,我无法从从服务器更改客户端密码。

主服务器 -

[root@lr5dir01 ~]# service ldap stop
Stopping slapd:                                            [  OK  ]
Stopping slurpd:                                           [  OK  ]
[root@lr5dir01 ~]#

从服务器 -

[root@lr5dir02 ldap]# service ldap restart
Stopping slapd:                                            [  OK  ]
Checking configuration files for slapd:  config file testing succeeded
                                                           [  OK  ]
Starting slapd:                                            [  OK  ]
[root@lr5dir02 ldap]#

客户 -

[root@lr5dir02 ldap]# ssh ldaptest@10.40.109.94
ldaptest@10.40.109.94's password:
Last login: Tue Feb 19 21:14:27 2013 from lr5dir02.hk.intraxa
Could not chdir to home directory /home/ldaptest: No such file or directory
-bash-3.2$

-bash-3.2$ passwd
Changing password for user ldaptest.
Enter login(LDAP) password:
'New UNIX password:
Retype new UNIX password:
LDAP password information update failed: Referral

passwd: Permission denied
-bash-3.2$

主服务器 - slapd.conf

access to attrs=shadowLastChange,userPassword
      by self write
      by * auth

access to *
      by * read

replica host=10.40.101.231:389
        binddn="cn=Manager,dc=hk,dc=intraxa"
        credentials=secret
        bindmethod=simple
        tls=no

从服务器 slapd.conf - 仅与主服务器相同

updatedn "cn=Manager,dc=hk,dc=intraxa"
updateref ldap://10.40.101.230:389/

客户帕姆-

[root@lr6tst01 ~]# more /etc/pam.d/passwd
#%PAM-1.0
auth       include      system-auth
account    include      system-auth
password   include      system-auth

[root@lr6tst01 ~]#


Log - Feb 19 21:43:54 lr5dir02 slapd[7147]: daemon: read active on 14
Feb 19 21:43:54 lr5dir02 slapd[7147]: daemon: epoll: listen=7 active_threads=0 tvp=NULL
Feb 19 21:43:54 lr5dir02 slapd[7147]: conn=2 op=4 BIND dn="uid=ldaptest,ou=People,dc=hk,dc=intraxa" method=128
Feb 19 21:43:54 lr5dir02 slapd[7147]: conn=2 op=4 BIND dn="uid=ldaptest,ou=People,dc=hk,dc=intraxa" mech=SIMPLE ssf=0
Feb 19 21:43:54 lr5dir02 slapd[7147]: conn=2 op=4 RESULT tag=97 err=0 text=
Feb 19 21:43:54 lr5dir02 slapd[7147]: daemon: activity on 1 descriptor
Feb 19 21:43:54 lr5dir02 slapd[7147]: daemon: activity on:
Feb 19 21:43:54 lr5dir02 slapd[7147]:
Feb 19 21:43:54 lr5dir02 slapd[7147]: daemon: epoll: listen=7 active_threads=0 tvp=NULL
Feb 19 21:43:54 lr5dir02 slapd[7147]: daemon: activity on 1 descriptor
Feb 19 21:43:54 lr5dir02 slapd[7147]: daemon: activity on:
Feb 19 21:43:54 lr5dir02 slapd[7147]:  14r
Feb 19 21:43:54 lr5dir02 slapd[7147]:
Feb 19 21:43:54 lr5dir02 slapd[7147]: daemon: read active on 14
Feb 19 21:43:54 lr5dir02 slapd[7147]: daemon: epoll: listen=7 active_threads=0 tvp=NULL
Feb 19 21:43:54 lr5dir02 slapd[7147]: daemon: activity on 1 descriptor
Feb 19 21:43:54 lr5dir02 slapd[7147]: daemon: activity on:
Feb 19 21:43:54 lr5dir02 slapd[7147]:
Feb 19 21:43:54 lr5dir02 slapd[7147]: daemon: epoll: listen=7 active_threads=0 tvp=NULL
Feb 19 21:43:54 lr5dir02 slapd[7147]: conn=2 op=5 MOD dn="uid=ldaptest,ou=People,dc=hk,dc=intraxa"
Feb 19 21:43:54 lr5dir02 slapd[7147]: conn=2 op=5 MOD attr=userPassword
Feb 19 21:43:54 lr5dir02 slapd[7147]: conn=2 op=5 RESULT tag=103 err=10 text=
Feb 19 21:43:56 lr5dir02 slapd[7147]: daemon: activity on 1 descriptor
Feb 19 21:43:56 lr5dir02 slapd[7147]: daemon: activity on:
Feb 19 21:43:56 lr5dir02 slapd[7147]:  14r
Feb 19 21:43:56 lr5dir02 slapd[7147]:
Feb 19 21:43:56 lr5dir02 slapd[7147]: daemon: read active on 14
Feb 19 21:43:56 lr5dir02 slapd[7147]: daemon: epoll: listen=7 active_threads=0 tvp=NULL
Feb 19 21:43:56 lr5dir02 slapd[7147]: connection_read(14): input error=-2 id=2, closing.
Feb 19 21:43:56 lr5dir02 slapd[7147]: conn=2 op=6 UNBIND
Feb 19 21:43:56 lr5dir02 slapd[7147]: daemon: removing 14
Feb 19 21:43:56 lr5dir02 slapd[7147]: conn=2 fd=14 closed
Feb 19 21:43:56 lr5dir02 slapd[7147]: daemon: activity on 1 descriptor
Feb 19 21:43:56 lr5dir02 slapd[7147]: daemon: activity on:
Feb 19 21:43:56 lr5dir02 slapd[7147]:
Feb 19 21:43:56 lr5dir02 slapd[7147]: daemon: epoll: listen=7 active_threads=0 tvp=NUL
4

1 回答 1

1

如果您使用的是slurpd,则必须使用旧版本的 OpenLDAP —— 支持的复制配置是严格的单主 (RW),具有只读副本节点。slurpd不再支持,部分原因是它只能支持这种模式。

发生的事情是只读节点知道它不能接受写入请求(除了来自主节点的请求),因此它向客户端提供引用,发送到可写节点(即发送到updateref配置中的 URI)。

您应该升级到 OpenLDAP 2.4,并使用syncrepl协议进行复制。这允许三种复制方案:

  1. 单个 RW 主节点,多个 RO 副本节点
  2. 完整的多主 RW(有一些警告)
  3. mirrormode hybrid (active hot-standby), 使用平衡器或代理

您可以将 syncrepl 与 OpenLDAP 2.3 一起使用,但我强烈建议您升级(或者您可能会错过长达 5 年的 syncrepl 增强功能和补丁,具体取决于您使用的软件包以及是否已向后移植任何修复程序)。

当前设置的唯一选择是手动更改 RO 节点的配置以在主节点离线时将其提升为主节点,因为您可以猜测这可能难以维护。

于 2013-03-04T18:05:27.147 回答