[ClusterLabs] Insert delay between the statup of VirtualDomain

Dejan Muhamedagic dejanmm at fastmail.fm
Wed Mar 1 07:08:07 EST 2017


Hi,

On Sat, Feb 25, 2017 at 09:58:01PM +0100, Oscar Segarra wrote:
> Hi,
> 
> Yes,
> 
> Database server can be considered started up when it accepts mysql client
> connections
> Applications server can be considered started as soon as the listening port
> is up al accepting connections
> 
> ¿Can you provide any example about how to achieve this?

Is it possible to connect to the database from the supervisor?
Then something like this would do:

mysql -h vm_ip_address ... < /dev/null

If not, then if ssh works:

echo mysql ... | ssh vm_ip_address

I'm afraid I cannot help you more with mysql details and what to
put in '...' stead above, but it should do whatever is necessary
to test if the database reached the functional state. You can
find an example in ocf:heartbeat:mysql: just look for the
"test_table" parameter. Of course, you'll need to put that in a
script and test output and so on. I guess that there's enough
information in internet on how to do that.

Good luck!

Dejan

> Thanks a lot.
> 
> 
> 2017-02-25 19:35 GMT+01:00 Dejan Muhamedagic <dejanmm at fastmail.fm>:
> 
> > Hi,
> >
> > On Thu, Feb 23, 2017 at 08:51:20PM +0100, Oscar Segarra wrote:
> > > Hi,
> > >
> > > In my environment I have 5 guestes that have to be started up in a
> > > specified order starting for the MySQL database server.
> > >
> > > I have set the order constraints and VirtualDomains start in the right
> > > order but, the problem I have, is that the second host starts up faster
> > > than the database server and therefore applications running on the second
> > > host raise errors due to database connectivity problems.
> > >
> > > I'd like to introduce a delay between the startup of the VirtualDomain of
> > > the database server and the startup of the second guest.
> >
> > Do you have a way to check if this server is up? If so...
> > The start action of VirtualDomain won't exit until the monitor
> > action returns success. And there's a parameter called
> > monitor_scripts (see the meta-data). Note that these programs
> > (scripts) are run at the supervisor host and not in the guest.
> > It's all a bit involved, but should be doable.
> >
> > Thanks,
> >
> > Dejan
> >
> > > ¿Is it any way to get this?
> > >
> > > Thanks a lot.
> >
> > > _______________________________________________
> > > Users mailing list: Users at clusterlabs.org
> > > http://lists.clusterlabs.org/mailman/listinfo/users
> > >
> > > Project Home: http://www.clusterlabs.org
> > > Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> > > Bugs: http://bugs.clusterlabs.org
> >
> >
> > _______________________________________________
> > Users mailing list: Users at clusterlabs.org
> > http://lists.clusterlabs.org/mailman/listinfo/users
> >
> > Project Home: http://www.clusterlabs.org
> > Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> > Bugs: http://bugs.clusterlabs.org
> >

> _______________________________________________
> Users mailing list: Users at clusterlabs.org
> http://lists.clusterlabs.org/mailman/listinfo/users
> 
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org





More information about the Users mailing list