如何克隆OpenLDAP数据库 [英] How do I clone an OpenLDAP database

查看:131
本文介绍了如何克隆OpenLDAP数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这更像是一个服务器故障问题,而不是堆栈溢出问题,但是由于服务器故障尚未启动,所以我去了:

I know this is more like a serverfault question than a stackoverflow question, but since serverfault isn't up yet, here I go:

我应该将应用程序从一台Redhat服务器迁移到另一台,并且在不非常了解该应用程序内部工作的情况下,如何将带有模式和所有功能的OpenLDAP数据库从一台机器迁移到另一台机器

I'm supposed to move an application from one redhat server to another, and without very good knowledge of the internal workings of the application, how would I move the OpenLDAP database from the one machine to the other, with schemas and all.

我需要复制哪些文件?我相信安装程序是非常标准的.

What files would I need to copy over? I believe the setup is pretty standard.

推荐答案

SourceRebels 的问题是不保证为ldapadd(1)/ldapmodify(1)排序数据.在手册页中:

The problem with SourceRebels answer is that slapcat(8) does not guarantee that the data is ordered for ldapadd(1)/ldapmodify(1). From the man page :


The  LDIF  generated  by this tool is suitable for use with slapadd(8).
As the entries are in database order, not superior  first  order,  they
cannot be loaded with ldapadd(1) without first being reordered.

加上使用后端文件转储数据库的工具,然后使用通过ldap协议加载ldif的工具,并不是很一致.

Plus using a tool that uses the backend files to dump the database and then using a tool that loads the ldif through the ldap protocol is not very consistent.

我建议使用slapcat(8)/slapadd(8) OR ldapsearch(1)/ldapmodify(1)的组合.我偏爱后者,因为它不需要外壳访问ldap服务器或移动文件.

I'd suggest to use a combination of slapcat(8)/slapadd(8) OR ldapsearch(1)/ldapmodify(1). My preference would go to the latter as it does not need shell access to the ldap server or moving files around.

例如,从dc = master,dc = com下的主服务器中转储数据库并将其加载到备份服务器中

For example, dump database from a master server under dc=master,dc=com and load it in a backup server


$ ldapsearch -Wx -D "cn=admin_master,dc=master,dc=com" -b "dc=master,dc=com" -H ldap://my.master.host -LLL > ldap_dump-20100525-1.ldif
$ ldapadd -Wx -D "cn=admin_backup,dc=backup,dc=com" -H ldap://my.backup.host -f ldap_dump-20100525-1.ldif

上面的-W标志提示输入ldap admin_master密码,但是由于我们将输出重定向到文件,因此您不会看到提示-只是一个空行.继续,输入您的ldap admin_master密码,它将起作用.在运行ldapadd之前,需要删除输出文件的第一行(输入LDAP密码:).

The -W flag above prompts for ldap admin_master password however since we are redirecting output to a file you wont see the prompt - just an empty line. Go ahead and type your ldap admin_master password and and it will work. First line of your output file will need to be removed (Enter LDAP Password:) before running ldapadd.

最后提示,ldapadd(1)是到ldapmodify(1)的硬链接,并且已打开-a(添加)标志.

Last hint, ldapadd(1) is a hard link to ldapmodify(1) with the -a (add) flag turned on.

这篇关于如何克隆OpenLDAP数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