Yes, that looks nice, I am going to try that too. Because every other option is based on some other software, like relayd or nginx, it is all possible, but adds complexity. The best would be to have it inside connection string. On Sun, 2023-02-19 at 17:34 +0000, David White wrote:> Take a look at > https://www.citusdata.com/blog/2021/02/12/reconnecting-your-app-after-a-postgres-failover/ > . Perhaps that's what you're looking for, namely, the section on > "Multi-Hosts Connection Strings, thanks to libpq"-- Lars Schotte Mudro?ova 13 92101 Pie??any
Lars Schotte skrev den 2023-02-21 18:04:> Yes, that looks nice, I am going to try that too.+1> Because every other option is based on some other software, > like relayd or nginx, it is all possible, but adds complexity.+1> The best would be to have it inside connection string.real fix or even possible is to add failback host=, eg host=localhost failbackfrom=dbi:/path-to-sqlite3 file, with is just cache from postgresql, then postgres can be down, if cache holds the wather all this imho needs code changes, the cache must not be write cache, only read cache that means it cant work for dict unless dict is sqlite aswell
On 2/21/23 18:04, Lars Schotte wrote:> Yes, that looks nice, I am going to try that too. > > Because every other option is based on some other software, > like relayd or nginx, it is all possible, but adds complexity. > > The best would be to have it inside connection string./etc/dovecot/dovecot-sql.conf.ext: ... connect= host=host1 host=host2 dbname=<db> user=<user> password=<pwd> I'm using that since pretty much 2006 - if I'm not mistaken - on my little servers. Simply works. If one server is not reachable you just get an error log entry in mail.err that connect failed to the database that is down. But that is all - dovecot keeps working as normal. BTW: Same with postfix. Simply list an additional fallback and it just works. Best, Marcus