有两台机器A,B,都是CENTOS4。4系统,全部都是最小化安装,LDAP的版本也一样,都是编译安装的,总之环境是一模一样。在A机器上做:[root@centos ~]# slapcat -l /root/export.ldif
slapcat: backend.c:484: backend_destroy: Assertion `bd->be_replica == ((void *)0)' failed.
Aborted
就报如上错误,但确实有/root/export.ldif这个文件出现,在另一台机器上导入时:
slapadd -v -l /root/ldif
=> bdb_tool_entry_put: id2entry_add failed: DB_KEYEXIST: Key/data pair already exists (-30996)
=> bdb_tool_entry_put: txn_aborted! DB_KEYEXIST: Key/data pair already exists (-30996)
slapadd: could not add entry dn="dc=donggua,dc=com" (line=13): txn_aborted! DB_KEYEXIST: Key/data pair already exists (-30996)
这是为什么啊?
两台机器的SLAPD。CONF文件是一样的,我从A上导到B上去的。如下:
**********************************************************************************************
[root@h000287-oeq ~]# more /usr/local/etc/openldap/slapd.conf
#
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
include /usr/local/etc/openldap/schema/core.schema
include /usr/local/etc/openldap/schema/cosine.schema
include /usr/local/etc/openldap/schema/inetorgperson.schema
# Define global ACLs to disable default read access.
# Do not enable referrals until AFTER you have a working directory
# service AND an understanding of referrals.
#referral ldap://root.openldap.org
replogfile /var/ldap/slapd.replog
replica host=172.16.9.118:389
suffix="dc=donggua,dc=com"
binddn="cn=root,dc=donggua,dc=com"
credentials=donggua
bindmethod=simple
loglevel 4
pidfile /usr/local/var/run/slapd.pid
argsfile /usr/local/var/run/slapd.args
# Load dynamic backend modules:
# modulepath /usr/local/openldap/libexec/openldap
# moduleload back_bdb.la
# moduleload back_ldap.la
# moduleload back_ldbm.la
# moduleload back_passwd.la
# moduleload back_shell.la
# Sample security restrictions
# Require integrity protection (prevent hijacking)
# Require 112-bit (3DES or better) encryption for updates
# Require 63-bit encryption for simple bind
# security ssf=1 update_ssf=112 simple_bind=64
# Sample access control policy:
# Root DSE: allow anyone to read it
# Subschema (sub)entry DSE: allow anyone to read it
# Other DSEs:
# Allow self write access
# Allow authenticated users read access
# Allow anonymous users to authenticate
# Directives needed to implement policy:
# access to dn.base="" by * read
# access to dn.base="cn=Subschema" by * read
# access to *
# by self write
# by users read
# by anonymous auth
access to *
by * write
#
# if no access controls are present, the default policy
# allows anyone and everyone to read anything but restricts
# updates to rootdn. (e.g., "access to * by * read"

#
# rootdn can always read and write EVERYTHING!
#######################################################################
# BDB database definitions
#######################################################################
database bdb
suffix "dc=donggua,dc=com"
rootdn "cn=root,dc=donggua,dc=com"
# Cleartext passwords, especially for the rootdn, should
# be avoid. See slappasswd(

and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw donggua
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended.
directory /usr/local/var/openldap-data
# Indices to maintain
index objectClass eq
index cn,sn,mail eq,sub
index departmentNumber eq
********************************************************************************************
现在发现了,是SLAPD。CONF文件的这一段有问题:
replogfile /var/ldap/slapd.replog
replica host=172.16.9.118:389
suffix="dc=donggua,dc=com"
binddn="cn=root,dc=donggua,dc=com"
credentials=donggua
bindmethod=simple
加了这一段就出错,不加就很好,但不加这一段,怎么做主服务器来实现主从复制呢?
[
本帖最后由 donggua0713 于 2008-3-11 15:03 编辑 ]