Mailing List Archive

Multiple colocation with same resource group
I have the following type of scenario. I have established a resource
group which does a number of infrastructure type things: sets IP
addresses, sets correct password files, sets correct system links and
mount points, etc. I now have a bunch of primitives that I want to
colocate with this resource group, but I do not want them part of the
group because I do not want the failure/reset of one to cause the others
to reset.

For example, I'm running a FTP server, a HTTP server, a SMTP server, and
an OpenDAP backend server on the server that runs the resource group. Now
if I simply add them to the existing resource group in the order they're
listed above, then if the HTTP server gets reset during a monitor action,
it will cause the SMTP server and OpenDAP backend to shutdown and then
restart them after it restarts the HTTP server -- even if those 2 are not
actually dependent on the HTTP server. This is how resource groups work,
I get that.

What I want is a configuration where each of those four servers is
colocated with the resource group "in parallel" (for lack of a more
accurate term) such that a reset of one of the four servers follwing a
failed monitor action does not trigger a reset of any other resource. So
would the following configuration work or would it create a 'resource set'
(extraneous information such as params stripped for ease of reading):

primitive ip ocf:heartbeat:IPaddr2 params ip="1.2.3.4"
primitive job ocf:pps:jobfile params role="test" job="first"
primitive pwd ocf:pps:pwdfile params role="test"
primitive ftpd ocf:pps:proftpd
primitive httpd ocf:heartbeat:apache
primitive smtpd ocf:heartbeat:postfix
primitive bes ocf:pps:besServer

group infra_group ip job pwd

colocation inf_ftpd inf: ftpd infra_group
colocation inf_http inf: httpd infra_group
colocation inf_mail inf: smtpd infra_group
colocation inf_http inf: httpd infra_group
colocation inf_mail inf: smtpd infra_group
colocation inf_odap inf: bes infra_group


Before commenting on if this will work as I want as stated above, did I
get the colocation order correct in the statements? In other words, the
infrastructure group must be up and running prior to starting any of the
other servers (ftpd|httpd|smtpd|bes), so are those lines correct? Do I
need to reverse it, i.e.:

colocation inf_ftpd inf: infra_group ftpd

or do I need to use an 'order' statement instead, i.e.:

order ftp_infra mandatory: infra_group:start ftpd


So once the issue of whether my basic colocation (or order) statements are
correct is resolved, the next issue is will this do what I want?

For example, assume the following failure scenarios (i.e. the monitor
returns not_running and attempts to restart the named primitive):

'ftpd' fails a monitor check
Is it the only resource that is restarted?
Or do all the subsequent colocation resources do it too?

'job' fails a monitor check
So the 'pwd' resource gets stopped, then 'job' gets
stopped and started, then 'pwd' gets started due to the
resource group.
But do all (ftpd|httpd|smtpd|bes) of the servers with
their individual colocation statements also get reset?

Thanks very much for your help.

Tony


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

_______________________________________________
Linux-HA mailing list
Linux-HA@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems
Re: Multiple colocation with same resource group [ In reply to ]
On Fri, 2014-02-21 at 12:37 +0000, Tony Stocker wrote:

> colocation inf_ftpd inf: infra_group ftpd
>
> or do I need to use an 'order' statement instead, i.e.:
>
> order ftp_infra mandatory: infra_group:start ftpd

I'm far from a leading expert on this, but in my experience, colocation
and order are completely separate concepts. If you want both, you have
to state both. So I would say you need both colocation and order
statements to get what you want. I have similar scenarios, where virtual
machines depend on the underlying DRBD device, so I colocate the DRBD
master-slave resource and the VM resource, then have an order statement
to say the DRBD resource must be started before the VM.

--Greg


_______________________________________________
Linux-HA mailing list
Linux-HA@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems
Re: Multiple colocation with same resource group [ In reply to ]
On 22 Feb 2014, at 2:16 am, Greg Woods <woods@ucar.edu> wrote:

> On Fri, 2014-02-21 at 12:37 +0000, Tony Stocker wrote:
>
>> colocation inf_ftpd inf: infra_group ftpd
>>
>> or do I need to use an 'order' statement instead, i.e.:
>>
>> order ftp_infra mandatory: infra_group:start ftpd
>
> I'm far from a leading expert on this, but in my experience, colocation
> and order are completely separate concepts. If you want both, you have
> to state both. So I would say you need both colocation and order
> statements to get what you want.

Exactly

> I have similar scenarios, where virtual
> machines depend on the underlying DRBD device, so I colocate the DRBD
> master-slave resource and the VM resource, then have an order statement
> to say the DRBD resource must be started before the VM.
>
> --Greg
>
>
> _______________________________________________
> Linux-HA mailing list
> Linux-HA@lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
Re: Multiple colocation with same resource group [ In reply to ]
On Mon, 24 Feb 2014, Andrew Beekhof wrote:

