{"id":6848,"date":"2017-07-06T07:20:37","date_gmt":"2017-07-05T23:20:37","guid":{"rendered":"http:\/\/rmohan.com\/?p=6848"},"modified":"2017-07-06T07:20:37","modified_gmt":"2017-07-05T23:20:37","slug":"openldap-dual-main-structures","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=6848","title":{"rendered":"OpenLDAP dual main structures"},"content":{"rendered":"<p><strong>OpenLDAP dual main structures<\/strong><\/p>\n<p>LDAP as a more critical service, a single point is certainly a problem, in addition to the general master and slave, the better choice is the double main, that is, there are two ldap server, and real-time synchronization, and then in front of the load balancing call. One of which hung up, load balancing automatically kicked off, does not affect the use of the entire service. This is the purpose of configuring the dual master. Of course, as a read more write less services, master and slave is also very good ~<\/p>\n<p>Because the new configuration file directory structure and the previous a bit different, stepped on a lot of pit to understand its inherent logic. A valid configuration file is placed in the `\/ etc \/ openldap \/ slapd.d \/` directory, and if there are different new configurations, the configuration files for this directory will be added. So the management of this directory or a certain degree of difficulty. So openldap provides a clever way. We still configure the familiar `slapd.conf` file, and then through the command it` slapd.conf` converted to `slapd.d` directory structure. This thing was studied for two days to understand. The The<\/p>\n<p>Not much to say, start configuring dual master Yum installed, by default `\/etc\/openldap\/` directory is not `slapd.conf` file, but can be copied from other places.<\/p>\n<p>`Cp \/usr\/share\/openldap-servers\/slapd.conf.obsolete \/ etc \/ openldap \/ slapd.conf`<br \/>\nThen modify this configuration file, the following shows only the modified place`<br \/>\n&#8220;<br \/>\nvim \/etc\/openldap\/slapd.conf<\/p>\n<p>Modulepath \/usr\/lib\/openldap # Remove the previous pound can<br \/>\nmodulepath \/usr\/lib64\/openldap # ibid<br \/>\nmoduleload syncprov.ld # module is used to achieve the master and slave and dual master ~<\/p>\n<p>&nbsp;<\/p>\n<p>Index entryCSN, entryUUID eq<br \/>\n&#8220; `<br \/>\ntwo servers above the same configuration, behind the configuration a little difference.<br \/>\nServer a:<br \/>\n&#8220; `<br \/>\nserverID 2 # double live ID to be different &#8230;<br \/>\noverlay syncprov<br \/>\nsyncrepl rid = 001 # this id two to be consistent<br \/>\nprovider = ldap: \/ \/ ip_address # server ip ip address<br \/>\ntype = refreshAndPersist<br \/>\nsearchbase =&#8221; dc = Xxx, dc = com &#8220;# # set up from the root search<br \/>\nschemachecking = off<br \/>\nbindmethod = simple<br \/>\nbinddn =&#8221; cn = admin, dc = xxx, dc = com &#8220;# this user to exist yo, here with the management user<br \/>\ncredentials = 1234 # Do not know is to manage the user password, or synchronization password, so it is written to manage the user password. Retry<br \/>\n= &#8220;60 +&#8221;<br \/>\nmirrormode on<br \/>\n&#8220; `<\/p>\n<p>&nbsp;<\/p>\n<p>Server b:<br \/>\n&#8220; `<br \/>\nserverID 1<br \/>\nsyncrepl rid = 001 # this id two to be consistent<br \/>\nprovider = ldap: \/\/ ip_address # server ip address<br \/>\ntype = refreshAndPersist<br \/>\nsearchbase =&#8221; dc = xxx, dc = com &#8220;# set from the root Start to search<br \/>\nschemachecking = off<br \/>\nbindmethod = simple<br \/>\nbinddn = &#8220;cn = admin, dc = xxx, dc = com&#8221; # this user to exist yo, here with the management of user<br \/>\ncredentials = 1234 # do not know is to manage user passwords, or synchronous Password, so it is written to manage the user password. Retry<br \/>\n= &#8220;60 +&#8221;<br \/>\nmirrormode on<br \/>\n&#8220; `<\/p>\n<p>&nbsp;<\/p>\n<p>The basic configuration and settings are completed, the next is the slap.conf generated sladp.d directory.<br \/>\n1, delete the contents of the slapd.d directory<br \/>\n`rm -rf \/etc\/openldap\/slapd.d\/ *`<br \/>\n2, generate directory friends ~<br \/>\n`slaptest -f \/etc\/openldap\/slapd.conf -F \/etc\/ openldap\/slapd.d`<br \/>\nTip `config file testing succeeded` it indicates success ~<br \/>\n3, the newly generated file permissions to modify<br \/>\n` &#8220;<br \/>\nchown -R &amp; lt ldap:ldap \/etc\/OpenLDAP<br \/>\nchown -R &amp; lt ldap:ldap \/var\/lib\/LDAP<br \/>\n&#8220; `<br \/>\n4, restart slapd`<br \/>\nservice slapd restart`<\/p>\n","protected":false},"excerpt":{"rendered":"<p>OpenLDAP dual main structures<\/p>\n<p>LDAP as a more critical service, a single point is certainly a problem, in addition to the general master and slave, the better choice is the double main, that is, there are two ldap server, and real-time synchronization, and then in front of the load balancing call. One of which hung [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[59],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6848"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6848"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6848\/revisions"}],"predecessor-version":[{"id":6849,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6848\/revisions\/6849"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6848"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6848"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6848"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}