<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><br>
      I prefer to use a 2 db approach where I specify 2 different
      Database servers as opposed to HAproxy. <br>
    </p>
    <p><br>
    </p>
    <p>I see on: <a class="moz-txt-link-freetext"
        href="http://url7179.mylinuxguy.net/ls/click?upn=qw3mUGlvypxOIEjnzoVznczKsajdyZbXY6uGLmuK5J6I8VjNhJjPybLy8wVGpS-2Bj0XbXGjmYqz5kJ-2FqxxfqOlD5-2FM5yJRqhCXliHjUJoMpE-3DMNyy_HoH8w59qZ-2Bj-2BbJehmds8moczgghS3-2F0vIoq8mKxnoqHFUA-2FKFd9jq4TgdfEmAU-2FSfjID7QHWF6Gqibhb0rQKF3p8I26-2B1DayauufxyEmyqLaEbo4WSXRaHsfKdgqWJmJk65DWMJgrB3GPL1lp4vyXJF0Gz58RhdIvKWUK-2BIEbMxZoNw-2BOnlQrjOKrodIDuQqSBj5ZC6gR1ZyzgoJWfZpWQ-3D-3D">https://doc.dovecot.org/configuration_manual/authentication/sql</a>
      where it says: <br>
    </p>
    <p><b>You can add multiple host parameters to the SQL connect
        string. Dovecot will do round robin load balancing between them.
        If one of them goes down, the others will handle the traffic.</b><br>
      <br>
      it would be really nice if that was expanded opon in the docs....
      I am not sure WHO to ask that that be clarified. <br>
    </p>
    <p>I currently have: <br>
    </p>
    <p>connect = "host=<dbserver> dbname=<dbname>
      user=<dbuser> password=<dbpass>"</p>
    <p>... would I use: <br>
    </p>
    <p>connect = "host=<dbserver> dbname=<dbname>
      user=<dbuser> password=<dbpass> host=<dbserver2>
      dbname=<dbname2> user=<dbuser2>
      password=<dbpass2>" <br>
    </p>
    <p>and the system would just see host/host, dbname/dbname user/user
      password/password and automatically map the correct
      dbname/user/password to the correct host or it is assumed that the
      2nd host is the only thing that changes and the
      dbname/user/password are the same? or do I use: <br>
    </p>
    <p>connect = "host=<dbserver> dbname=<dbname>
      user=<dbuser> password=<dbpass> host2=<dbserver>
      dbname2=<dbname> user2=<dbuser>
      password2=<dbpass>" <br>
    </p>
    <p>to specify the host and host2 info?  <br>
    </p>
    <p><br>
    </p>
    <p>"You can add multiple host parameters to the SQL connect string."
      is a bit lacking in info when you think about the possibility of
      having a different user/pass or dbname for the 2nd host instance.
      <br>
      <br>
      I am going to play around with this on my production box... but
      having a bit more info in the docs would be preferred. <br>
    </p>
    <p><br>
    </p>
    <p>- jack <br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 8/30/22 07:57 AM, Brendan Kearney
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:ed259a7f-4e6a-a198-d8c0-6a813e34503b@gmail.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <p>per <a class="moz-txt-link-freetext"
          href="http://url7179.mylinuxguy.net/ls/click?upn=qw3mUGlvypxOIEjnzoVznczKsajdyZbXY6uGLmuK5J6I8VjNhJjPybLy8wVGpS-2Bj0XbXGjmYqz5kJ-2FqxxfqOlD5-2FM5yJRqhCXliHjUJoMpE-3DqxNi_HoH8w59qZ-2Bj-2BbJehmds8moczgghS3-2F0vIoq8mKxnoqHFUA-2FKFd9jq4TgdfEmAU-2FSCUSDGdWndv8TKkkz7AjxUeMXUVci6hyguniTZ6oXA5ZENGa1TBfZdJZtyxXEmtKRu9dSGDTi8Up8YrXa8s2XHbNSOlFJvLOIuZnbocZzm9y-2FxQEnyabG6IdMTlYoYgySMTcxnfHiTA10auTUfqTMhA-3D-3D"
          moz-do-not-send="true">https://doc.dovecot.org/configuration_manual/authentication/sql/</a>,
        you can add more than one "host=" parameter in the "connect"
        directive, and leave dovecot to do round-robin load balancing. 
        there will probably be a delay in processing while a failed
        database connection attempt times out.</p>
      <p>or you can use a load balanced database footprint, using
        something like haproxy.  its not as simple as putting multiple
        databases behind haproxy and calling it done.  i use mariadb,
        which via galera, can do multi-primary HA, where all 3 primary
        instances can take write or read events.  you need to configure
        each mariadb instance with galara replication and then setup
        haproxy to properly attach to the databases and perform a
        service check.</p>
      <p>postgresql or other databases may require different mechanisms
        to achieve fault tolerant HA.<br>
      </p>
      <div class="moz-cite-prefix">On 8/30/22 4:18 AM, Sami Ketola
        wrote:<br>
      </div>
      <blockquote type="cite"
        cite="mid:701B07A6-6F15-412B-9A6A-A8B60ED9B581@ketola.io">
        <meta http-equiv="Content-Type" content="text/html;
          charset=UTF-8">
        <br class="">
        <div><br class="">
          <blockquote type="cite" class="">
            <div class="">On 30. Aug 2022, at 5.13, Jack Snodgrass <<a
                href="mailto:jack@mylinuxguy.net"
                class="moz-txt-link-freetext" moz-do-not-send="true">jack@mylinuxguy.net</a>>
              wrote:</div>
            <br class="Apple-interchange-newline">
            <div class="">
              <meta http-equiv="content-type" content="text/html;
                charset=UTF-8" class="">
              <div class="">
                <p class=""><br class="">
                </p>
                <p class="">I am using this file: <br class="">
                </p>
                <p class="">dovecot-sql.conf.ext</p>
                <p class="">and in there  I have a <br class="">
                </p>
                <p class="">connect = "host=<dbserver>
                  dbname=<dbname> user=<dbuser>
                  password=<dbpass>"</p>
                <p class=""><br class="">
                </p>
                <p class="">My <dbserver> was down and I lost mail
                  access for a few days before I realized that there was
                  an issue.  How can I specify a backup server so that
                  if my primary sql server goes down, a backup sql
                  server will be queried?<br class="">
                </p>
              </div>
            </div>
          </blockquote>
          <br class="">
        </div>
        <div>Use haproxy.</div>
        <div><br class="">
        </div>
        <div>Sami</div>
        <div><br class="">
        </div>
        <br class="">
      </blockquote>
    </blockquote>
    <div class="moz-signature"
      signature-switch-id="f495ce62-5c58-4122-b492-559481da1cf6">-- <br>
      jack - Southlake Texas - <a href="http://url7179.mylinuxguy.net/ls/click?upn=qw3mUGlvypxOIEjnzoVznaPhh1QZR9rdwcvCQ0qavLA-3DIyAc_HoH8w59qZ-2Bj-2BbJehmds8moczgghS3-2F0vIoq8mKxnoqHFUA-2FKFd9jq4TgdfEmAU-2FSPvCE3dnQhSn-2FegmN5NZgWR9fkXmZE33-2BaOO0nbsVZL-2BF1ivQm-2FD3INKxtm-2FxBzGIEjBXf9wwYabbtsZSMf7fVH6-2FIo35JbFy-2FwhO0OQ53vjaQeFDTtNVNccLC5HH144IYTzA6uSZ8NlRPzciqTMJTQ-3D-3D">mylinuxguy.net</a></div>
  <img src="http://url7179.mylinuxguy.net/wf/open?upn=z5VEdSALJ66OMcFvJent77iO1XADT3KIfhrGJ5ELrdsmYSqoVqwdHxzM8PV80kBIotmRa42uNR3RKLt1gA5dqBAvnr-2BZ7NG4fWNgIxw7ny469iEexd56hFQl2sjlAfcTZmDqYzH2iCXbSdhLZKKSWMkQRQQ7-2B52J7okPCXzTCf9VsQGhnor11HTd9JmZuXavo9UmK96yuXZNnduZ65Irv5bGFl-2Bsm5sUp86OpyxSobw-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;"/></body>
</html>