<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>per
<a class="moz-txt-link-freetext" href="https://doc.dovecot.org/configuration_manual/authentication/sql/">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>
</body>
</html>