BBS.ChinaUnix.net
今日推荐    首页 | 新闻 | Linux | AIX | 博客 | 论坛 | 存储 | 人才 | 培训 | 知识库 | 资料 | 读书 | 手册 | 精华 | 下载 | 空间     
  会员: 密码: 免费注册 | 忘记密码 | 会员登录 | 搜索 | 帮助 


求助,LDAP导出数据时出错~!

首页 » 论坛 » LDAP »  
[打印] [订阅] [收藏] [推荐给朋友] [本帖文本页]
donggua0713
圣骑士




UID:473257
注册:2006-10-7
最后登录: 2008-07-01
帖子:141
精华:0

可用积分:631
信誉积分:100
专家积分:0 (本版)

状态:...离线...

[个人空间] [短信] [博客]


顶部
1楼 发表于 2008-3-10 16:32 
有两台机器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 编辑 ]



您对本贴的看法:鲜花[0] 臭蛋[0]
CU可用积分兑换Linux/Unix精品图书 |《Ubuntu标准教程》书评获奖名单公布
forxy
圣骑士




UID:346557
注册:2005-12-7
最后登录: 2008-07-02
帖子:114
精华:1

可用积分:118
信誉积分:100
专家积分:0 (本版)

状态:...离线...

[个人空间] [短信] [博客]


顶部
2楼 发表于 2008-4-1 19:15 
你把slapd服务停止后再导出呢?
int backend_destroy(void)
{
        BackendDB *bd;
        BackendInfo *bi;

        /* destroy each backend database */
        while (( bd = LDAP_STAILQ_FIRST(&backendDB))) {
                backend_destroy_one( bd, 1 );
        }

        /* destroy each backend type */
        LDAP_STAILQ_FOREACH( bi, &backendInfo, bi_next ) {
                if( bi->bi_destroy ) {
                        bi->bi_destroy( bi );
                }
        }

        nBackendInfo = 0;
        LDAP_STAILQ_INIT(&backendInfo);

        /* destroy frontend database */
        bd = frontendDB;
        if ( bd ) {
                if ( bd->bd_info->bi_db_destroy ) {
                        bd->bd_info->bi_db_destroy( bd );
                }
                ber_bvarray_free( bd->be_suffix );
                ber_bvarray_free( bd->be_nsuffix );
                if ( !BER_BVISNULL( &bd->be_rootdn ) ) {
                        free( bd->be_rootdn.bv_val );
                }
                if ( !BER_BVISNULL( &bd->be_rootndn ) ) {
                        free( bd->be_rootndn.bv_val );
                }
                if ( !BER_BVISNULL( &bd->be_rootpw ) ) {
                        free( bd->be_rootpw.bv_val );
                }
                acl_destroy( bd->be_acl, frontendDB->be_acl );

                if ( bd->be_replogfile != NULL ) {
                        free( bd->be_replogfile );
                }
                assert( bd->be_replica == NULL );
        }

        return 0;
}

BackendInfo* backend_info(const char *type)
{
        BackendInfo *bi;

        /* search for the backend type */
        LDAP_STAILQ_FOREACH(bi,&backendInfo,bi_next) {
                if( strcasecmp(bi->bi_type, type) == 0 ) {
                        return bi;
                }
        }

        return NULL;
}



您对本贴的看法:鲜花[0] 臭蛋[0]
CU可用积分兑换Linux/Unix精品图书 |《Ubuntu标准教程》书评获奖名单公布

首页 » 论坛 » LDAP »


 


Copyright © 2001-2008 ChinaUnix.net All Rights Reserved     联系我们:

感谢所有关心和支持过ChinaUnix的朋友们    转载本站内容请注明原作者名及出处

京ICP证041476号


清除 Cookies - ChinaUnix - Archiver - WAP - TOP

Processed in 0.060537 second(s), 4 queries , Gzip enabled