[ClusterLabs] start service after filesystemressource

2015-11-20 Thread haseningo
Hi,

I want to start several services after the drbd ressource an the filessystem is avaiable. This is my current configuration:

 

node $id="184548773" host-1 \
    attributes standby="on"
node $id="184548774" host-2 \
    attributes standby="on"
primitive collectd lsb:collectd \
    op monitor interval="10" timeout="30" \
    op start interval="0" timeout="120" \
    op stop interval="0" timeout="120"
primitive failover-ip1 ocf:heartbeat:IPaddr \
    params ip="192.168.6.6" nic="eth0:0" cidr_netmask="32" \
    op monitor interval="10s"
primitive failover-ip2 ocf:heartbeat:IPaddr \
    params ip="192.168.6.7" nic="eth0:1" cidr_netmask="32" \
    op monitor interval="10s"
primitive failover-ip3 ocf:heartbeat:IPaddr \
    params ip="192.168.6.8" nic="eth0:2" cidr_netmask="32" \
    op monitor interval="10s"
primitive res_drbd_export ocf:linbit:drbd \
    params drbd_resource="hermes"
primitive res_fs ocf:heartbeat:Filesystem \
    params device="/dev/drbd0" directory="/mnt" fstype="ext4"
group mygroup failover-ip1 failover-ip2 failover-ip3 collectd
ms ms_drbd_export res_drbd_export \
    meta notify="true" master-max="1" master-node-max="1" clone-max="2" clone-node-max="1"
location cli-prefer-collectd collectd inf: host-1
location cli-prefer-failover-ip1 failover-ip1 inf: host-1
location cli-prefer-failover-ip2 failover-ip2 inf: host-1
location cli-prefer-failover-ip3 failover-ip3 inf: host-1
location cli-prefer-res_drbd_export res_drbd_export inf: hermes-1
location cli-prefer-res_fs res_fs inf: host-1
colocation c_export_on_drbd inf: mygroup res_fs ms_drbd_export:Master
order o_drbd_before_services inf: ms_drbd_export:promote res_fs:start
property $id="cib-bootstrap-options" \
    dc-version="1.1.10-42f2063" \
    cluster-infrastructure="corosync" \
    stonith-enabled="false" \
    no-quorum-policy="ignore" \
    last-lrm-refresh="1447686090"
#vim:set syntax=pcmk

 

I don't found the right way, to order the startup of new services (example collectd), after the /mnt is mounted. Can you help me?


 

___
Users mailing list: Users@clusterlabs.org
http://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


Re: [ClusterLabs] start service after filesystemressource

2015-11-20 Thread Ken Gaillot
On 11/20/2015 07:38 AM, haseni...@gmx.de wrote:
> Hi,
> I want to start several services after the drbd ressource an the filessystem 
> is 
> avaiable. This is my current configuration:
> node $id="184548773" host-1 \
>  attributes standby="on"
> node $id="184548774" host-2 \
>  attributes standby="on"
> primitive collectd lsb:collectd \
>  op monitor interval="10" timeout="30" \
>  op start interval="0" timeout="120" \
>  op stop interval="0" timeout="120"
> primitive failover-ip1 ocf:heartbeat:IPaddr \
>  params ip="192.168.6.6" nic="eth0:0" cidr_netmask="32" \
>  op monitor interval="10s"
> primitive failover-ip2 ocf:heartbeat:IPaddr \
>  params ip="192.168.6.7" nic="eth0:1" cidr_netmask="32" \
>  op monitor interval="10s"
> primitive failover-ip3 ocf:heartbeat:IPaddr \
>  params ip="192.168.6.8" nic="eth0:2" cidr_netmask="32" \
>  op monitor interval="10s"
> primitive res_drbd_export ocf:linbit:drbd \
>  params drbd_resource="hermes"
> primitive res_fs ocf:heartbeat:Filesystem \
>  params device="/dev/drbd0" directory="/mnt" fstype="ext4"
> group mygroup failover-ip1 failover-ip2 failover-ip3 collectd
> ms ms_drbd_export res_drbd_export \
>  meta notify="true" master-max="1" master-node-max="1" clone-max="2" 
> clone-node-max="1"
> location cli-prefer-collectd collectd inf: host-1
> location cli-prefer-failover-ip1 failover-ip1 inf: host-1
> location cli-prefer-failover-ip2 failover-ip2 inf: host-1
> location cli-prefer-failover-ip3 failover-ip3 inf: host-1
> location cli-prefer-res_drbd_export res_drbd_export inf: hermes-1
> location cli-prefer-res_fs res_fs inf: host-1

A word of warning, these "cli-" constraints were added automatically
when you ran CLI commands to move resources to specific hosts. You have
to clear these when you're done with whatever the move was for,
otherwise the resources will only run on those nodes from now on.

If you're using pcs, "pcs resource clear " will do it.

> colocation c_export_on_drbd inf: mygroup res_fs ms_drbd_export:Master
> order o_drbd_before_services inf: ms_drbd_export:promote res_fs:start
> property $id="cib-bootstrap-options" \
>  dc-version="1.1.10-42f2063" \
>  cluster-infrastructure="corosync" \
>  stonith-enabled="false" \
>  no-quorum-policy="ignore" \
>  last-lrm-refresh="1447686090"
> #vim:set syntax=pcmk
> I don't found the right way, to order the startup of new services (example 
> collectd), after the /mnt is mounted. Can you help me?

As other posters mentioned, order constraints and/or groups will do
that. Exact syntax depends on what CLI tools you use, check their man
pages for details.

___
Users mailing list: Users@clusterlabs.org
http://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


Re: [ClusterLabs] start service after filesystemressource

2015-11-20 Thread Andrei Borzenkov

20.11.2015 16:38, haseni...@gmx.de пишет:

Hi,
I want to start several services after the drbd ressource an the filessystem is
avaiable. This is my current configuration:
node $id="184548773" host-1 \
  attributes standby="on"
node $id="184548774" host-2 \
  attributes standby="on"
primitive collectd lsb:collectd \
  op monitor interval="10" timeout="30" \
  op start interval="0" timeout="120" \
  op stop interval="0" timeout="120"
primitive failover-ip1 ocf:heartbeat:IPaddr \
  params ip="192.168.6.6" nic="eth0:0" cidr_netmask="32" \
  op monitor interval="10s"
primitive failover-ip2 ocf:heartbeat:IPaddr \
  params ip="192.168.6.7" nic="eth0:1" cidr_netmask="32" \
  op monitor interval="10s"
primitive failover-ip3 ocf:heartbeat:IPaddr \
  params ip="192.168.6.8" nic="eth0:2" cidr_netmask="32" \
  op monitor interval="10s"
primitive res_drbd_export ocf:linbit:drbd \
  params drbd_resource="hermes"
primitive res_fs ocf:heartbeat:Filesystem \
  params device="/dev/drbd0" directory="/mnt" fstype="ext4"
group mygroup failover-ip1 failover-ip2 failover-ip3 collectd
ms ms_drbd_export res_drbd_export \
  meta notify="true" master-max="1" master-node-max="1" clone-max="2"
clone-node-max="1"
location cli-prefer-collectd collectd inf: host-1
location cli-prefer-failover-ip1 failover-ip1 inf: host-1
location cli-prefer-failover-ip2 failover-ip2 inf: host-1
location cli-prefer-failover-ip3 failover-ip3 inf: host-1
location cli-prefer-res_drbd_export res_drbd_export inf: hermes-1
location cli-prefer-res_fs res_fs inf: host-1
colocation c_export_on_drbd inf: mygroup res_fs ms_drbd_export:Master
order o_drbd_before_services inf: ms_drbd_export:promote res_fs:start
property $id="cib-bootstrap-options" \
  dc-version="1.1.10-42f2063" \
  cluster-infrastructure="corosync" \
  stonith-enabled="false" \
  no-quorum-policy="ignore" \
  last-lrm-refresh="1447686090"
