Redhat 5 on-OpenLDAP installation backup and recovery

Source: Internet
Author: User
Tags ldap openldap

1. Install 1.1. Installation Environment

To view the current operating system version:

[Email protected] ~]# cat/etc/5.3 (Tikanga)

1.2. InstallationOpenLDAP-* Bag

Installing the openldap package with the yum source

[email protected] yum.repos.d]# yum install openldap-*-y

1.3. EstablishLDAPstorage directory for dataand set permissions
[[email protected] ~]# cd/opt/app[[email protected]-app app] mkdir ldap[[email protected]-app app]# CH Own Ldap:ldap ldap/[[email protected]777 ldap/

1.4. Set the password and modify the configuration file

To obtain an encrypted password:

1234567 {SSHA}XHTIFVF/xgrikjjqszf1pjzhxsjsfwtx

To modify a configuration file:

Modified or added entries:

RootDN          "cn=admin,dc=travelsky,dc=com"rootpw          secretrootpw          {Ssha} XHTIFVF/xgrikjjqszf1pjzhxsjsfwtxdirectory       /opt/app/ldap

1.5. StartLDAPService
[[email protected] ldap]#/ETC/INIT.D/LDAP start

2. Backup and Recovery 2.1. Backup

Using slapcat for backup

[Email protected] backup]#/usr/sbin/slapcat-v-l/opt/app/backup/ldap/20150311. ldif

Script ldap_backup.sh for backup

#!/bin/bashfilename=ldap$ (date +%y%m%d). ldifbackdir=/opt/app/backup/ldap/usr/sbin/slapcat-v-L $BACKDIR/$ FILENAMEgzip-9 $BACKDIR/$FILENAME

2.2. Data recovery

Close the LDAP service

[[email protected] ~]#/etc/init.d/ldap stop

Delete existing data

[Email protected] ldap]# cd/opt/app/ldap[[email protected]-app ldap]# RM-RF  *

Restore db_config files

[email protected]app ldap]# locate db_config/etc/openldap/db_config.example[[emailprotected]- App ldap]# Cp/etc/openldap/db_config.example/opt/app/ldap/db_config

Restore data and its permissions

[Email protected] ldap]#/usr/sbin/slapadd-l/opt/app/backup/ldap/20150311. Ldif[[email protected]   /opt/app/ldap[[email protected]-app ldap]# chown-r ldap:ldap/opt/app/ldap

Start the LDAP service

[[email protected] ldap]#/ETC/INIT.D/LDAP start

Redhat 5 on-OpenLDAP installation backup and recovery

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.