[ClusterLabs] state file not created for Stateful resource agent

Jehan-Guillaume de Rorthais jgdr at dalibo.com
Tue Mar 20 16:18:29 EDT 2018


On Tue, 20 Mar 2018 13:00:49 -0500
Ken Gaillot <kgaillot at redhat.com> wrote:

> On Sat, 2018-03-17 at 15:35 +0530, ashutosh tiwari wrote:
> > Hi,
> > 
> > 
> > We have two node active/standby cluster with a dummy  Stateful
> > resource (pacemaker/Stateful).
> > 
> > We observed that in case one node is up with master resource and
> > other node is booted up, state file for dummy resource is not created
> > on the node coming up.
> > 
> > /cib/status/node_state[@id='2']/transient_attributes[@id='2']/instanc
> > e_attributes[@id='status-2']:  <nvpair id="status-2-master-unicloud"
> > name="master-unicloud" value="5"/>
> > Mar 17 12:22:29 [24875] tigana       lrmd:   notice:
> > operation_finished:        unicloud_start_0:25729:stderr [
> > /usr/lib/ocf/resource.d/pw/uc: line 94: /var/run/uc/role: No such
> > file or directory ]  
> 
> The resource agent is ocf:pw:uc -- I assume this is a local
> customization of the ocf:pacemaker:Stateful agent?
> 
> It looks to me like the /var/run/uc directory is not being created on
> the second node. /var/run is a memory filesystem, so it's wiped at
> every reboot, and any directories need to be created (as root) before
> they are used, every boot.
> 
> ocf:pacemaker:Stateful puts its state file directly in /var/run to
> avoid needing to create any directories. You can change that by setting
> the "state" parameter, but in that case you have to make sure the
> directory you specify exists beforehand.

Another way to create the folder at each boot is to ask systemd.

Eg.:

  cat <<EOF > /etc/tmpfiles.d/ocf-pw-uc.conf
  # Directory for ocf:pw:uc resource agent
  d /var/run/uc 0700 root root - -
  EOF

Adjust the rights and owner to suit your need.

To take this file in consideration immediately without rebooting the server,
run the following command:

  systemd-tmpfiles --create /etc/tmpfiles.d/ocf-pw-uc.conf

Regards,
-- 
Jehan-Guillaume de Rorthais
Dalibo



More information about the Users mailing list