#vim:set syntax=pcmk
I don't found the right way, to order the startup of new services (example
collectd), after the /mnt is mounted.


Just order them after res_fs, same as you order res_fs after 
ms_drbd_export. Or may be I misunderstand your question?



___
Users mailing list: Users@clusterlabs.org
http://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


Re: [ClusterLabs] start service after filesystemressource

2015-11-20 Thread emmanuel segura
using group is more simple

example:

group mygroup resource1 resource2 resource 3
order o_drbd_before_services inf: ms_drbd_export:promote mygroup:start

2015-11-20 15:45 GMT+01:00 Andrei Borzenkov :
> 20.11.2015 16:38, haseni...@gmx.de пишет:
>
>> Hi,
>> I want to start several services after the drbd ressource an the
>> filessystem is
>> avaiable. This is my current configuration:
>> node $id="184548773" host-1 \
>>   attributes standby="on"
>> node $id="184548774" host-2 \
>>   attributes standby="on"
>> primitive collectd lsb:collectd \
>>   op monitor interval="10" timeout="30" \
>>   op start interval="0" timeout="120" \
>>   op stop interval="0" timeout="120"
>> primitive failover-ip1 ocf:heartbeat:IPaddr \
>>   params ip="192.168.6.6" nic="eth0:0" cidr_netmask="32" \
>>   op monitor interval="10s"
>> primitive failover-ip2 ocf:heartbeat:IPaddr \
>>   params ip="192.168.6.7" nic="eth0:1" cidr_netmask="32" \
>>   op monitor interval="10s"
>> primitive failover-ip3 ocf:heartbeat:IPaddr \
>>   params ip="192.168.6.8" nic="eth0:2" cidr_netmask="32" \
>>   op monitor interval="10s"
>> primitive res_drbd_export ocf:linbit:drbd \
>>   params drbd_resource="hermes"
>> primitive res_fs ocf:heartbeat:Filesystem \
>>   params device="/dev/drbd0" directory="/mnt" fstype="ext4"
>> group mygroup failover-ip1 failover-ip2 failover-ip3 collectd
>> ms ms_drbd_export res_drbd_export \
>>   meta notify="true" master-max="1" master-node-max="1"
>> clone-max="2"
>> clone-node-max="1"
>> location cli-prefer-collectd collectd inf: host-1
>> location cli-prefer-failover-ip1 failover-ip1 inf: host-1
>> location cli-prefer-failover-ip2 failover-ip2 inf: host-1
>> location cli-prefer-failover-ip3 failover-ip3 inf: host-1
>> location cli-prefer-res_drbd_export res_drbd_export inf: hermes-1
>> location cli-prefer-res_fs res_fs inf: host-1
>> colocation c_export_on_drbd inf: mygroup res_fs ms_drbd_export:Master
>> order o_drbd_before_services inf: ms_drbd_export:promote res_fs:start
>> property $id="cib-bootstrap-options" \
>>   dc-version="1.1.10-42f2063" \
>>   cluster-infrastructure="corosync" \
>>   stonith-enabled="false" \
>>   no-quorum-policy="ignore" \
>>   last-lrm-refresh="1447686090"
>> #vim:set syntax=pcmk
>> I don't found the right way, to order the startup of new services (example
>> collectd), after the /mnt is mounted.
>
>
> Just order them after res_fs, same as you order res_fs after ms_drbd_export.
> Or may be I misunderstand your question?
>
>
> ___
> Users mailing list: Users@clusterlabs.org
> http://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



-- 
  .~.
  /V\
 //  \\
/(   )\
^`~'^

___
Users mailing list: Users@clusterlabs.org
http://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