<div dir="ltr">Hi Ken,<div><br></div><div>I used the alerts as well, seems to be not working.</div><div><br></div><div>Please check the below configuration</div><div><div>[root@node1 alerts]# pcs config show</div><div>Cluster Name:</div><div>Corosync Nodes:</div><div>Pacemaker Nodes:</div><div> node1 node2 node3</div><div><br></div><div>Resources:</div><div> Resource: TRR (class=ocf provider=heartbeat type=TimingRedundancyRA)</div><div> Operations: start interval=0s timeout=60s (TRR-start-interval-0s)</div><div> stop interval=0s timeout=20s (TRR-stop-interval-0s)</div><div> monitor interval=10 timeout=20 (TRR-monitor-interval-10)</div><div><br></div><div>Stonith Devices:</div><div>Fencing Levels:</div><div><br></div><div>Location Constraints:</div><div> Resource: TRR</div><div> Enabled on: node1 (score:100) (id:location-TRR-node1-100)</div><div> Enabled on: node2 (score:200) (id:location-TRR-node2-200)</div><div> Enabled on: node3 (score:300) (id:location-TRR-node3-300)</div><div>Ordering Constraints:</div><div>Colocation Constraints:</div><div>Ticket Constraints:</div><div><br></div><div>Alerts:</div><div> Alert: alert_file (path=/usr/share/pacemaker/alert_file.sh)</div><div> Options: debug_exec_order=false</div><div> Meta options: timeout=15s</div><div> Recipients:</div><div> Recipient: recipient_alert_file_id (value=/usr/share/pacemaker/alert_file.log)</div><div><br></div><div>Resources Defaults:</div><div> resource-stickiness: INFINITY</div><div>Operations Defaults:</div><div> No defaults set</div><div><br></div><div>Cluster Properties:</div><div> cluster-infrastructure: corosync</div><div> dc-version: 1.1.15-11.el7_3.4-e174ec8</div><div> default-action-timeout: 240</div><div> have-watchdog: false</div><div> no-quorum-policy: ignore</div><div> placement-strategy: balanced</div><div> stonith-enabled: false</div><div> symmetric-cluster: false</div><div><br></div><div>Quorum:</div><div> Options:</div></div><div><br></div><div><br></div><div>/usr/share/pacemaker/alert_file.sh does not get called whenever I trigger a scenario for failover.<br></div><div>Please let me know if I m missing anything. </div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Regards,</div><div class="gmail_extra">Sriram.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 8, 2017 at 8:29 PM, Ken Gaillot <span dir="ltr"><<a href="mailto:kgaillot@redhat.com" target="_blank">kgaillot@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5">On Tue, 2017-08-08 at 17:40 +0530, Sriram wrote:<br>
> Hi Ulrich,<br>
><br>
><br>
> Please see inline.<br>
><br>
> On Tue, Aug 8, 2017 at 2:01 PM, Ulrich Windl<br>
> <<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de">Ulrich.Windl@rz.uni-<wbr>regensburg.de</a>> wrote:<br>
> >>> Sriram <<a href="mailto:sriram.ec@gmail.com">sriram.ec@gmail.com</a>> schrieb am <a href="tel:08.08.2017" value="+498082017">08.08.2017</a> um<br>
> 09:30 in Nachricht<br>
> <CAMvdjurcQc6t=ZfGr=<wbr>cRL25Xq0Je9h9F_TvZXyxVAn3n<br>
> +<a href="mailto:Dvcgw@mail.gmail.com">Dvcgw@mail.gmail.com</a>>:<br>
> > Hi Ken & Jan,<br>
> ><br>
> > In the cluster we have, there is only one resource running.<br>
> Its a OPT-IN<br>
> > cluster with resource-stickiness set to INFINITY.<br>
> ><br>
> > Just to clarify my question, lets take a scenario where<br>
> there are four<br>
> > nodes N1, N2, N3, N4<br>
> > a. N1 comes up first, starts the cluster.<br>
><br>
> The cluster will start once it has a quorum.<br>
><br>
> > b. N1 Checks that there is no resource running, so it will<br>
> add the<br>
> > resource(R) with the some location constraint(lets say score<br>
> 100)<br>
> > c. So Resource(R) runs in N1 now.<br>
> > d. N2 comes up next, checks that resource(R) is already<br>
> running in N1, so<br>
> > it will update the location constraint(lets say score 200)<br>
> > e. N3 comes up next, checks that resource(R) is already<br>
> running in N1, so<br>
> > it will update the location constraint(lets say score 300)<br>
><br>
> See my remark on quorum above.<br>
><br>
> Yes you are right, I forgot to mention it.<br>
><br>
><br>
> > f. N4 comes up next, checks that resource(R) is already<br>
> running in N1, so<br>
> > it will update the location constraint(lets say score 400)<br>
> > g. For the some reason, if N1 goes down, resource(R) shifts<br>
> to N4(as its<br>
> > score is higher than anyone).<br>
> ><br>
> > In this case is it possible to notify the nodes N2, N3 that<br>
> newly elected<br>
> > active node is N4 ?<br>
><br>
> What type of notification, and what would the node do with it?<br>
> Any node in the cluster always has up to date configuration<br>
> information. So it knows the status of the other nodes also.<br>
><br>
><br>
> I agree that the node always has upto date configuration information,<br>
> but an application or a thread needs to poll for that information. Is<br>
> there any way, where the notifications are received through some<br>
> action function in RA. ?<br>
<br>
</div></div>Ah, I misunderstood your situation, I thought you had a cloned resource.<br>
<br>
For that, the alerts feature (available in Pacemaker 1.1.15 and later)<br>
might be useful:<br>
<br>
<a href="http://clusterlabs.org/doc/en-US/Pacemaker/1.1-pcs/html-single/Pacemaker_Explained/index.html#idm139900098676896" rel="noreferrer" target="_blank">http://clusterlabs.org/doc/en-<wbr>US/Pacemaker/1.1-pcs/html-<wbr>single/Pacemaker_Explained/<wbr>index.html#idm139900098676896</a><br>
<div class="gmail-HOEnZb"><div class="gmail-h5"><br>
<br>
><br>
><br>
> Regards,<br>
> Sriram.<br>
><br>
> ><br>
> > I went through clone notifications and master-slave, Iooks<br>
> like it either<br>
> > requires identical resources(Anonymous) or Unique or<br>
> Stateful resources to<br>
> > be running<br>
> > in all the nodes of the cluster, where as in our case there<br>
> is only<br>
> > resource running in the whole cluster.<br>
><br>
> Maybe the main reason for not having notifications is that if<br>
> a node fails hard, it won't be able to send out much status<br>
> information to the other nodes.<br>
><br>
> Regards,<br>
> Ulrich<br>
><br>
> ><br>
> > Regards,<br>
> > Sriram.<br>
> ><br>
> ><br>
> ><br>
> ><br>
> > On Mon, Aug 7, 2017 at 11:28 AM, Sriram<br>
> <<a href="mailto:sriram.ec@gmail.com">sriram.ec@gmail.com</a>> wrote:<br>
> ><br>
> >><br>
> >> Thanks Ken, Jan. Will look into the clone notifications.<br>
> >><br>
> >> Regards,<br>
> >> Sriram.<br>
> >><br>
> >> On Sat, Aug 5, 2017 at 1:25 AM, Ken Gaillot<br>
> <<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a>> wrote:<br>
> >><br>
> >>> On Thu, 2017-08-03 at 12:31 +0530, Sriram wrote:<br>
> >>> ><br>
> >>> > Hi Team,<br>
> >>> ><br>
> >>> ><br>
> >>> > We have a four node cluster (1 active : 3 standby) in<br>
> our lab for a<br>
> >>> > particular service. If the active node goes down, one of<br>
> the three<br>
> >>> > standby node becomes active. Now there will be (1<br>
> active : 2<br>
> >>> > standby : 1 offline).<br>
> >>> ><br>
> >>> ><br>
> >>> > Is there any way where this newly elected node sends<br>
> notification to<br>
> >>> > the remaining 2 standby nodes about its new status ?<br>
> >>><br>
> >>> Hi Sriram,<br>
> >>><br>
> >>> This depends on how your service is configured in the<br>
> cluster.<br>
> >>><br>
> >>> If you have a clone or master/slave resource, then clone<br>
> notifications<br>
> >>> is probably what you want (not alerts, which is the path<br>
> you were going<br>
> >>> down -- alerts are designed to e.g. email a system<br>
> administrator after<br>
> >>> an important event).<br>
> >>><br>
> >>> For details about clone notifications, see:<br>
> >>><br>
> >>><br>
> <a href="http://clusterlabs.org/doc/en-US/Pacemaker/1.1-pcs/html-sing" rel="noreferrer" target="_blank">http://clusterlabs.org/doc/en-<wbr>US/Pacemaker/1.1-pcs/html-sing</a><br>
> >>><br>
> le/Pacemaker_Explained/index.<wbr>html#_clone_resource_agent_<wbr>requirements<br>
> >>><br>
> >>> The RA must support the "notify" action, which will be<br>
> called when a<br>
> >>> clone instance is started or stopped. See the similar<br>
> section later for<br>
> >>> master/slave resources for additional information. See the<br>
> mysql or<br>
> >>> pgsql resource agents for examples of notify<br>
> implementations.<br>
> >>><br>
> >>> > I was exploring "notification agent" and "notification<br>
> recipient"<br>
> >>> > features, but that doesn't seem to<br>
> work. /etc/sysconfig/notify.sh<br>
> >>> > doesn't get invoked even in the newly elected active<br>
> node.<br>
> >>><br>
> >>> Yep, that's something different altogether -- it's only<br>
> enabled on RHEL<br>
> >>> systems, and solely for backward compatibility with an<br>
> early<br>
> >>> implementation of the alerts interface. The new alerts<br>
> interface is more<br>
> >>> flexible, but it's not designed to send information<br>
> between cluster<br>
> >>> nodes -- it's designed to send information to something<br>
> external to the<br>
> >>> cluster, such as a human, or an SNMP server, or a<br>
> monitoring system.<br>
> >>><br>
> >>><br>
> >>> > Cluster Properties:<br>
> >>> > cluster-infrastructure: corosync<br>
> >>> > dc-version: 1.1.17-e2e6cdce80<br>
> >>> > default-action-timeout: 240<br>
> >>> > have-watchdog: false<br>
> >>> > no-quorum-policy: ignore<br>
> >>> > notification-agent: /etc/sysconfig/notify.sh<br>
> >>> > notification-recipient: /var/log/notify.log<br>
> >>> > placement-strategy: balanced<br>
> >>> > stonith-enabled: false<br>
> >>> > symmetric-cluster: false<br>
> >>> ><br>
> >>> ><br>
> >>> ><br>
> >>> ><br>
> >>> > I m using the following versions of pacemaker and<br>
> corosync.<br>
> >>> ><br>
> >>> ><br>
> >>> > /usr/sbin # ./pacemakerd --version<br>
> >>> > Pacemaker 1.1.17<br>
> >>> > Written by Andrew Beekhof<br>
> >>> > /usr/sbin # ./corosync -v<br>
> >>> > Corosync Cluster Engine, version '2.3.5'<br>
> >>> > Copyright (c) 2006-2009 Red Hat, Inc.<br>
> >>> ><br>
> >>> ><br>
> >>> > Can you please suggest if I m doing anything wrong or if<br>
> there any<br>
> >>> > other mechanisms to achieve this ?<br>
> >>> ><br>
> >>> ><br>
> >>> > Regards,<br>
> >>> > Sriram.<br>
<br>
</div></div><div class="gmail-HOEnZb"><div class="gmail-h5">--<br>
Ken Gaillot <<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a>><br>
<br>
<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
Users mailing list: <a href="mailto:Users@clusterlabs.org">Users@clusterlabs.org</a><br>
<a href="http://lists.clusterlabs.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.clusterlabs.org/<wbr>mailman/listinfo/users</a><br>
<br>
Project Home: <a href="http://www.clusterlabs.org" rel="noreferrer" target="_blank">http://www.clusterlabs.org</a><br>
Getting started: <a href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf" rel="noreferrer" target="_blank">http://www.clusterlabs.org/<wbr>doc/Cluster_from_Scratch.pdf</a><br>
Bugs: <a href="http://bugs.clusterlabs.org" rel="noreferrer" target="_blank">http://bugs.clusterlabs.org</a><br>
</div></div></blockquote></div><br></div></div>