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