Re: Master-slave failover question

Поиск
Список
Период
Сортировка
От Sameer Kumar
Тема Re: Master-slave failover question
Дата
Msg-id CADp-Sm6bkkGZpc_db5zPm0CW5EGGpqFoyvGe+1dNY=fuE3U3OA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Master-slave failover question  ("Athanasios | ZenGuard" <athanasios@zenguard.org>)
Ответы Re: Master-slave failover question  ("gurunadh.venkata@gmail.com" <gurunadh.venkata@gmail.com>)
Список pgsql-novice


On Sat, Jan 4, 2014 at 12:03 AM, Athanasios | ZenGuard <athanasios@zenguard.org> wrote:
Hi Sameer,
thank you for the quick reply (again!). I am not using pgpool admin so is it possible to share the shell script that does the rebuilding? 

For failover detection and failover the script should be as simple as:

        Check the failing node
               if failing_node=primary_node
                    create trigger file on secondary;
               end if;
               
               if failing_node=secondary_node
                     set synchornous replication off;
              end if;



The logic for rebuilding was simple (if I remember it correctly):

              node_to_rebuild=node_2;
              active_node=node_1;              

              node_to_rebuild=$1;    //pass this as a parameter

              if node_1=node_to_rebuild
                   then active_node=node_2;     
             end if;
               
              copy data directory from active_node to node_to_rebuild;
              start postgresql on node_to_rebuild;
              use ppc_attach_node to attach newly created node;

You need to use ssh (remote command execution) for some of these commands and make sure that ssh can login without password prompt to both the nodes. If you are going to use pgpool in HA mode, then keep a copy of this rebuilding script on each node so that you can rebuild any node from any node. 

With pgpoolAdmin the process must be much more simpler, but I could never get it installed. :-(


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

Предыдущее
От: Jayadevan
Дата:
Сообщение: Re: Master-slave failover question
Следующее
От: Sameer Kumar
Дата:
Сообщение: Re: Master-slave failover question