免费注册 查看新帖 |

Chinaunix

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

[ldap] ldap无法登陆,报错daemon: bind(7) failed errno=98 (Address already in use)这是怎 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-10-08 16:42 |只看该作者 |倒序浏览
  1. [root@vfxdc02 openldap]# slapd -d 256
  2. @(#) $OpenLDAP: slapd 2.4.23 (Oct 31 2012 08:14:14) $
  3.         mockbuild@x86-022.build.eng.bos.redhat.com:/builddir/build/BUILD/openldap-2.4.23/openldap-2.4.23/build-servers/servers/slapd
  4. daemon: bind(7) failed errno=98 (Address already in use)
  5. daemon: bind(7) failed errno=98 (Address already in use)
  6. slapd stopped.
  7. connections_destroy: nothing to destroy.
  8. [root@vfxdc02 openldap]# lsof -i :389
  9. COMMAND PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
  10. slapd   717 ldap    7u  IPv4 139221      0t0  TCP *:ldap (LISTEN)
  11. slapd   717 ldap    8u  IPv6 139222      0t0  TCP *:ldap (LISTEN)
复制代码
centos6.4 64位的,2.6.32-71.el6.x86_64

slapd.conf文件内容:

  1. #
  2. # See slapd.conf(5) for details on configuration options.
  3. # This file should NOT be world readable.
  4. #

  5. include                /etc/openldap/schema/corba.schema
  6. include                /etc/openldap/schema/core.schema
  7. include                /etc/openldap/schema/cosine.schema
  8. include                /etc/openldap/schema/duaconf.schema
  9. include                /etc/openldap/schema/dyngroup.schema
  10. include                /etc/openldap/schema/inetorgperson.schema
  11. include                /etc/openldap/schema/java.schema
  12. include                /etc/openldap/schema/misc.schema
  13. include                /etc/openldap/schema/nis.schema
  14. include                /etc/openldap/schema/openldap.schema
  15. include                /etc/openldap/schema/ppolicy.schema
  16. include                /etc/openldap/schema/collective.schema

  17. # Allow LDAPv2 client connections.  This is NOT the default.
  18. allow bind_v2

  19. # Do not enable referrals until AFTER you have a working directory
  20. # service AND an understanding of referrals.
  21. #referral        ldap://root.openldap.org

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

  24. # Load dynamic backend modules
  25. # - modulepath is architecture dependent value (32/64-bit system)
  26. # - back_sql.la overlay requires openldap-server-sql package
  27. # - dyngroup.la and dynlist.la cannot be used at the same time

  28. # modulepath /usr/lib/openldap
  29. # modulepath /usr/lib64/openldap

  30. # moduleload accesslog.la
  31. # moduleload auditlog.la
  32. # moduleload back_sql.la
  33. # moduleload chain.la
  34. # moduleload collect.la
  35. # moduleload constraint.la
  36. # moduleload dds.la
  37. # moduleload deref.la
  38. # moduleload dyngroup.la
  39. # moduleload dynlist.la
  40. # moduleload memberof.la
  41. # moduleload pbind.la
  42. # moduleload pcache.la
  43. # moduleload ppolicy.la
  44. # moduleload refint.la
  45. # moduleload retcode.la
  46. # moduleload rwm.la
  47. # moduleload seqmod.la
  48. # moduleload smbk5pwd.la
  49. # moduleload sssvlv.la
  50. # moduleload syncprov.la
  51. # moduleload translucent.la
  52. # moduleload unique.la
  53. # moduleload valsort.la

  54. # The next three lines allow use of TLS for encrypting connections using a
  55. # dummy test certificate which you can generate by running
  56. # /usr/libexec/openldap/generate-server-cert.sh. Your client software may balk
  57. # at self-signed certificates, however.
  58. TLSCACertificatePath /etc/openldap/certs
  59. TLSCertificateFile /etc/openldap/certs/slapdcert.pem
  60. TLSCertificateKeyFile /etc/openldap/certs/slapdkey.pem

  61. # Sample security restrictions
  62. #        Require integrity protection (prevent hijacking)
  63. #        Require 112-bit (3DES or better) encryption for updates
  64. #        Require 63-bit encryption for simple bind
  65. # security ssf=1 update_ssf=112 simple_bind=64

  66. # Sample access control policy:
  67. #        Root DSE: allow anyone to read it
  68. #        Subschema (sub)entry DSE: allow anyone to read it
  69. #        Other DSEs:
  70. #                Allow self write access
  71. #                Allow authenticated users read access
  72. #                Allow anonymous users to authenticate
  73. #        Directives needed to implement policy:
  74. # access to dn.base="" by * read
  75. # access to dn.base="cn=Subschema" by * read
  76. # access to *
  77. #        by self write
  78. #        by users read
  79. #        by anonymous auth
  80. #
  81. # if no access controls are present, the default policy
  82. # allows anyone and everyone to read anything but restricts
  83. # updates to rootdn.  (e.g., "access to * by * read")
  84. #
  85. # rootdn can always read and write EVERYTHING!

  86. # enable on-the-fly configuration (cn=config)
  87. database config
  88. access to *
  89.         by dn.exact="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" manage
  90.         by * none

  91. # enable server status monitoring (cn=monitor)
  92. database monitor
  93. access to *
  94.         by dn.exact="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" read
  95.         by dn.exact="cn=Manager,dc=tdi,dc=com" read
  96.         by * none

  97. #######################################################################
  98. # database definitions
  99. #######################################################################

  100. database        bdb
  101. suffix                "dc=tdi,dc=com"
  102. checkpoint        1024 15
  103. rootdn                "cn=Manager,dc=tdi,dc=com"
  104. # Cleartext passwords, especially for the rootdn, should
  105. # be avoided.  See slappasswd(8) and slapd.conf(5) for details.
  106. # Use of strong authentication encouraged.
  107. # rootpw                secret
  108. # rootpw                {crypt}ijFYNcSNctBYg
  109. rootpw {SSHA}+i0bUyR7XKMezavGyRQXb2cdRgB5AVut

  110. # The database directory MUST exist prior to running slapd AND
  111. # should only be accessible by the slapd and slap tools.
  112. # Mode 700 recommended.
  113. directory        /var/lib/ldap

  114. # Indices to maintain for this database
  115. index objectClass                       eq,pres
  116. index ou,cn,mail,surname,givenname      eq,pres,sub
  117. index uidNumber,gidNumber,loginShell    eq,pres
  118. index uid,memberUid                     eq,pres,sub
  119. index nisMapName,nisMapEntry            eq,pres,sub

  120. # Replicas of this database
  121. replogfile /var/lib/ldap/openldap-master-replog
  122. #replica host=ldap-1.example.com:389 starttls=critical
  123. #     bindmethod=sasl saslmech=GSSAPI
  124. #     authcId=host/ldap-master.example.com@EXAMPLE.COM
复制代码

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
2 [报告]
发表于 2013-10-08 22:02 |只看该作者
address already in use,说明已经有进程在侦听对应的端口,你先将原来的进程kill掉再启动下

论坛徽章:
0
3 [报告]
发表于 2013-10-09 10:14 |只看该作者
回复 2# chenyx

Just try,好像还是不行:
  1. [root@vfxdc02 ~]# slapd -d 256
  2. @(#) $OpenLDAP: slapd 2.4.23 (Oct 31 2012 08:14:14) $
  3.         mockbuild@x86-022.build.eng.bos.redhat.com:/builddir/build/BUILD/openldap-2.4.23/openldap-2.4.23/build-servers/servers/slapd
  4. daemon: bind(7) failed errno=98 (Address already in use)
  5. daemon: bind(7) failed errno=98 (Address already in use)
  6. slapd stopped.
  7. connections_destroy: nothing to destroy.
  8. [root@vfxdc02 ~]# ps -aux | grep slapd
  9. Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
  10. root      3839  0.0  0.1 165652  5236 ?        Ssl  10:07   0:00 slapd
  11. root      3844  0.0  0.0 105400   924 pts/0    S+   10:07   0:00 grep slapd
  12. [root@vfxdc02 ~]# kill 3839
  13. [root@vfxdc02 ~]# service slapd status
  14. slapd dead but pid file exists
  15. [root@vfxdc02 ~]# service slapd restart
  16. Stopping slapd:                                            [FAILED]
  17. Starting slapd:                                            [  OK  ]
  18. [root@vfxdc02 ~]# ps -aux | grep slapd
  19. Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
  20. ldap      3896  0.0  0.1 167724  5248 ?        Ssl  10:08   0:00 /usr/sbin/slapd -h  ldap:/// ldaps:/// ldapi:/// -u ldap
  21. root      3902  0.0  0.0 105400   924 pts/0    S+   10:08   0:00 grep slapd
  22. [root@vfxdc02 ~]# slapd -d 256
  23. @(#) $OpenLDAP: slapd 2.4.23 (Oct 31 2012 08:14:14) $
  24.         mockbuild@x86-022.build.eng.bos.redhat.com:/builddir/build/BUILD/openldap-2.4.23/openldap-2.4.23/build-servers/servers/slapd
  25. daemon: bind(7) failed errno=98 (Address already in use)
  26. daemon: bind(7) failed errno=98 (Address already in use)
  27. slapd stopped.
  28. connections_destroy: nothing to destroy.
复制代码

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
4 [报告]
发表于 2013-10-09 10:28 |只看该作者
你已经启动slapd服务进程了.
你先service slapd stop,然后再slapd -d 256

论坛徽章:
0
5 [报告]
发表于 2013-10-09 10:41 |只看该作者
回复 4# chenyx

service slapd stop之后再slapd -d 256,相当于重启了slapd服务。会卡停在slapd starting那里,这时从另一个term中进入再测试slapd -d 256的结果和之前是一样的。卡在slpad starting那里最后我就ctrl+c停了。
  1. [root@vfxdc02 ~]# slapd -d 256
  2. @(#) $OpenLDAP: slapd 2.4.23 (Oct 31 2012 08:14:14) $
  3.         mockbuild@x86-022.build.eng.bos.redhat.com:/builddir/build/BUILD/openldap-2.4.23/openldap-2.4.23/build-servers/servers/slapd
  4. slapd starting
  5. ^Cdaemon: shutdown requested and initiated.
  6. slapd shutdown: waiting for 0 operations/tasks to finish
  7. slapd stopped.
复制代码

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
6 [报告]
发表于 2013-10-09 10:45 |只看该作者
那你为什么不用service直接启动呢?
ldap的服务配置你应该在配置文件里面做好就可以的

论坛徽章:
0
7 [报告]
发表于 2013-10-09 10:53 |只看该作者
回复 6# chenyx

谢谢您的回复。

不过我现在的问题是服务可以启动,可以添加用户到ldap的db里面,并且在authconfig里面设置了用ldap登录,但就是无法用ldap中的用户登录进来
  1. [root@vfxdc02 ~]# ldapsearch -x -b "dc=tdi,dc=com"
  2. # extended LDIF
  3. #
  4. # LDAPv3
  5. # base <dc=tdi,dc=com> with scope subtree
  6. # filter: (objectclass=*)
  7. # requesting: ALL
  8. #

  9. # tdi.com
  10. dn: dc=tdi,dc=com
  11. dc: tdi
  12. objectClass: top
  13. objectClass: domain

  14. # engineering, tdi.com
  15. dn: ou=engineering,dc=tdi,dc=com
  16. ou: engineering
  17. objectClass: organizationalUnit

  18. # liaoldap, engineering, tdi.com
  19. dn: cn=liaoldap,ou=engineering,dc=tdi,dc=com
  20. cn: liaoldap
  21. sn: User
  22. objectClass: inetOrgPerson
  23. userPassword:: e1NTSEF9ck9XaHJKbm16VC8yZ29Ia2k5a3ZBSnI0ZUFsNW9BQ2c=

复制代码
  1. [root@vfxdc02 ~]# su liaoldap
  2. su: user liaoldap does not exist
复制代码

论坛徽章:
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-10-12 10:54 |只看该作者
你這種情況類似使用ctrl+z停止服務。重新啟動即可順速解決。也可以不用重新啟動解決。還是cheny說的殺進程。你應該沒有完全殺掉openldap的相關進程。數據庫使用的是bdb還是?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP