RHEL6 OPENLDAP SYNCREL

注意:做这个时最好按照步骤来,否则很容易出错

1‘在用ldapsearch可以搜到以后将slapd关掉
  /etc/init.d/slapd stop

2'vim /etc/openldap/slapd.conf
  ......
  ......
  # moduleload unique.la
  # moduleload valsort.la

  moduleload syncprov.la

  # The next three lines allow use of TLS for encrypting connections using a
  # dummy test certificate which you can generate by changing to
  # /etc/pki/tls/certs, running "make slapd.pem", and fixing permissions on
  ......
  ......
  ......
  #     bindmethod=sasl saslmech=GSSAPI
  #     authcId=host/[email protected]

  overlay syncprov
  syncprov-checkpoint 100 10
  syncprov-sessionlog 100

  # enable monitoring
  这样主机配置好了,但这时还不要启动服务
3‘在用作备份的机子上
  vim /etc/openldap/slpad.conf
  ......
  ......
  ......
  # Replicas of this database
  #replogfile /var/lib/ldap/openldap-master-replog
  #replica host=ldap-1.example.com:389 starttls=critical
  #     bindmethod=sasl saslmech=GSSAPI
  #     authcId=host/[email protected]

  syncrepl rid=001
      provider=ldap://192.168.0.89:389
      type=refreshAndPersist
      searchbase="dc=extmail.org"
      attrs=*
      schemachecking=off
      bindmethod=simple
      binddn="cn=Manager,dc=extmail.org"
      credentials="westos"
      retry="60 +"

  # enable monitoring
4'在主机上
  cd /var/lib/ldap/
  scp * backup_host_IP:/var/lib/ldap/

5'在backup机子上
  cd /var/lib/ldap/
  chown ldap.ldap *

6'先启动主机上的服务,再启动backup机子上的服务,这样配置完成,两台机子上的ldap服务就同步了。                                     

你可能感兴趣的:(LDAP)