Re: [ClusterLabs] I want to have some resource monitored and based on that make an acton. Is it possible?

2020-03-10 Thread Roman Hershkovich
Yes.
I have only 1 APP active at same time, and so I want this app to be
restarted whenever DB changes. Another one is a "standby" APP, where all
resources are shut.
So i thought about adding some "service" script, which will probe a DB ,
and in case if it finds a CHANGE - will trigger pcs to reload a set of
resources, where one of resource would be a systemctl file, which will
continue to run a script, so in case of next change of DB - it will restart
APP set again. Is it sounds reasonable? (i don't care of errors. I mean - i
do, i want to log, but i'm ok to see them)

In addition - i thought maybe bringing PAF here could be useful - but this
is even more complex ...

On Tue, Mar 10, 2020 at 10:28 PM Ken Gaillot  wrote:

> On Tue, 2020-03-10 at 21:03 +0200, Roman Hershkovich wrote:
> > DB servers are not in PCS cluster. Basically you say that i need to
> > add them to PCS cluster and then start them? but in case if DB1 fails
> > - DB2 autopromoted and not required start of service again>
> >
> > Regarding colocation rule - i'm kind of missing logic how it works -
> > how i can "colocate" 1 of 2 APP servers to be around a master DB ?
>
> If I understand correctly, what you want is that both apps are
> restarted if the master changes?
>
> I'm thinking you'll need a custom OCF agent for the app servers. The
> monitor action, in addition to checking the app's status, could also
> check which db is master, and return an error if it's changed since the
> last monitor. (The start action would have to record the initial
> master.) Pacemaker will restart the app to recover from the error.
>
> That is a little hacky because you'll have errors in the status every
> time the master moves, but maybe that's worth knowing in your situation
> anyway.
>
> > On Tue, Mar 10, 2020 at 8:42 PM Strahil Nikolov <
> > hunter86...@yahoo.com> wrote:
> > > On March 10, 2020 7:31:27 PM GMT+02:00, Roman Hershkovich <
> > > war...@gmail.com> wrote:
> > > >I have 2 DB servers (master/slave with replica) and 2 APP servers.
> > > >2 APP servers managed by pacemaker  (active/passive) , but i want
> > > also
> > > >to
> > > >monitor "which DB is master".  I can't use VIP (which could be
> > > sticked
> > > >on
> > > >master DB) - it is very limited virtual environment.
> > > >
> > > >Is it possible to create a rule or some other scenario, so in case
> > > if
> > > >master moved - pacemaker will restart APP (app does not support
> > > >failover) ?
> > >
> > > Hi Roman,
> > >
> > > If you set an order rule that  starts  first the master  and then
> > > the app, during a failover  the app will be stoped  and once the
> > > master  is switched  (slave is promoted) the  app will be started
> > > again.
> > >
> > > Also you can consider  a  colocation rule that all  apps are
> > > started  where  the master  DB is running  -  so the lattency will
> > > be minimal.
> > >
> > > Best Regards,
> > > Strahil Nikolov
> >
> > ___
> > Manage your subscription:
> > https://lists.clusterlabs.org/mailman/listinfo/users
> >
> > ClusterLabs home: https://www.clusterlabs.org/
> --
> Ken Gaillot 
>
> ___
> Manage your subscription:
> https://lists.clusterlabs.org/mailman/listinfo/users
>
> ClusterLabs home: https://www.clusterlabs.org/
>
___
Manage your subscription:
https://lists.clusterlabs.org/mailman/listinfo/users

ClusterLabs home: https://www.clusterlabs.org/


Re: [ClusterLabs] I want to have some resource monitored and based on that make an acton. Is it possible?

2020-03-10 Thread Ken Gaillot
On Tue, 2020-03-10 at 21:03 +0200, Roman Hershkovich wrote:
> DB servers are not in PCS cluster. Basically you say that i need to
> add them to PCS cluster and then start them? but in case if DB1 fails
> - DB2 autopromoted and not required start of service again>
> 
> Regarding colocation rule - i'm kind of missing logic how it works -
> how i can "colocate" 1 of 2 APP servers to be around a master DB ? 

If I understand correctly, what you want is that both apps are
restarted if the master changes?

I'm thinking you'll need a custom OCF agent for the app servers. The
monitor action, in addition to checking the app's status, could also
check which db is master, and return an error if it's changed since the
last monitor. (The start action would have to record the initial
master.) Pacemaker will restart the app to recover from the error.

That is a little hacky because you'll have errors in the status every
time the master moves, but maybe that's worth knowing in your situation
anyway.

> On Tue, Mar 10, 2020 at 8:42 PM Strahil Nikolov <
> hunter86...@yahoo.com> wrote:
> > On March 10, 2020 7:31:27 PM GMT+02:00, Roman Hershkovich <
> > war...@gmail.com> wrote:
> > >I have 2 DB servers (master/slave with replica) and 2 APP servers.
> > >2 APP servers managed by pacemaker  (active/passive) , but i want
> > also
> > >to
> > >monitor "which DB is master".  I can't use VIP (which could be
> > sticked
> > >on
> > >master DB) - it is very limited virtual environment.
> > >
> > >Is it possible to create a rule or some other scenario, so in case
> > if
> > >master moved - pacemaker will restart APP (app does not support
> > >failover) ?
> > 
> > Hi Roman,
> > 
> > If you set an order rule that  starts  first the master  and then
> > the app, during a failover  the app will be stoped  and once the
> > master  is switched  (slave is promoted) the  app will be started
> > again.
> > 
> > Also you can consider  a  colocation rule that all  apps are 
> > started  where  the master  DB is running  -  so the lattency will
> > be minimal.
> > 
> > Best Regards,
> > Strahil Nikolov
> 
> ___
> Manage your subscription:
> https://lists.clusterlabs.org/mailman/listinfo/users
> 
> ClusterLabs home: https://www.clusterlabs.org/
-- 
Ken Gaillot 

___
Manage your subscription:
https://lists.clusterlabs.org/mailman/listinfo/users

ClusterLabs home: https://www.clusterlabs.org/


Re: [ClusterLabs] I want to have some resource monitored and based on that make an acton. Is it possible?

2020-03-10 Thread Roman Hershkovich
DB servers are not in PCS cluster. Basically you say that i need to add
them to PCS cluster and then start them? but in case if DB1 fails - DB2
autopromoted and not required start of service again>

Regarding colocation rule - i'm kind of missing logic how it works - how i
can "colocate" 1 of 2 APP servers to be around a master DB ?

On Tue, Mar 10, 2020 at 8:42 PM Strahil Nikolov 
wrote:

> On March 10, 2020 7:31:27 PM GMT+02:00, Roman Hershkovich <
> war...@gmail.com> wrote:
> >I have 2 DB servers (master/slave with replica) and 2 APP servers.
> >2 APP servers managed by pacemaker  (active/passive) , but i want also
> >to
> >monitor "which DB is master".  I can't use VIP (which could be sticked
> >on
> >master DB) - it is very limited virtual environment.
> >
> >Is it possible to create a rule or some other scenario, so in case if
> >master moved - pacemaker will restart APP (app does not support
> >failover) ?
>
> Hi Roman,
>
> If you set an order rule that  starts  first the master  and then the app,
> during a failover  the app will be stoped  and once the master  is
> switched  (slave is promoted) the  app will be started again.
>
> Also you can consider  a  colocation rule that all  apps are  started
> where  the master  DB is running  -  so the lattency will be minimal.
>
> Best Regards,
> Strahil Nikolov
>
___
Manage your subscription:
https://lists.clusterlabs.org/mailman/listinfo/users

ClusterLabs home: https://www.clusterlabs.org/


[ClusterLabs] Coming in Pacemaker 2.0.4: dependency on monotonic clock for systemd resources

2020-03-10 Thread Ken Gaillot
Hi all,

This is not a big deal but I wanted to give a heads-up for anyone who
builds their own pacemaker packages.

With Pacemaker 2.0.4 (first release candidate expected next month), we
are finally replacing our calls to the long-deprecated ftime() system
call with the "modern" clock_gettime().

As part of this, building pacemaker with support for systemd-class
resources will now require that the underlying platform supports
clock_gettime() with CLOCK_MONOTONIC. Every platform we're aware of
that is used for pacemaker does, so this should not be an issue. The
configure script will automatically determine whether support is
available.
-- 
Ken Gaillot 

___
Manage your subscription:
https://lists.clusterlabs.org/mailman/listinfo/users

ClusterLabs home: https://www.clusterlabs.org/


[ClusterLabs] I want to have some resource monitored and based on that make an acton. Is it possible?

2020-03-10 Thread Roman Hershkovich
I have 2 DB servers (master/slave with replica) and 2 APP servers.
2 APP servers managed by pacemaker  (active/passive) , but i want also to
monitor "which DB is master".  I can't use VIP (which could be sticked on
master DB) - it is very limited virtual environment.

Is it possible to create a rule or some other scenario, so in case if
master moved - pacemaker will restart APP (app does not support failover) ?
___
Manage your subscription:
https://lists.clusterlabs.org/mailman/listinfo/users

ClusterLabs home: https://www.clusterlabs.org/


[ClusterLabs] PostgreSQL Automatic Failover (PAF) v2.3.0

2020-03-10 Thread Jehan-Guillaume de Rorthais
PostgreSQL Automatic Failover (PAF) v2.3.0 has been released on March
9th 2020 under the PostgreSQL licence.

See: https://github.com/ClusterLabs/PAF/releases/tag/v2.3.0

Four years and a week after the first public release back in March 2016!

PAF is a PostgreSQL resource agent for Pacemaker. Its original aim is to
keep PostgreSQL and Pacemaker administration clear, to keep things simple,
very documented and powerful.

Pacemaker is the industry reference for High Availability with Linux. It allows
various HA architectures and can handle various services, with dependencies and
much more!

This release of PAF features:

  * the support PostgreSQL 12
  * Debian package use /var/run/postgres as pghost default value
  * few minor fixes
  * setting "recovery_template" is now forbidden with PostgreSQL 12!

Source code, releases, packages documentation, procedures and support are
available on github:

  * home: http://clusterlabs.github.io/PAF/
  * docs: https://clusterlabs.github.io/PAF/documentation.html
  * source: https://github.com/ClusterLabs/PAF
  * releases: https://github.com/ClusterLabs/PAF/releases
  * issues: https://github.com/clusterlabs/PAF/issues

Packages will be updated on PGDG repos soon.

Please, use github issues, pgsql-gene...@postgresql.org or
users@clusterlabs.org mailing lists if you have questions.

Any feedback is welcomed.

Regards,
-- 
Jehan-Guillaume de Rorthais
Dalibo
___
Manage your subscription:
https://lists.clusterlabs.org/mailman/listinfo/users

ClusterLabs home: https://www.clusterlabs.org/