Remote deployment to Websphere 6.1.x using wsadmin
Asked Answered
E

3

10

I am trying to remotely deploy a war file to a websphere application server. I understand this is possible to do using wsadmin, but I am a Websphere newb.

I know I can run wsadmin and connect using SOAP to the remote app server, but that is where I am at.

This seems like it should be a common use case, can anyone help me with?

I suppose the use case follows: 1. Update the application 2. Save all changes 3. Restart the remote application server

I am going to do the deployment using either Hudson WAS Builder or Maven, whichever works.

Thanks for your help

Eisenhower answered 22/1, 2010 at 16:6 Comment(0)
D
3

Since the WAS Builder Plugin is relatively new, I haven't tested it (The evaluation is already on the ToDo list). For running deployments from the command line we use jython-scripts and wsadmin. My understanding is that I need to be on the machine where I want to deploy. You can deploy to a different machine id your local wsadmin is on the level than your target machine (same version and same feature packs).

for more information on wsadmin see http://publib.boulder.ibm.com/infocenter/wsdoc400/v6r0/index.jsp?topic=/com.ibm.websphere.iseries.doc/info/ae/ae/rxml_commandline.html

BTW, when you deploy using the web based admin console, there is a link somewhere at the end of the deployment process that shows you the jython command. Don't use jacl, since WAS 7 only uses jython.

Danley answered 22/1, 2010 at 19:55 Comment(5)
Thanks for the response. I see that I have to create a script, so I am brand new here. I want to 1)update the app 2)AdminConfig.save 4) wait until app is ready 4)shutdown server and 5)start server in the script. The only thing I don't know how to do is script 4) above - wait until app isReady returns trueEisenhower
When the AdminConfig.save() returns the server is ready to be restarted. You can only restart the server using the script if you have WAS Network Deployment. Otherwise you have to use the Stopserver and startserver scripts (same directory than wsadmin). If you have WAS installed as a windows service, you need to use 'net start <was service name>' instead of the sartserver script otherwise it will start as a user process instead of a service.Danley
I found that after the AdminConfig.save(), I did AdminApp.isAppReady and it returned false. I did a getDeployStatus (or something like that) and it returned "processing", where it was still extracting the binaries and such. My understanding is I have to wait until that is done before restarting the server. I am doing WAS Network Deployment. WAS is running on linux. I just found some sample scripts I am going to try out at ibm.com/developerworks/websphere/library/samples/…Eisenhower
OK, that seems to be some WAS ND specifics. You don't need to do that for the non-clustered (not ND) version. AdminConfig.save() returns when it is done saving. For a non-clustered version you can start right away. In a clustered version, you just saved to the Deployment Manager. The Manager needs to propagate the changes to the cluster nodes. I think at this point AdminApp.isAppReady() comes into play.Danley
I found some useful sample auto deploy scripts on IBM at ibm.com/developerworks/websphere/library/samples/… . The auto-deployment follows a practice that we do not employ, so I had to modify the jython scripts to do what I wanted to, but I was able to tailor them to suit my needs, plus I learned a little along the way. Thanks for your help.Eisenhower
P
5

This question is pretty old, but id like to show how we do this remotly. In this case with Ant

<target name="postbuild">
    <exec executable="C:\MyThinClient\wsadmin.bat" failonerror="true">
        <arg line="-conntype SOAP -host ${deployServer} -port ${deployPort} -user ${deployUser} -password ${deployPassword} -c" />
        <arg value="$AdminApp update ${projectName}EAR app {-operation update -contents {${artifactsDir}/${projectName}-${buildVersion}.ear}}" />
    </exec>
</target>

Given the correct setup of the wsadmin.bat you can run this from any server (without WAS installed) At least on WAS 6.1/7.0 ND this will only restart the application with the new binaries, not the whole server

Poop answered 7/10, 2010 at 11:27 Comment(2)
What did you have to do to get wsadmin.bat to run without WAS installed?Augment
Nevermind, found some documentation: linkAugment
D
3

Since the WAS Builder Plugin is relatively new, I haven't tested it (The evaluation is already on the ToDo list). For running deployments from the command line we use jython-scripts and wsadmin. My understanding is that I need to be on the machine where I want to deploy. You can deploy to a different machine id your local wsadmin is on the level than your target machine (same version and same feature packs).

for more information on wsadmin see http://publib.boulder.ibm.com/infocenter/wsdoc400/v6r0/index.jsp?topic=/com.ibm.websphere.iseries.doc/info/ae/ae/rxml_commandline.html

BTW, when you deploy using the web based admin console, there is a link somewhere at the end of the deployment process that shows you the jython command. Don't use jacl, since WAS 7 only uses jython.

Danley answered 22/1, 2010 at 19:55 Comment(5)
Thanks for the response. I see that I have to create a script, so I am brand new here. I want to 1)update the app 2)AdminConfig.save 4) wait until app is ready 4)shutdown server and 5)start server in the script. The only thing I don't know how to do is script 4) above - wait until app isReady returns trueEisenhower
When the AdminConfig.save() returns the server is ready to be restarted. You can only restart the server using the script if you have WAS Network Deployment. Otherwise you have to use the Stopserver and startserver scripts (same directory than wsadmin). If you have WAS installed as a windows service, you need to use 'net start <was service name>' instead of the sartserver script otherwise it will start as a user process instead of a service.Danley
I found that after the AdminConfig.save(), I did AdminApp.isAppReady and it returned false. I did a getDeployStatus (or something like that) and it returned "processing", where it was still extracting the binaries and such. My understanding is I have to wait until that is done before restarting the server. I am doing WAS Network Deployment. WAS is running on linux. I just found some sample scripts I am going to try out at ibm.com/developerworks/websphere/library/samples/…Eisenhower
OK, that seems to be some WAS ND specifics. You don't need to do that for the non-clustered (not ND) version. AdminConfig.save() returns when it is done saving. For a non-clustered version you can start right away. In a clustered version, you just saved to the Deployment Manager. The Manager needs to propagate the changes to the cluster nodes. I think at this point AdminApp.isAppReady() comes into play.Danley
I found some useful sample auto deploy scripts on IBM at ibm.com/developerworks/websphere/library/samples/… . The auto-deployment follows a practice that we do not employ, so I had to modify the jython scripts to do what I wanted to, but I was able to tailor them to suit my needs, plus I learned a little along the way. Thanks for your help.Eisenhower
E
2

The link to the scripts didn't show up right in my comment, so here it is: IBM SAMPLE SCRIPTS

Eisenhower answered 28/1, 2010 at 13:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.