OpenLDAP 错误收集

Posted by Yancy on 2017-04-08

OpenLDAP 错误收集

启动slapd服务:报错

1
2
3
4
5
6
7
8
9
10
Checking configuration files for slapd: [WARNING]
bdb_db_open: warning – no DB_CONFIG file found in directory /var/lib/ldap: (2).
Expect poor performance for suffix “dc=my-domain,dc=com”.
config file testing succeeded
操作命令:
rm -rf /var/lib/ldap/*
cp /usr/share/doc/openldap-servers-2.4.12/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
chown -R ldap:ldap /var/lib/ldap
/etc/init.d/ldap restart
  1. slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d 报错:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
[root@yancy ldap]# slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d
59842dbe bdb_db_open: database "dc=jollychic,dc=com": db_open(/var/lib/ldap/id2entry.bdb) failed: No such file or directory (2).
59842dbe backend_startup_one (type=bdb, suffix="dc=jollychic,dc=com"): bi_db_open failed! (2)
slap_startup failed (test would succeed using the -u switch)
解决操作命令:
解决方法:
cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
chown -R ldap.ldap /var/lib/ldap
继续检查配置文件
slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d
如果还继续报错:
删掉slapd.d下的文件,重新生成 不然待会启动时会报错
[root@yancy ldap]# rm -rf slapd.d/*
[root@yancy ldap]# cd /var/lib/ldap/
[root@yancy ldap]# slapd
测试 slapd.conf 设置
slaptest -u
cp -a /etc/openldap/slapd.d/ /etc/openldap/slapd.dbakup0810
rm -rf /etc/openldap/slapd.d/*
chown ldap.ldap /var/lib/ldap/*
chmod -R 600 /var/lib/ldap/*
cd /var/lib/ldap/ && slapd
slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d
如果还不行:
rm -rf /etc/openldap/slapd.d/*
rm -rf rm -rf /var/lib/ldap/__db.00*
rm -rf /var/lib/ldap/alock
/etc/init.d/slapd restart
chown -R ldap:ldap /etc/openldap/slapd.d
chown ldap.ldap /var/lib/ldap/*
service slapd restart
3. 导入数据报错:
[root@H5 ldap]# ldapadd -x -D "cn=Manager,dc=jollychic,dc=com" -W -f /tmp/base.ldif
Enter LDAP Password:
adding new entry "dc=jollychic,dc=com"
ldap_add: Server is unwilling to perform (53)
additional info: shadow context; no update referral