Come to think of it, so long as you exit with a value of 0, you shouldn't need the if...then statements. Just fire off an rsh for both nodes to terminate the sessions from the host. One will work, the other won't, but it shouldn't matter.
i.e.
rsh Filer -l ClusterAdmin cifs terminate -t 0 node1;
rsh Filer -l ClusterAdmin cifs terminate -t 0 node2;
exit 0;
Again, you MIGHT want to wrap some error checking logic around this to feedback results, etc.
Lance
-----Original Message-----
From: White, Lance [mailto:Lance.White@netapp.com]
Sent: Friday, May 25, 2001 8:16 AM
To: 'Morgan, Joshua'; 'toasters(a)mathworks.com'
Subject: RE: Locking of Files and server clusters
One of the steps required to ensure proper failover of SQL Server via Legato Cluster is the creation of a Resource Group (RG)connecting the application to the two nodes. The RG must include a script that gets executed as one of the first steps in bringing up the RG. The script was designed to be a workaround for the filer's normally necessary CIFS file-locking behavior. When an Legato Cluster node first fails, as far as the filer is concerned, the session between the filer and that node is still alive (the disconnect could be temporary). Because of this, it initially maintains the file locks originally established for that session. Without our script, these locks would prevent the other "takeover" node from accessing the required files during takeover. However, when our script is implemented, the file locks are terminated and the "takeover" node can access the files as necessary. In our case, the files the "takeover" node needs access to are the SQL Server database data and!
log files. If the "takeover" node does not have access to these files, once the takeover is completed and the SQL Server is done recovering, the databases on the filer are declared "suspect".
Following is the generic syntax for the script that must reside on each node:
rsh filer_name -l cluster_admin_name cifs terminate -t 0 failed_node_name
You can pass the name of the failed node via a &ft' environment variable (refer to the LCE docs for details), or you can create a nested if...then...else loop to determine which node you are starting up on, and how to terminate the CIFS session on the Filer. An example would be:
if &ft'currentnode == 'failednode' then
rsh Filer -l ClusterAdmin cifs terminate -t 0 failednode
else
rsh Filer -l ClusterAdmin cifs terminate -t 0 othernode
end;
Likely will be a little more coding than this, but you get the drift.
Lance White
Systems Engineer
Network Appliance
-----Original Message-----
From: Morgan, Joshua [mailto:JMorgan@Trivergent.com]
Sent: Friday, May 25, 2001 7:29 AM
To: 'toasters(a)mathworks.com'
Subject: Locking of Files and server clusters
Here is the Scenario:
We have SQL7 Server running with its Databases on an F760
We are using Legato Clustering Software
If the main SQL Server dies and the cluster software tries to bring up the backup server, we get a message saying that the Database files are still locked by the downed server.
Does anyone know of a way to script unlocking the files? We can manually do it through server manager but that is no good for Disater Recovery.
Joshua Morgan
PH: (864) 331-7939
jmorgan(a)trivergent.com