Unsolved

This post is more than 5 years old

2 Posts

283

September 6th, 2007 15:00

Sample code and programming questions

Okay, this may be a newbie question, but does anyone have some good sample code to share? Specifically regarding creation of rules and system interaction. What I can't seem to find is examples on safely accessing the mirrored data source (according to the docs, rules can run on any node and not necessarily the one with the data source connected).
In my case, I am trying to run a weekly set of batch files designed to create new files and clean up some databases held on the mirrored drive.

So, can anyone point me in the right direction and/or post some cool and interesting scripts?

198 Posts

September 10th, 2007 09:00

Shawn,


Yes - the rule can be run on anyone of the nodes in the cluster. Basically the node which has been up the longest normally runs the rule processor, so you will need code in your script to ascertain what the current host is and which node the data source is attached to. Only in the event that the current node has the data source mounted then run the actions you need.

You may actually find the code to perform your task easier to write outside of AutoStart and use the operating system scheduler to run it on all the nodes, and then only if the disks are accessible then to perform the required action.

Another approach would be to have two copies of a utility process - each defined to run on one node in the cluster only and then for your rule/trigger combination to call the relevant version of the util proc based on the location of the resource group location - which intern performs you data management actions.

IKP
No Events found!

Top