Automatic trigger to backup

Automatic trigger to backup

am 14.05.2010 07:55:48 von Vinay Sarvana

--000e0cd138e0df61790486878614
Content-Type: text/plain; charset=ISO-8859-1

Hi. Is there any possibility for creating trigger file automatically in
postgres. Scenario is as follows :

There are some application which is having this postgres database. There are
main & backup database. Application is normally connected to first server.
If main server fails, application should connect to backup server. This is
PITR environment where WAL files are transferring from the main to backup.

Manually we are creating the trigger file for that application to connect to
backup database which will be master. Then we need to make previous master
as slave.

I need to know the automatic creation of trigger file....?

Vinay

--000e0cd138e0df61790486878614
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi. Is there any possibility for creating trigger file automatically in pos=
tgres. Scenario is as follows :

There are some application which is =
having this postgres database. There are main & backup database. Applic=
ation is normally connected to first server. If main server fails, applicat=
ion should connect to backup server. This is PITR environment where WAL fil=
es are transferring from the main to backup.


Manually we are creating the trigger file for that application to conne=
ct to backup database which will be master. Then we need to make previous m=
aster as slave.

I need to know the automatic creation of trigger fil=
e....?


Vinay


--000e0cd138e0df61790486878614--

Re: Automatic trigger to backup

am 14.05.2010 12:28:46 von Scott Mead

--0015174763d21b6d9b04868b578d
Content-Type: text/plain; charset=ISO-8859-1

On Fri, May 14, 2010 at 1:55 AM, Vinay Sarvana wrote:

> Hi. Is there any possibility for creating trigger file automatically in
> postgres. Scenario is as follows :
>
> There are some application which is having this postgres database. There
> are main & backup database. Application is normally connected to first
> server. If main server fails, application should connect to backup server.
> This is PITR environment where WAL files are transferring from the main to
> backup.
>
> Manually we are creating the trigger file for that application to connect
> to backup database which will be master. Then we need to make previous
> master as slave.
>
> I need to know the automatic creation of trigger file....?
>

The trigger file is not automatically created, you would need to do that
yourself. You could always write a script to fire from cron to check if the
master database was done, but be careful, if your network cable comes
unplugged, you may end up triggering a failover event that you don't need
to. Just make sure that your master server is resilient and that whatever
script you write doesn't create the trigger file until after having done
multiple connection attempts.

--Scott



>
> Vinay
>

--0015174763d21b6d9b04868b578d
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable


On Fri, May 14, 2010 at 1:55 AM, Vinay Sarva=
na <vinay.dho=
om@gmail.com
>
wrote:
le=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi. Is there any possibility for creating trigger file automatically in pos=
tgres. Scenario is as follows :

There are some application which is =
having this postgres database. There are main & backup database. Applic=
ation is normally connected to first server. If main server fails, applicat=
ion should connect to backup server. This is PITR environment where WAL fil=
es are transferring from the main to backup.



Manually we are creating the trigger file for that application to conne=
ct to backup database which will be master. Then we need to make previous m=
aster as slave.

I need to know the automatic creation of trigger fil=
e....?


The trigger file is not automatically crea=
ted, you would need to do that yourself. =A0You could always write a script=
to fire from cron to check if the master database was done, but be careful=
, if your network cable comes unplugged, you may end up triggering a failov=
er event that you don't need to. =A0Just make sure that your master ser=
ver is=A0resilient=A0and that whatever script you write doesn't create =
the trigger file until after having done multiple connection attempts. >

--Scott

=A0
lass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;=
padding-left:1ex;">

Vinay




--0015174763d21b6d9b04868b578d--