[Pacemaker] Finally. A REAL question.

Andrew Beekhof andrew at beekhof.net
Tue Nov 19 04:09:28 UTC 2013


On 19 Nov 2013, at 2:50 pm, Rob Thomas <xrobau at gmail.com> wrote:

> >>> On 19 Nov 2013, at 6:00 am, Rob Thomas <xrobau at gmail.com> wrote:
> >>>> So... What's the -right- way to do it then? 8)
> >>>
> >>>      <rsc_colocation id="pcs_rsc_colocation">
> >>>        <resource_set id="pcs_rsc_set">
> >>>          <resource_ref id="httpd"/>
> >>>          <resource_ref id="asterisk"/>
> >>>        </resource_set>
> >>>      </rsc_colocation>
> 
> ... 
> 
> >> I'll have a try with the setoptions and see if that works. Thanks!
> 
> Without adding the ms resource, it won't fail the other service over completely.
> 
> This works (which is a LITTLE bit more pleasing to the eyes, hopefully! I even set the font to monospace!)
> 
> <rsc_colocation id="pcs_rsc_colocation" score="INFINITY">
>   <resource_set id="pcs_rsc_set-1">
>     <resource_ref id="httpd"/>
>     <resource_ref id="asterisk"/>
>   </resource_set>
>   <resource_set id="pcs_rsc_set-2" role="Master">
>      <resource_ref id="ms-asterisk"/>
>      <resource_ref id="ms-httpd"/>
>   </resource_set>
> </rsc_colocation>
> 
> I'm still pretty sure you can't do that through pcs. 

The docs suggest this should work, but it seems not to:

   pcs constraint colocation set httpd asterisk set ms-asterisk ms-httpd setoptions role=Master score=INFINITY 

Chris: the command 'pcs constraint colocation set httpd asterisk setoptions role=Master' creates:

  <rsc_colocation id="pcs_rsc_colocation" role="Master">
     <resource_set id="pcs_rsc_set">
        <resource_ref id="httpd" />
        <resource_ref id="asterisk" />
     </resource_set>
  </rsc_colocation>

However role belongs with the resource_set.

> 
> And the reason why (I believe) I need them, to go into a bit more depth - (sorry for everyone else who's getting bored with this incredibly arcane and in-depth discussion, that has degenerated into pasting XML snippets everywhere) here's the relevant associated constraints:
> 
> <rsc_colocation id="c-1" rsc="asterisk_fs" score="INFINITY" with-rsc="ms-asterisk" with-rsc-role="Master"/>
> <rsc_order first="ms-asterisk" first-action="promote" id="o-1" score="INFINITY" then="asterisk_fs" then-action="start"/>
> <rsc_colocation id="c-2" rsc="httpd_fs" score="INFINITY" with-rsc="ms-httpd" with-rsc-role="Master"/>
> <rsc_order first="ms-httpd" first-action="promote" id="o-2" score="INFINITY" then="httpd_fs" then-action="start"/>
> 
> (id's changed to aid reading) 
> 
> Without pcs_rsc_set-2 before failing:
> 
>  Master/Slave Set: ms-asterisk [drbd_asterisk]
>      Masters: [ freepbx-a ]
>      Slaves: [ freepbx-b ]
>  Master/Slave Set: ms-httpd [drbd_httpd]
>      Masters: [ freepbx-a ]
>      Slaves: [ freepbx-b ]
>  Resource Group: httpd
>      httpd_fs   (ocf::heartbeat:Filesystem):    Started freepbx-a
>      httpd_ip   (ocf::heartbeat:IPaddr2):       Started freepbx-a
>      httpd_service      (ocf::heartbeat:apache):        Started freepbx-a
>  Resource Group: asterisk
>      asterisk_fs        (ocf::heartbeat:Filesystem):    Started freepbx-a
>      asterisk_ip        (ocf::heartbeat:IPaddr2):       Started freepbx-a
>      asterisk_service   (ocf::heartbeat:freepbx):       Started freepbx-a
>      isymphony_service  (lsb:iSymphonyServer):  Started freepbx-a
> 
> AFTER failing:
> 
>  Master/Slave Set: ms-asterisk [drbd_asterisk]
>      Masters: [ freepbx-a ]  <---------- THIS IS WRONG
>      Slaves: [ freepbx-b ]
>  Master/Slave Set: ms-httpd [drbd_httpd]
>      Masters: [ freepbx-b ]
>      Slaves: [ freepbx-a ]
>  Resource Group: asterisk
>      asterisk_fs        (ocf::heartbeat:Filesystem):    Stopped
>      asterisk_ip        (ocf::heartbeat:IPaddr2):       Stopped
>      asterisk_service   (ocf::heartbeat:freepbx):       Stopped
>      isymphony_service  (lsb:iSymphonyServer):  Stopped
>  Resource Group: httpd
>      httpd_fs   (ocf::heartbeat:Filesystem):    Started freepbx-b
>      httpd_ip   (ocf::heartbeat:IPaddr2):       Started freepbx-b
>      httpd_service      (ocf::heartbeat:apache):        Started freepbx-b
> 
> The asterisk group isn't starting because - obviously - it's not the master for ms-asterisk.  So the constraint worked, BUT, because I don't have the resource in there, I can't tell it to shut down.
> 
> My other idea was having the ms- ordering start the group, but that doesn't work either. 
> 
> --Rob
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
> 
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://lists.clusterlabs.org/pipermail/pacemaker/attachments/20131119/08a7e03d/attachment-0004.sig>


More information about the Pacemaker mailing list