<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>presumably, you would have the same database parameters on
      different hosts, so only adding an additional "host=" parameter
      should suffice.  i would only add the additional parameters that
      are unique or different, and that should work.</p>
    <p>connect = "host=<dbserver1> host=<dbserver2>
      dbname=<dbname> user=<dbuser> password=<dbpass>"</p>
    <p>sorry to hear your going to test this in Prod. :(<br>
    </p>
    <div class="moz-cite-prefix">On 8/30/22 6:10 PM, Jack Snodgrass
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:8cde94a1-e4cd-8945-bf37-7c6660d59369@mylinuxguy.net">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <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-3Di253_5qhfSnrBXIaXI7rIewPfzICYfubUoDIKRg6-2F2vb7-2BoHPlQu-2FfbGVKyxQX-2F2MK4nxWkxmetPK3bISYq-2B3vMMCqg0OvFazMQP6kieDgzySn3CxXosvGvmxmnaV8gXFIELIwC0p6Z0DD1bjbNKHnx962D5GbY3WllOadyCtSiaOHgFtg3Bl1e1T2WPo2YFLuLkM-2BTim9nrs0zpBRq5fOgwlhw-3D-3D"
          moz-do-not-send="true">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-3DKmhV_5qhfSnrBXIaXI7rIewPfzICYfubUoDIKRg6-2F2vb7-2BoHPlQu-2FfbGVKyxQX-2F2MK4nxPqq-2BxqulnD7vrxF869qXLsnUwNVtKImZgjhrrc8-2BgQcto-2FlJJcOMywfxCTc2-2BxoPX7HPBMfNvES9Vhh3H7JdildFpXiixy8xTdPoXwp7cMdcphsBsaaKDR5kjS91YmrjyCMVCsJQUtzWCgnHHGTxxg-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-3DUiiX_5qhfSnrBXIaXI7rIewPfzICYfubUoDIKRg6-2F2vb7-2BoHPlQu-2FfbGVKyxQX-2F2MK4nxxMgskp-2B7lkCgnLNSC-2BkHg-2BIZivmGnYzgw6K5Dw5Rkff8q-2FIoZHz2vWzOlfXpUNTznP1U4-2FAL3aStk0Rg0h6GpRg4at3NFRAD3w1S5-2B-2BXy4ne0c-2FXuQOKNksIOpgzzBd5FuBUlJpA0KfWocho2TNHnA-3D-3D"
          moz-do-not-send="true">mylinuxguy.net</a></div>
      <img
src="http://url7179.mylinuxguy.net/wf/open?upn=ZiEb5SeeAhCemrWQom8aMeLEqs6pHrQWOtNow9foH5VidVfNivqQU5HNevJzub8CmLNk5zzMqzEiPU9HZUy6KQ9cdPn1yz-2BIOiagf-2FGeSz1QhiPBF1xS-2BK4FEJ-2BLYvYDyj3kUkz4Cz0rnH8etWpm9XYcuIrQffwCkFQkqkHVFi2To5tOoFkw15Fzj0EqxB-2FK8sUpERxrgnB1gVu0fh4Ni9VEjT8FxvEBlWoHTcM2csM-3D"
        alt="" 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;" moz-do-not-send="true"
        width="1" height="1" border="0">
    </blockquote>
  </body>
</html>