One Click Cluster Install

Problem

We have a cluster of servers all running the same software. Upgrading a node is as simple as extracting a zip file and overwriting the existing installation. This sounds a simple task but at some point the number of nodes might become large enough to make the upgrade a tedious process. Upgrading our cluster installations becomes even more time consuming as we push frequent builds and specially if we revert and do build to build comparisons. I thought about the simplest windows bat file to automate and deal with the following issues

  1. Automatically grab the latest zip file from a builds directory
  2. Kill a remote process before overwriting files otherwise copying files fails
  3. Extract the zip file from the command line

Solution

Here are the steps that I followed…

  • Make sure each node in the cluster has the installation directory shared.
  • Make sure the shared folders have write permission
  • Install the 7z zip file extractor on the machine on which you want to execute the upgrade script. Here is a direct link

Code

Here is the code to grab the latest file in a directory…

Here is how to kill a process on a remote Windows machine…

and here is how to extract a zip file from the windows command line…

Tags:

Add a Comment

Your email address will not be published. Required fields are marked *