Here's an example of the data, and routines that I am working with:
$config_files{ $cluster } = [ $config_file ]; This contains: Key = Cluster_1 Value: remap.config, origin.db, local_cluster.db remap.config.hosts, origin.db.hosts, local_cluster.db.hosts
I get my hostnames by parsing the above ".hosts" files. "TS" hostnames are contained in remap.config.hosts. "SA" hostnames (zone files) are contained in the two other ".hosts" files.
TS servers must be reactivated first, then we attempt to reactivate the SA server. Then, we move on to the next cluster, assuming that the first succeeds.
So, ultimately, what I need to do, is foreach host, in order:
#####################7 # # # PROCESS SEQUENCES # # # ##################### @taskSequence = ( 'establishSession~~connecting to $clusterHost', 'local_checksum~~calculating local checksums', 'transferFilesToStage~~transferring files to $clusterHost: $cluster +StageDirectory', 'verifyPerms~~verifying file permissions', ); @activateSequence = ( 'activateTS~~$clusterHost: restarting traffic server with new confi +guration', 'activateSADNS~~$clusterHost: restarting SADNS with new configurati +on' ); @rollBackSequence = ( 'revertToExistingFiles~~$clusterHost: restarting using existing con +fig files', 'terminateSession~~$clusterHost: disconnecting from host' ); @offLineSequence = ( 'logBogusFiles~~$clusterHost: encountered corrupted files moved to +$errorLogDir', 'transferFilesToWorking~~$clusterHost: transferring previous files +to $clusterWorkingDirectory', 'takeClusterOffLine~~ $clusterHost is offline.'# < nsctl stop > ); @transferFile = ( 'copyFile~~copying file from remote host' ); #################################### # # MAIN # "foreach cluster" "foreach host, beginning with TA, then SA" @cleanUpTaskSequence = ('terminateSession~~disconnecting from host'); $executionStatus = &executeTaskSequence($clusterHost, @taskSequenc +e) ; $activationStatus = &executeTaskSequence($clusterHost, @activateSe +quence); $cleanUpStatus = &executeTaskSequence ($clusterHost, @cleanUpTaskS +equence);
In reply to Re: Data Structure Design
by Tuna
in thread Data Structure Design
by Tuna
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |