免费注册 查看新帖 |

Chinaunix

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

[ldap] 还是主从复制的问题,从服务端不能接收主服务端的数据 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-07-06 16:43 |只看该作者 |倒序浏览
10可用积分
主:192.168.5.42
从: 192.168.5.41
启动不会报错,但是在主服务端更新和添加的数据,从服务端不能接收

在/var/lib/ldap/replica目录下面有个192.168.5.41:389.rej文件,发现内容:


  1. ERROR: Constraint violation: structuralObjectClass: no user modification allow ed
  2. replica: 192.168.5.41:389
  3. time: 1246868887.0
  4. dn: uid=yccx2004,ou=People,dc=nba126,dc=com
  5. changetype: add
  6. uid: yccx2004
  7. cn: yccx2004
  8. sn: yccx2004
  9. objectClass: inetOrgPerson
  10. objectClass: top
  11. userPassword:: e2NyeXB0fSEh
  12. structuralObjectClass: inetOrgPerson
  13. entryUUID: ad80d672-fe52-102d-8ba9-b13b18ca576d
  14. creatorsName: cn=Manager,dc=nba126,dc=com
  15. createTimestamp: 20090706082807Z
  16. entryCSN: 20090706082807Z#000000#00#000000
  17. modifiersName: cn=Manager,dc=nba126,dc=com
  18. modifyTimestamp: 20090706082807Z
复制代码


主服务器的文件配置:

  1. loglevel 296
  2. local4.debug /var/log/slapd.log
  3. include         /etc/openldap/schema/core.schema
  4. include         /etc/openldap/schema/cosine.schema
  5. include         /etc/openldap/schema/inetorgperson.schema
  6. include         /etc/openldap/schema/nis.schema
  7. allow bind_v2
  8. pidfile         /var/run/openldap/slapd.pid
  9. argsfile        /var/run/openldap/slapd.args
  10. access to attrs=shadowLastChange,userPassword
  11.         by self write
  12.         by anonymous auth
  13.         by dn="cn=Manager,dc=nba126,dc=com" write
  14. access to *
  15.         by dn="cn=Manager,dc=nba126,dc=com" write
  16.         by * read  
  17. database        bdb
  18. suffix          "dc=nba126,dc=com"
  19. rootdn          "cn=Manager,dc=nba126,dc=com"
  20. rootpw 123456
  21. directory       /var/lib/ldap
  22. index objectClass                       eq,pres
  23. index ou,cn,mail,surname,givenname      eq,pres,sub
  24. index uidNumber,gidNumber,loginShell    eq,pres
  25. index uid,memberUid                     eq,pres,sub
  26. index nisMapName,nisMapEntry            eq,pres,sub
  27. replogfile /var/lib/ldap/openldap-master-replog
  28. replica uri=ldap://192.168.5.41:389
  29.         binddn="cn=Manager,dc=nba126,dc=com"         
  30.         bindmethod=simple credentials=123456
复制代码

从服务端的文件配置

  1. loglevel 296
  2. local4.debug /var/log/slapd.log
  3. include         /etc/openldap/schema/core.schema
  4. include         /etc/openldap/schema/cosine.schema
  5. include         /etc/openldap/schema/inetorgperson.schema
  6. include         /etc/openldap/schema/nis.schema
  7. allow bind_v2
  8. pidfile         /var/run/openldap/slapd.pid
  9. argsfile        /var/run/openldap/slapd.args
  10. access to attrs=shadowLastChange,userPassword
  11.         by self write
  12.         by anonymous auth
  13.         by dn="cn=Manager,dc=nba126,dc=com" write
  14. access to *
  15.         by dn="cn=Manager,dc=nba126,dc=com" write
  16.         by * read
  17.    
  18. database        bdb
  19. suffix          "dc=nba126,dc=com"
  20. rootdn          "cn=Manager,dc=nba126,dc=com"
  21. rootpw 123456
  22. directory       /var/lib/ldap
  23. index objectClass                       eq,pres
  24. index ou,cn,mail,surname,givenname      eq,pres,sub
  25. index uidNumber,gidNumber,loginShell    eq,pres
  26. index uid,memberUid                     eq,pres,sub
  27. index nisMapName,nisMapEntry            eq,pres,sub
  28. updatedn="cn=Manager,dc=nba126,dc=com"
复制代码


请各位高手帮忙看看,我google了一下,英文的看不太懂,也没找到什么有价值的东西,再次感谢!

最佳答案

查看完整内容

ERROR: Constraint violation: structuralObjectClass: no user modification allow ed这个提示应该说明你在变更的时候并没有做好合适的structural的OC:objectClass: inetOrgPersonobjectClass: top按照道理top不应该做add上去的吧?说明你源(master)上的数据就不对付?ldap建议严密组织OC。我的设置:dn: cn=zym5,ou=People,o=zymlinuxobjectClass: topobjectClass: personobjectClass: organizationalPersonobjectClass: inet ...

论坛徽章:
0
2 [报告]
发表于 2009-07-06 16:43 |只看该作者
ERROR: Constraint violation: structuralObjectClass: no user modification allow ed
这个提示应该说明你在变更的时候并没有做好合适的structural的OC:
objectClass: inetOrgPerson
objectClass: top
按照道理top不应该做add上去的吧?说明你源(master)上的数据就不对付?ldap建议严密组织OC。
我的设置:
dn: cn=zym5,ou=People,o=zymlinux
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount

FYI

论坛徽章:
0
3 [报告]
发表于 2009-07-06 16:43 |只看该作者
自己先顶上来

论坛徽章:
0
4 [报告]
发表于 2009-07-06 17:17 |只看该作者

论坛徽章:
0
5 [报告]
发表于 2009-07-06 17:46 |只看该作者
原帖由 ziggler 于 2009-7-6 17:17 发表
http://www.openldap.org/lists/op ... 00803/msg00137.html


这样试过没用啊

论坛徽章:
0
6 [报告]
发表于 2009-07-07 17:45 |只看该作者
感觉LDAP版块很冷清,看不到什么人

论坛徽章:
0
7 [报告]
发表于 2009-07-09 21:18 |只看该作者
access to *
         by * read

试试这样看看吧

论坛徽章:
0
8 [报告]
发表于 2009-07-10 10:48 |只看该作者
原帖由 aaaaaa 于 2009-7-8 17:42 发表
ERROR: Constraint violation: structuralObjectClass: no user modification allow ed
这个提示应该说明你在变更的时候并没有做好合适的structural的OC:
objectClass: inetOrgPerson
objectClass: top
按 ...

那你的access是怎么写的呢,能公布一下吗?

论坛徽章:
0
9 [报告]
发表于 2009-07-10 10:49 |只看该作者
原帖由 netocool 于 2009-7-9 21:18 发表
access to *
         by * read

试试这样看看吧


我里面已经有一条是这样的啦


  1.   access to *
  2.          by dn="cn=Manager,dc=nba126,dc=com" write
  3.          by * read  
复制代码

论坛徽章:
0
10 [报告]
发表于 2009-07-10 11:08 |只看该作者
我自己已经解决了,这个问题还是配置文件错了

将主配置文件的

  1. replica uri=ldap://192.168.5.41:389
  2.         binddn="cn=Manager,dc=nba126,dc=com"         
  3.         bindmethod=simple credentials=123456
复制代码

改为

  1. replica         host=ldap://192.168.5.41:389
  2.                      binddn="cn=Manager,dc=nba126,dc=com"         
  3.                      bindmethod=simple credentials=123456
复制代码

将从配置文件中的

  1. updatedn="cn=Manager,dc=nba126,dc=com"
复制代码

改为:

  1. updatedn        "cn=Manager,dc=nba126,dc=com"
  2. updateref       ldap://192.168.5.42
复制代码

现在在主服务端进行修改添加删除,从服务端都可以同步到
感觉ldap的配置对Tab制表符要求比较严,有些地方不用Tab键居然会报错
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP