Search code examples
webspherejython

IBM WAS wsadmin update cluster app


I wrote a jython script for updating an IBM WAS application server

AdminApp.update("MyEAR", "app", ["-appname", "MyEAR",
                "-target", "+WebSphere:" + cellName + "," + nodeName + "," + serverName,
                "-contents", "./MyEAR.ear",
                "-operation", "update"])
AdminConfig.save()

where cellName, nodeName and serverName are arg from command line.

SO the questions is: How can I update a cluster using Jython and AdminApp.update command ? What will be the difference between server and cluster update.


Solution

  • You don't have to re-supply the target if you are only updating the contents of the application.

    In general the AdminApp.update() will merge "bindings" when using -operation update.

    So something like this may be all you need:

    AdminApp.update("MyEAR", "app", ["-appname", "MyEAR",
                    "-contents", "./MyEAR.ear",
                    "-operation", "update"])
    AdminConfig.save()
    

    Note in that same link there are some other options like update.ignore.new, and update.ignore.old if you need different merging behavior.