Link to home
Start Free TrialLog in
Avatar of huzefaq
huzefaq

asked on

Need JACL script to automate EAR file updation

Hi guys

I need a JACL script by which I can just put an EAR file on a particular folder where the deployment manager is intsalled. When I run this script it should update this ear file and restart all the instances where this information is installed. If the WAR file is not already installed then it should give a message and do nothing. Also I have multiple clusters so i need to make sure that the EAR file being updated is updated on the correct cluster. Once updated it should also synchronize the changes to all the nodes.

I would really appreciate if anyone has built in script for this. Any help will be greatly appreciated

Thanks
Avatar of HonorGod
HonorGod
Flag of United States of America image

Q1: What version of WebSphere Application Server are you using?

The reason that I ask is that Jacl tends to be much harder to read and understand that Jython does since Jacl is a Java implementation of the Tcl scripting language, whereas Jython is a Java implementation of the Python scripting language.

Q2: Are you talking about a production environment, or a development environment?

The reason that I ask is that for a development environment, it might be better to configure the "rapid deployment" mechanism in WebSphere...

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.etools.wrd.freeform.doc/topics/cwrdrapid.html
It sounds like you are talking about a production environment because of the references to "multiple" clusters.
Avatar of huzefaq
huzefaq

ASKER

Hi HonorGod
 
We are using version 5.0.2.16. Also we need to implement this on QA as well as the production envronment. In QA there is only one machine where we have multiple WAS instances as well as the deplyment manager. But in production we have multiple machines. Physically Production environment is big but logically both QA and production are same
Thanks and please let me know if you have any other question
5.0, ouch.  now I (better) understand the need for a Jacl specific script.

It would be best if you would invoke wsadmin, and point to the script to be executed, and pass the fully qualified path to an ear file for the script to process.  Having the script go "looking" for suitable ear files would make it more difficult to write, debug, maintain, and understand.

Then, you could invoke the script using something like the following.

How does that sound?


wsadmin -lang jacl -f scriptName.jacl "C:\temp\Application.ear"

Open in new window

Avatar of huzefaq

ASKER

This should work fine! The only other thing is that there are about nine application and these applications are not installed in one single cluster but some applications(ear) are installed on one particular cluster and some other application are installed in an other particlar cluster.
Now when I pass the location of EAR file i need to make sure that it is being updated on the right cluster also.
 
Thanks
So it sounds like what is needed is some command line parameter parsing and processing code as well.  This is "much easier" in Jython than Jacl...   But Jython wasn't available until WebSphere 5.1, so we're out of luck there.

Q1: What output do you get when you execute the following command?
> wsadmin -?

      I'm looking for the "wsadmin" usage information...

Q2: What output do you get when you execute these commands?
> wsadmin -conntype none -lang jacl
wsadmin> info tclversion


... I'm trying to figure out what version of Tcl was used as the basis for Jacl...
Avatar of huzefaq

ASKER

HonorGod
I have executed all the commands you mentioned above and have attached a word document with the screenshots. Please let me knwo if you need any other information
Thanks again

JACLScripT-AutomateEAUpdation.doc
Thanks, but I don't see the output of:

./wsadming.sh -?

I want to see what parameters are supported by this version of wsadmin...
Avatar of huzefaq

ASKER

I was not sure which command will give teh parameters so I went to the help. The most relevant command I passed was script paramters but somehow it is not recognizing this command. Is this the right command to get info about the parameters and if I am executing it right. the screens shots are attached.

Thanks
Avatar of huzefaq

ASKER

please see attachment
JACLScript-AutomateEAUpdation2.doc
Thanks.  That helps (pun intended) a lot.

Next question.  How "robust" does this script have to be?

By that, I mean, in order to make it "foolproof" a lot more code is required, even though it is really difficult to make programs as good as they can be.

This would require more updates, and interaction with you because I no longer have access to a 5.0 system.

If you want a relatively straight forward script that doesn't have lots of extra "error checking" code, that should be easier to write, and quicker to get running.

It's your choice...
Avatar of huzefaq

ASKER

HonorGod

For right now I think if a script can perform the below tasks that should be sufficient.

a) First we pass the location of the ear file to a script and the name of the cluster where this ear file needs to be updated.
b) Check if this EAR file is already installed. If it is installed than only update this EAR file on the appropriate cluster.
c) If the EAR file is not installed than give user a message that " the application EAR file  requested for updation is not already installed".
d) Once the application is updated than all the nodes of the cluster should also be synchronized
e) After that all the server instances where this application is installed should be restarted

If the cluster name passed to the script is not found than appropriate error message should be shown. Also I am not sure how can we do it but we need to find the instances where this application is installed , so it can be restarted.
By foolproof if you mean something which will take care of the errors which can occur and can be beneficial for long run, I would really like that. I am willing to provide you what ever information you need, if you can help me. Again  I really appreciate all your help, thanks
ASKER CERTIFIED SOLUTION
Avatar of HonorGod
HonorGod
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of huzefaq

ASKER

Thanks! i actually already found this link yesterday and am planning to go over it right now. But the only problem is that I am newbie to JACl script and I really have hard time understanding this script
Unfortunately, I too find Jacl (Tcl) hard to read.  I've programmed in lots of languages, and remembering how things work in Tcl/Jacl can be a bit of a challenge.

One reason that I would, at least, start with those scripts is that they have apparently been around, and used, and modified for some time (hence the version 3.1 number).  So, I would expect them to be relatively robust.
Avatar of huzefaq

ASKER

I have managed to test the scripts and it is working fine except I need an additional important feature by which i need to back up all the code I am updating.

I have no clue on this, would you have any idea on this

Thanks
Please define what you need by "backup"?

How are you invoking the deploy script?

Do you have everything memorized, and type the wsadmin command in by hand, or do you, by any chance, have a script (*.bat, or *.sh) file that is used to start wsadmin and pass it the necessary parameters?

If you don't, I would consider writing an OS specific script, to do this, and at the same time, copy the EAR file to be deployed to some backup directory using "todays" date.

Does this make sense?