natan: > Wietse: > Thanks for repley, but in docu mysql_table manpage > > hosts = 10.10.10.1, 10.10.10.2 > > is not simle HA but "roundrobin" style
It is not round-robin. >From the mysql_table manpage: The hosts are tried in random order, with all connections over UNIX domain sockets being tried before those over TCP. The connections are automatically closed after being idle for about 1 minute, and are re-opened as necessary. Postfix versions 2.0 and earlier do not randomize the host order. The code is in function dict_mysql_find_host(). It uses random selection, and avoids a server that was unavailable recently. This strategy is stateful (it avoids talking to a server that was unavailable recently), a strategy that works when a Postfix process makes multiple queries during its lifetime. So this is another reason to use proxy:mysql: instead of mysql:. Wietse > > W dniu 26.11.2021 o?13:43, Wietse Venema pisze: > > natan: > > [ text/html is unsupported, treating like TEXT/PLAIN ] > sorry > > > >> Hi > >> Is it possible to use two hosts entries in the map in case of failure of > >> the first one, the second server will be asked > >> > >> I know I can use haproxy but is there anything simpler? > >> > >> Ile: > >> # virtual_domain_maps.cf > >> user = postfix > >> password = $password > >> dbname = postfix > >> hosts = 10.10.10.1 > >> hosts = 10.10.10.2 > > hosts = 10.10.10.1, 10.10.10.2 > > > > As documented in the mysql_table manpage. > > > >> query = SELECT domain FROM vmail WHERE ..... > > Wietse > > -- > >