歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> ldap主從同步

ldap主從同步

日期:2017/3/1 12:21:09   编辑:關於Linux
一、安裝ldap從服務器 安裝步驟同ldap主服務器相同 主從同步配置 Ldap主服務器 導出原用戶,格式為ldif,並將其傳輸到ldap從服務器 # ldapsearch -x -H ldap://127.0.0.1 -b 'dc=taobao,dc=com' > wdd.ldif # yum -y install openssh-clients # scp wdd.ldif 192.168.131.140:/root ldap從服務器 # ldapadd -x -D "cn=admin,dc=taobao,dc=com" -W -f /root/wdd.ldif 停止ldap主服務器,修改配置文件 # service slapd stop # vim /etc/openldap/slapd.conf replica host=192.168.131.140:389 binddn="cn=admin,dc=taobao,dc=com" bindmethod=simple credentials=123456 #密碼 replogfile /var/lib/ldap/openldap-master-replog # chown -R ldap:ldap /var/lib/ldap/ 從服務器,修改其配置文件 # vim /etc/openldap/slapd.conf updatedn "cn=admin,dc=taobao,dc=com" updateref ldap://192.168.131.138:389 #ldap主服務器地址 # /etc/init.d/slapd restart 啟動ldap主服務器 # /etc/init.d/slapd start 查看ldap用戶 Ldap主服務器操作 #ldapsearch -LLL -x -H ldap://192.168.131.138 -b 'dc=taobao,dc=com'| grep uid= #ldapsearch -LLL -x -H ldap://192.168.131.140 -b 'dc=taobao,dc=com'| grep uid= 刪除ldapuser1用戶 #ldapdelete -x -D "cn=admin,dc=taobao,dc=com" -W "uid=ldapuser1,ou=People,dc=taobao,dc=com" 再次進行查詢ldap主服務器 #ldapsearch -LLL -x -H ldap://192.168.131.138 -b 'dc=taobao,dc=com'| grep uid= 再次查詢ldap從服務器,發現ldapuser1用戶也沒有了 #ldapsearch -LLL -x -H ldap://192.168.131.140 -b 'dc=taobao,dc=com'| grep uid=

Copyright © Linux教程網 All Rights Reserved