Re: database aliasing options ?

Поиск
Список
Период
Сортировка
От Peter J. Holzer
Тема Re: database aliasing options ?
Дата
Msg-id 20201111143323.GA9849@hjp.at
обсуждение исходный текст
Ответ на Re: database aliasing options ?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On 2020-11-09 10:49:52 -0500, Tom Lane wrote:
> David Gauthier <davegauthierpg@gmail.com> writes:
> > Our IT dept has configured our PG DB as a "High Availability" database.  It
> > has a primary and backup server (disks too).  Normally both are running but
> > if one goes down, the other is still available for use, effectively keeping
> > the DB up while the failed server is being repaired.
>
> > My question has to do with creating and using a DB alias for DB connection
> > code. Of course the idea would be to toggle which server the alias is
> > pointing to based on the state of the servers.  The idea is to manage which
> > server is being used OUTSIDE of the DB connection code by changing the
> > alias. The code always uses the alias.
>
> Some people do this by changing the DNS entry for the server.

Another common method is to have a "floating" ip-address. That address
is always bound to the interface on the active node, so clients
can just connect to that address and don't need to care which node it
represents. Cluster resource managers like Pacemaker usually support
this. For Patroni there is a handy little tool called vip-manager.

Compared to DNS this has the advantage that latency is usually shorter.

        hp

--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Peter Coppens
Дата:
Сообщение: Re: Execution plan does not use index
Следующее
От: Michael Lewis
Дата:
Сообщение: Re: Execution plan does not use index