Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
9555269 Absent Member.
Absent Member.
1712 views

prevent resources from loading together

We've got a lovely NCS setup on SLES/OES. I've even configured two instances of dhcpd in a failover peer mode. (Super cool option!)

We have this five node cluster. Two of the resources run dhcpd. If they end up on the same node, only one of the dhcpd servers is active (although all addresses do respond...)

This raises the question though:

I know that we can limit the nodes which will host a particular resource. What if I have two resources that just cannot live on the same node, but I want them to have the possibility of running on any node? What I want is an exclusion that says "Load Resource A on Node X unless Resource B is already online"

I've already tried a shell script which queries for the services provided by the contentious resource, but a "cluster offline" issued by a cluster load script has a nasty way of making the resource go comatose!

Happy day! Aloha summer!
Labels (1)
0 Likes
4 Replies
changju Absent Member.
Absent Member.

Re: prevent resources from loading together

You can use “lockfile” to achieve this. You also need to identify the command (in the unload scripts) that will return error if your DHCP services are not running.

Here is the step by step example using a NSS volume resource. I tested on my cluster.

Original load script:

#!/bin/bash
. /opt/novell/ncs/lib/ncsfuncs
exit_on_error nss /poolact=AUTO_POOL_02
exit_on_error ncpcon mount AUTO_VOL_022=251
exit_on_error ncpcon mount AUTO_VOL_021=252
exit_on_error add_secondary_ipaddress 151.155.189.132
exit_on_error ncpcon bind --ncpservername=CGAO_SP2_BETA_CLUSTER_AUTO_POOL_02_SERVER --ipaddress=151.155.189.132
exit 0

Original unload script:

#!/bin/bash
. /opt/novell/ncs/lib/ncsfuncs
ignore_error ncpcon unbind --ncpservername=CGAO_SP2_BETA_CLUSTER_AUTO_POOL_02_SERVER --ipaddress=151.155.189.132
ignore_error del_secondary_ipaddress 151.155.189.132
ignore_error nss /pooldeact=AUTO_POOL_02
exit 0

We will use “ncpcon unbind” to determine if the NCP server is really running.

Modified load script:

#!/bin/bash
. /opt/novell/ncs/lib/ncsfuncs
if lockfile -r0 /var/run/ncs/my_lock_file
then
exit_on_error nss /poolact=AUTO_POOL_02
exit_on_error ncpcon mount AUTO_VOL_022=251
exit_on_error ncpcon mount AUTO_VOL_021=252
exit_on_error add_secondary_ipaddress 151.155.189.132
exit_on_error ncpcon bind --ncpservername=CGAO_SP2_BETA_CLUSTER_AUTO_POOL_02_SERVER --ipaddress=151.155.189.132
fi
exit 0

Modified unload script:

#!/bin/bash
. /opt/novell/ncs/lib/ncsfuncs
if ncpcon unbind --ncpservername=CGAO_SP2_BETA_CLUSTER_AUTO_POOL_02_SERVER --ipaddress=151.155.189.132 2>&1 | grep "completed OK"
then
rm -fv /var/run/ncs/my_lock_file
ignore_error del_secondary_ipaddress 151.155.189.132
ignore_error nss /pooldeact=AUTO_POOL_02
fi
exit 0

Modify scripts for the other resource accordingly, and you will achieve the mutual-exclusion. You’d better put the lock file under /var/run/ncs/ (so a reboot will clean up any leftovers).

Best regards,

Changju


9555269;1852400 wrote:
We've got a lovely NCS setup on SLES/OES. I've even configured two instances of dhcpd in a failover peer mode. (Super cool option!)

We have this five node cluster. Two of the resources run dhcpd. If they end up on the same node, only one of the dhcpd servers is active (although all addresses do respond...)

This raises the question though:

I know that we can limit the nodes which will host a particular resource. What if I have two resources that just cannot live on the same node, but I want them to have the possibility of running on any node? What I want is an exclusion that says "Load Resource A on Node X unless Resource B is already online"

I've already tried a shell script which queries for the services provided by the contentious resource, but a "cluster offline" issued by a cluster load script has a nasty way of making the resource go comatose!

Happy day! Aloha summer!
0 Likes
Highlighted
9555269 Absent Member.
Absent Member.

Re: prevent resources from loading together

Your suggestion is interesting. I wasn't familiar with lockfile.

This prevent the services in the cluster resource from loading, but the resource is still online, just not providing the service.

Still looking for a way to offline or migrate the resource to prevent coming online on the same node as a particular resource.



changju;1853649 wrote:
You can use “lockfile” to achieve this. You also need to identify the command (in the unload scripts) that will return error if your DHCP services are not running.

Here is the step by step example using a NSS volume resource. I tested on my cluster.

Original load script:

#!/bin/bash
. /opt/novell/ncs/lib/ncsfuncs
exit_on_error nss /poolact=AUTO_POOL_02
exit_on_error ncpcon mount AUTO_VOL_022=251
exit_on_error ncpcon mount AUTO_VOL_021=252
exit_on_error add_secondary_ipaddress 151.155.189.132
exit_on_error ncpcon bind --ncpservername=CGAO_SP2_BETA_CLUSTER_AUTO_POOL_02_SERVER --ipaddress=151.155.189.132
exit 0

Original unload script:

#!/bin/bash
. /opt/novell/ncs/lib/ncsfuncs
ignore_error ncpcon unbind --ncpservername=CGAO_SP2_BETA_CLUSTER_AUTO_POOL_02_SERVER --ipaddress=151.155.189.132
ignore_error del_secondary_ipaddress 151.155.189.132
ignore_error nss /pooldeact=AUTO_POOL_02
exit 0

We will use “ncpcon unbind” to determine if the NCP server is really running.

Modified load script:

#!/bin/bash
. /opt/novell/ncs/lib/ncsfuncs
if lockfile -r0 /var/run/ncs/my_lock_file
then
exit_on_error nss /poolact=AUTO_POOL_02
exit_on_error ncpcon mount AUTO_VOL_022=251
exit_on_error ncpcon mount AUTO_VOL_021=252
exit_on_error add_secondary_ipaddress 151.155.189.132
exit_on_error ncpcon bind --ncpservername=CGAO_SP2_BETA_CLUSTER_AUTO_POOL_02_SERVER --ipaddress=151.155.189.132
fi
exit 0

Modified unload script:

#!/bin/bash
. /opt/novell/ncs/lib/ncsfuncs
if ncpcon unbind --ncpservername=CGAO_SP2_BETA_CLUSTER_AUTO_POOL_02_SERVER --ipaddress=151.155.189.132 2>&1 | grep "completed OK"
then
rm -fv /var/run/ncs/my_lock_file
ignore_error del_secondary_ipaddress 151.155.189.132
ignore_error nss /pooldeact=AUTO_POOL_02
fi
exit 0

Modify scripts for the other resource accordingly, and you will achieve the mutual-exclusion. You’d better put the lock file under /var/run/ncs/ (so a reboot will clean up any leftovers).

Best regards,

Changju
0 Likes
Knowledge Partner
Knowledge Partner

Re: prevent resources from loading together

9555269;1852400 wrote:
What I want is an exclusion that says "Load Resource A on Node X unless Resource B is already online"

If you setup the resources to run and failover in the opposite order chances are already very slim both resources will end up together. These resources are also good ones to set with an auto failback (as they won't cut off anything for endusers when failing back) reducing the change of them ending up together even smaller (meaning only one node would have been running at a given time anyway).

---------dhcpd1---dhcpd2
server 1----1---------5
server 2----2---------4
server 3----3---------3
server 4----4---------2
server 5----5---------1
0 Likes
changju Absent Member.
Absent Member.

Re: prevent resources from loading together

I would like it being online. Suppose other nodes joined back, and this one failed. The resources can failover to different nodes.

If it's kept offline, it stays offline.


9555269;1854434 wrote:
Your suggestion is interesting. I wasn't familiar with lockfile.

This prevent the services in the cluster resource from loading, but the resource is still online, just not providing the service.

Still looking for a way to offline or migrate the resource to prevent coming online on the same node as a particular resource.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.