免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 8343 | 回复: 9
打印 上一主题 下一主题

[ldap] openldap 2.4 复制mirror mode的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-11-01 00:54 |只看该作者 |倒序浏览
环境
RHEL 6.3 X64
OPENLDAP 版本
lapd -V
@(#) $OpenLDAP: slapd 2.4.23 (May  7 2012 13:59:20) $

两台服务器:10.x.x.7  10.x.x.8
目的是,这两台的LDAP 数据相互同步。

10.x.x.7 配置如下
root@IT-ldap1[/var/log]#cat /etc/openldap/slapd.conf
include         /etc/openldap/schema/corba.schema
include         /etc/openldap/schema/core.schema
include         /etc/openldap/schema/cosine.schema
include         /etc/openldap/schema/duaconf.schema
include         /etc/openldap/schema/dyngroup.schema
include         /etc/openldap/schema/inetorgperson.schema
include         /etc/openldap/schema/java.schema
include         /etc/openldap/schema/misc.schema
include         /etc/openldap/schema/nis.schema
include         /etc/openldap/schema/openldap.schema
include         /etc/openldap/schema/ppolicy.schema
include         /etc/openldap/schema/collective.schema

allow bind_v2

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

loglevel        256
logfile        /var/log/slapd/ldap.log


TLSCACertificatePath /etc/openldap/certs
TLSCertificateFile "\"OpenLDAP Server\""
TLSCertificateKeyFile /etc/openldap/certs/password


database config
access to *
        by dn.exact="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" manage
        by * none

database monitor

access to attrs=userPassword
        by self write
        by anonymous auth
        by dn.base="cn=Manager,dc=services,dc=eu" write
        by * none

access to *
   by * write
   by * read

serverID 1

database        bdb
suffix          "dc=test,dc=eu"
checkpoint      1024 15
rootdn          "cn=Manager,dc=test,dc=eu"

rootpw          {SSHA}abJjc8Q3tt0+Qe7K01FUysrpNVRM8/qO

directory       /var/lib/ldap

# Indices to maintain for this database
index objectClass                       eq,pres
index ou,cn,mail,surname,givenname      eq,pres,sub
index uidNumber,gidNumber,loginShell    eq,pres
index uid,memberUid                     eq,pres,sub
index nisMapName,nisMapEntry            eq,pres,sub


#overlay                 syncprov
syncrepl rid=001
        provider=ldap://10.x.x.8:389
        bindmethod=simple
        binddn="cn=Manager,dc=test,dc=eu"
        credentials="test"
        searchbase="dc=test,dc=eu"
        schemachecking=on
        type=refreshAndPersist
        retry="60 +"

mirrormode on

================================================================

10.x.x.8 配置如下
root@IT-ldap2[/var/log]#cat /etc/openldap/slapd.conf
include         /etc/openldap/schema/corba.schema
include         /etc/openldap/schema/core.schema
include         /etc/openldap/schema/cosine.schema
include         /etc/openldap/schema/duaconf.schema
include         /etc/openldap/schema/dyngroup.schema
include         /etc/openldap/schema/inetorgperson.schema
include         /etc/openldap/schema/java.schema
include         /etc/openldap/schema/misc.schema
include         /etc/openldap/schema/nis.schema
include         /etc/openldap/schema/openldap.schema
include         /etc/openldap/schema/ppolicy.schema
include         /etc/openldap/schema/collective.schema

allow bind_v2

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

loglevel        256
logfile        /var/log/slapd/ldap.log


TLSCACertificatePath /etc/openldap/certs
TLSCertificateFile "\"OpenLDAP Server\""
TLSCertificateKeyFile /etc/openldap/certs/password


database config
access to *
        by dn.exact="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" manage
        by * none

database monitor

access to attrs=userPassword
        by self write
        by anonymous auth
        by dn.base="cn=Manager,dc=services,dc=eu" write
        by * none

access to *
   by * write
   by * read

serverID 1

database        bdb
suffix          "dc=test,dc=eu"
checkpoint      1024 15
rootdn          "cn=Manager,dc=test,dc=eu"

rootpw          {SSHA}abJjc8Q3tt0+Qe7K01FUysrpNVRM8/qO

directory       /var/lib/ldap

# Indices to maintain for this database
index objectClass                       eq,pres
index ou,cn,mail,surname,givenname      eq,pres,sub
index uidNumber,gidNumber,loginShell    eq,pres
index uid,memberUid                     eq,pres,sub
index nisMapName,nisMapEntry            eq,pres,sub


#overlay                 syncprov
syncrepl rid=001
        provider=ldap://10.x.x.7:389
        bindmethod=simple
        binddn="cn=Manager,dc=test,dc=eu"
        credentials="test"
        searchbase="dc=test,dc=eu"
        schemachecking=on
        type=refreshAndPersist
        retry="60 +"

mirrormode on


=====================================================================
两边都报错如下:

do_syncrep2: rid=001 got search entry without Sync State control
do_syncrepl: rid=001 rc -1 retrying
conn=1095 fd=12 ACCEPT from IP=10.x.x.7:30808 (IP=0.0.0.0:389)
conn=1095 op=0 BIND dn="cn=manager,dc=zteservices,dc=eu" method=128
conn=1095 op=0 BIND dn="cn=manager,dc=zteservices,dc=eu" mech=SIMPLE ssf=0
conn=1095 op=0 RESULT tag=97 err=0 text=
conn=1095 op=1 SRCH base="dc=zteservices,dc=eu" scope=2 deref=0 filter="(objectClass=*)"
conn=1095 op=1 SRCH attr=* +
slap_global_control: unrecognized control: 1.3.6.1.4.1.4203.1.9.1.1
send_search_entry: conn 1095  ber write failed.
conn=1095 fd=12 closed (connection lost on write)
do_syncrep2: rid=001 got search entry without Sync State control
do_syncrepl: rid=001 rc -1 retrying





Google 很久没有找到方法。

求大神帮忙看看啊。

论坛徽章:
24
天蝎座
日期:2014-05-13 18:05:59IT运维版块每日发帖之星
日期:2015-11-26 06:20:00操作系统版块每月发帖之星
日期:2015-12-02 14:57:54IT运维版块每月发帖之星
日期:2016-01-07 23:01:56IT运维版块每周发帖之星
日期:2016-01-07 23:04:2615-16赛季CBA联赛之青岛
日期:2016-01-23 07:58:272016猴年福章徽章
日期:2016-02-18 15:30:3415-16赛季CBA联赛之北控
日期:2016-03-23 14:20:06IT运维版块每日发帖之星
日期:2016-04-01 06:20:0015-16赛季CBA联赛之吉林
日期:2016-06-28 13:51:54IT运维版块每日发帖之星
日期:2016-07-01 06:20:00IT运维版块每日发帖之星
日期:2015-11-23 06:20:00
2 [报告]
发表于 2013-11-01 07:43 |只看该作者
配置明顯有問題,自己搜索我前幾天才發佈的openldap2.4 mirrorr模式。

2.4版本的你肯定找不到教材,我都找不到,你還想找,我自己把官方的英文片段看了不下5片以上。我不光把mirror最簡單模式給弄出來。連最複雜的N-WAY 多主+多從模式也已弄出來。

论坛徽章:
0
3 [报告]
发表于 2013-11-06 01:02 |只看该作者
woxizishen 发表于 2013-11-01 07:43
配置明顯有問題,自己搜索我前幾天才發佈的openldap2.4 mirrorr模式。

2.4版本的你肯定找不到教材,我都 ...



兄弟,麻烦你贴下 你那帖子的 链接 ??

还有,麻烦指导一下啊,这个配置哪里错了...

论坛徽章:
24
天蝎座
日期:2014-05-13 18:05:59IT运维版块每日发帖之星
日期:2015-11-26 06:20:00操作系统版块每月发帖之星
日期:2015-12-02 14:57:54IT运维版块每月发帖之星
日期:2016-01-07 23:01:56IT运维版块每周发帖之星
日期:2016-01-07 23:04:2615-16赛季CBA联赛之青岛
日期:2016-01-23 07:58:272016猴年福章徽章
日期:2016-02-18 15:30:3415-16赛季CBA联赛之北控
日期:2016-03-23 14:20:06IT运维版块每日发帖之星
日期:2016-04-01 06:20:0015-16赛季CBA联赛之吉林
日期:2016-06-28 13:51:54IT运维版块每日发帖之星
日期:2016-07-01 06:20:00IT运维版块每日发帖之星
日期:2015-11-23 06:20:00
4 [报告]
发表于 2013-11-06 08:02 |只看该作者
回复 3# P_sam


rootpw          {SSHA}abJjc8Q3tt0+Qe7K01FUysrpNVRM8/qO

credentials="test"

這什麽???一個用哈希,一個用明文
?????????????????????????????????????????????????????????????



這2個請加上
type=refreshAndPersist                  同步機制設定
overlay syncprov                            後端工作在overlay模式下

论坛徽章:
24
天蝎座
日期:2014-05-13 18:05:59IT运维版块每日发帖之星
日期:2015-11-26 06:20:00操作系统版块每月发帖之星
日期:2015-12-02 14:57:54IT运维版块每月发帖之星
日期:2016-01-07 23:01:56IT运维版块每周发帖之星
日期:2016-01-07 23:04:2615-16赛季CBA联赛之青岛
日期:2016-01-23 07:58:272016猴年福章徽章
日期:2016-02-18 15:30:3415-16赛季CBA联赛之北控
日期:2016-03-23 14:20:06IT运维版块每日发帖之星
日期:2016-04-01 06:20:0015-16赛季CBA联赛之吉林
日期:2016-06-28 13:51:54IT运维版块每日发帖之星
日期:2016-07-01 06:20:00IT运维版块每日发帖之星
日期:2015-11-23 06:20:00
5 [报告]
发表于 2013-11-06 08:09 |只看该作者
標準多主模式架構和多主模式架構

1.jpg (43.24 KB, 下载次数: 301)

1.jpg

2.jpg (31.01 KB, 下载次数: 301)

2.jpg

论坛徽章:
0
6 [报告]
发表于 2013-11-06 17:55 |只看该作者
woxizishen 发表于 2013-11-06 08:02
回复 3# P_sam



1.使用“overlay                 syncprov ”  启动进程的时候,报错:overlay "syncprov" not found
2.type=refreshAndPersist  这个 添加了。
3.在没有使用 overlay syncprov 的情况下,密码都是使用的secret明文。报错还是一样的。

报错提示的是 写错误,报错如下:

conn=1052 fd=12 ACCEPT from IP=10.x.x.8:56680 (IP=0.0.0.0:389)
conn=1052 op=0 BIND dn="cn=manager1,dc=zteservices,dc=eu" method=128
conn=1052 op=0 BIND dn="cn=manager1,dc=zteservices,dc=eu" mech=SIMPLE ssf=0
conn=1052 op=0 RESULT tag=97 err=0 text=
conn=1052 op=1 SRCH base="dc=zteservices,dc=eu" scope=2 deref=0 filter="(objectClass=*)"
conn=1052 op=1 SRCH attr=* +
slap_global_control: unrecognized control: 1.3.6.1.4.1.4203.1.9.1.1
send_search_entry: conn 1052  ber write failed.
conn=1052 fd=12 closed (connection lost on write)
connection_read(12): no connection!
connection_read(12): no connection!

论坛徽章:
0
7 [报告]
发表于 2013-11-06 18:04 |只看该作者
回复 5# woxizishen



谢谢啊!!
问题搞定了!!
哈哈
把配置文件里面的这三行的注释去掉就可以使用syncprov了。
数据同步成功。

modulepath /usr/lib/openldap
modulepath /usr/lib64/openldap
moduleload syncprov.la


   

论坛徽章:
24
天蝎座
日期:2014-05-13 18:05:59IT运维版块每日发帖之星
日期:2015-11-26 06:20:00操作系统版块每月发帖之星
日期:2015-12-02 14:57:54IT运维版块每月发帖之星
日期:2016-01-07 23:01:56IT运维版块每周发帖之星
日期:2016-01-07 23:04:2615-16赛季CBA联赛之青岛
日期:2016-01-23 07:58:272016猴年福章徽章
日期:2016-02-18 15:30:3415-16赛季CBA联赛之北控
日期:2016-03-23 14:20:06IT运维版块每日发帖之星
日期:2016-04-01 06:20:0015-16赛季CBA联赛之吉林
日期:2016-06-28 13:51:54IT运维版块每日发帖之星
日期:2016-07-01 06:20:00IT运维版块每日发帖之星
日期:2015-11-23 06:20:00
8 [报告]
发表于 2013-11-07 08:02 |只看该作者
回复 7# P_sam

估計你應該不是按照官方檔案配置的,官方里沒有需要加入你上面那幾個選項,另外你互相同步的主機不用TLS來保證數據傳輸的安全性嗎?當然如果你的數據不重要到無所謂了。
另外tls并不好配置,是openldap2.4我個人認為最難配置的。官方講的都是一些參數作用,沒有具體告訴你配置方法。你可以試試。

论坛徽章:
0
9 [报告]
发表于 2014-01-14 14:36 |只看该作者
你好~我想请问下你解决之后还是bindmethod用的simple,credentials用的是加密过的密文3Eg+gKegvZ73HYz5c2c5JA么?

我试验的 rootpw用的是密文,然后这样配置
bindmethod=simple
credentials=3Eg+gKegvZ73HYz5c2c5JA
就不能同步。
可不可以指点下用加密过的密码如何实现同步呢?

回复 7# P_sam


   

论坛徽章:
0
10 [报告]
发表于 2014-02-20 21:23 |只看该作者
http://bbs.51cto.com/thread-1078277-1.html
这个是你总结的连接吧,你总结的挺好的,但怎么不全呢?是不是其他的在另外的文章中啊?
能否给个连接,非常感谢!
回复 4# woxizishen


   
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP