The script library provides Jython script procedures to assist in automating your environment. You can save changes to the master configuration repository, disable the automatic saving of configuration changes, or discard configuration changes.
wsadmin>AdminServerManagement.createApplicationServer("myNode", "myServer", "default")
# # My Custom Jython Script - file.py # AdminServerManagement.createApplicationServer("myNode", "Server1", "default") AdminServerManagement.createApplicationServer("myNode", "Server2", "default") # Use one of them as the first member of a cluster AdminClusterManagement.createClusterWithFirstMember("myCluster", "APPLICATION_SERVER", "myNode", "Server1") # Add a second member to the cluster AdminClusterManagement.createClusterMember("myCluster", "myNode", "Server3") # Install an application AdminApplication.installAppWithClusterOption("DefaultApplication", "..\installableApps\DefaultApplication.ear", "myCluster") # Start all servers and applications on the node AdminServerManagement.startAllServers("myNode")Save the custom script and run it from the command line, as the following syntax demonstrates:
bin>wsadmin -language jython -f path/to/your/jython/file.py
The script library saves configuration changes to the master configuration repository by default when each script procedure completes. You can disable or enable the automatic saving of configuration changes with the AdminUtilities.configureAutoSave() script procedure. You can alternatively save changes to the configuration before leaving the wsadmin process by using the AdminConfig.sav() command. You can discard configuration changes with the AdminConfig.reset() command.
In this information ...Related tasks
Related reference
| IBM Redbooks, demos, education, and more(Index) |