>
> On 22 Feb 2014, at 2:16 am, Greg Woods <woods@ucar.edu> wrote:
>
>> On Fri, 2014-02-21 at 12:37 +0000, Tony Stocker wrote:
>>
>>> colocation inf_ftpd inf: infra_group ftpd
>>>
>>> or do I need to use an 'order' statement instead, i.e.:
>>>
>>> order ftp_infra mandatory: infra_group:start ftpd
>>
>> I'm far from a leading expert on this, but in my experience, colocation
>> and order are completely separate concepts. If you want both, you have
>> to state both. So I would say you need both colocation and order
>> statements to get what you want.
>
> Exactly
>
So are is **this** what my configuration should like given that
information?:

primitive ip ocf:heartbeat:IPaddr2 params ip="1.2.3.4"
primitive job ocf:pps:jobfile params role="test" job="first"
primitive pwd ocf:pps:pwdfile params role="test"
primitive ftpd ocf:pps:proftpd
primitive httpd ocf:heartbeat:apache
primitive smtpd ocf:heartbeat:postfix
primitive bes ocf:pps:besServer

group infra_group ip job pwd

colocation inf_ftpd inf: ftpd infra_group
colocation inf_http inf: httpd infra_group
colocation inf_mail inf: smtpd infra_group
colocation inf_odap inf: bes infra_group

order ftpd_infra mandatory: infra_group:start ftpd
order http_infra mandatory: infra_group:start httpd
order smtp_infra mandatory: infra_group:start smtpd
order odap_infra mandatory: infra_group:start bes


Is my syntax above correct for the situation where I need all elements of
'infra_group' started first, and then the various other primitives
started? In other words am I correctly stating my colocation
requirements? Or do I need to reverse the order, like so?:

colocation inf_ftpd inf: infra_group ftpd

Will the order statements ensure that the infra_group is completed startup
before starting ftpd? In other words, since part of the infra_group is to
set the password file, and since the ftpd daemon depends on the existence
of UID's in said password file, the ftpd primitive is not going to start
until the infra_group has fully completed startup, correct?

Am I allowed to separately list the pairs of colocation and order
statements as I've done above? Or will that cause issues?

By separately stating the pairs, as opposed to creating a single line,
have I avoided creating ad hoc resource sets that I didn't explicitly
define?

Thanks,
Tony


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

_______________________________________________
Linux-HA mailing list
Linux-HA@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems
Re: Multiple colocation with same resource group [ In reply to ]
On 25 Feb 2014, at 1:29 am, Tony Stocker <Tony.Stocker@nasa.gov> wrote:

> On Mon, 24 Feb 2014, Andrew Beekhof wrote:
>
>>
>> On 22 Feb 2014, at 2:16 am, Greg Woods <woods@ucar.edu> wrote:
>>
>>> On Fri, 2014-02-21 at 12:37 +0000, Tony Stocker wrote:
>>>
>>>> colocation inf_ftpd inf: infra_group ftpd
>>>>
>>>> or do I need to use an 'order' statement instead, i.e.:
>>>>
>>>> order ftp_infra mandatory: infra_group:start ftpd
>>>
>>> I'm far from a leading expert on this, but in my experience, colocation
>>> and order are completely separate concepts. If you want both, you have
>>> to state both. So I would say you need both colocation and order
>>> statements to get what you want.
>>
>> Exactly
>>
> So are is **this** what my configuration should like given that information?:
>
> primitive ip ocf:heartbeat:IPaddr2 params ip="1.2.3.4"
> primitive job ocf:pps:jobfile params role="test" job="first"
> primitive pwd ocf:pps:pwdfile params role="test"
> primitive ftpd ocf:pps:proftpd
> primitive httpd ocf:heartbeat:apache
> primitive smtpd ocf:heartbeat:postfix
> primitive bes ocf:pps:besServer
>
> group infra_group ip job pwd
>
> colocation inf_ftpd inf: ftpd infra_group
> colocation inf_http inf: httpd infra_group
> colocation inf_mail inf: smtpd infra_group
> colocation inf_odap inf: bes infra_group
>
> order ftpd_infra mandatory: infra_group:start ftpd
> order http_infra mandatory: infra_group:start httpd
> order smtp_infra mandatory: infra_group:start smtpd
> order odap_infra mandatory: infra_group:start bes
>
>
> Is my syntax above correct for the situation where I need all elements of 'infra_group' started first, and then the various other primitives started? In other words am I correctly stating my colocation requirements?

From what I recall of crmsh, it is correct

> Or do I need to reverse the order, like so?:
>
> colocation inf_ftpd inf: infra_group ftpd
>
> Will the order statements ensure that the infra_group is completed startup before starting ftpd?

yes

> In other words, since part of the infra_group is to set the password file, and since the ftpd daemon depends on the existence of UID's in said password file, the ftpd primitive is not going to start until the infra_group has fully completed startup, correct?
>
> Am I allowed to separately list the pairs of colocation and order statements as I've done above?

yes

> Or will that cause issues?

no

>
> By separately stating the pairs, as opposed to creating a single line, have I avoided creating ad hoc resource sets that I didn't explicitly define?

its shouldn't matter either way.

>
> Thanks,
> Tony
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
> _______________________________________________
> Linux-HA mailing list
> Linux-HA@lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems