Wsadmin

Wsadmin

The wsadmin is a powerful tool of the IBM WebSphere Application Server (WAS). The use of "wsadmin" tool was widely increased with the IBM WAS version 5.0. The WAS wsadmin tool is used to execute scripts written in JACL and Jython. These scripts are written to automate the tasks like installation, application deployment, configuration changes and run-time operations etc. of IBM WAS.

"wsadmin" and "wscp"

The "wscp" stands for WebSphere Control Program. It was used in older versions of WebSphere Application Server like Version 4.0 and Version 3.5. It was used for configuration as well as run-time operations. Like "wscp", the "wsadmin" is also used for configuration, application deployment and all kind of server operations. The "wsadmin" tool can perform every task which can be done through Graphical User Interface (GUI). It is used with WebSphere Application Server Version 5.0, 5.1, 6.0 and 6.1.

It is very difficult to convert "wscp" scripts to "wsadmin" scripts automatically and vice-versa.

Invoking "wsadmin"

To invoke "wsadmin", following steps may be useful. Note that these steps only work in UNIX-based systems.

#Open the command line window of the machine in which IBM WebSphere Application Server is already installed.
#Go to: "/DeploymentManager/profiles/default(or may be Dmgr/AppSrv)/bin/"
#Here, run "ls" command, it will list all files lied under the "bin" directory.
#Execute the file named wsadmin.sh. To invoke, run './wsadmin.sh' command.
#It will invoke "wsadmin". Now tool is ready to run scripts which may be used for the automation.

Invocation syntax

After invocation of "wsadmin" the command-line window will show the following text:

"wsadmin [-h(help)] [-?] [-c ] [-p ] [-profile ] [-profileName ] [-f ] [-javaoption java_option] [-lang language] [-wsadmin_classpath classpath] [-conntype SOAP [-host host_name] [-port port_number] [-user userid] [-password password] RMI [-host host_name] [-port port_number] [-user userid] [-password password] NONE] "

Options

The text written between squared brackets ( [...] ) are called options of the "wsadmin" tool.
*"-?" is used to get help for the particular syntax.
*"-c" assigns to run a command, there may be more than one "-c" exist for mutiple command assignments.
*"-p" describes the Java properties file.
*"-profile" denotes a profile script. It executes before the command. For example, first the profile script would run then the "-c" runs.
*"-profileName" denotes the name of profile for which the "wsadmin" tool would run. This will help to access the "wsadmin" tool of a profile other than the profile you are currently in.
*"-f" assigns name of a script. The "-f" must be used once.
*"-javaoption" designates a Java non-standard or standard option. The "-javaoption" could be mpre than one.
*"-lang" specifies scripting language. It may be JACL or Jython.
*"-wsadmin_classpath" is used to assign additional classes for scripting operation.
*"-conntype" assigns connection type. It may be SOAP, RMI or NONE. *If "SOAP" or "RMI", then give relevant "host_name", "port_number", "userid" and "password". *If "NONE", then it will run in local mode.
*"-jobid" is used for keeping track of invocation of "wsadmin". It is situated at the beginning of wsadmin log file.
*"-tracefile" assigns log file name and location for the log output.
*"-appendtrace": If "true", then it will append the trace at the end of a log file. If "false", then it will override the log file for the invocation of "wsadmin".

Five objects (commands) of "wsadmin"

The "wsadmin" has five objects (Commands) to execute various administrative operations. The five names are "AdminControl", "AdminConfig", "AdminApp", "AdminTask" and "Help".
*"AdminControl" is used for controlling the IBM WAS. It is associated to work with running objects, to convert data types, to start or stop servers and synchronization with the master repository etc.
*"AdminConfig" is related to configuration-oriented part of the IBM WAS. Creating new node and renaming the node are an example of "AdminConfig" related work.
*"AdminApp" is related to application-oriented part of the IBM WAS. It deals with applications. Installing, uninstalling, modifying and administering the applications are related to "AdminApp".
*"AdminTask" was Introduced with IBM WAS V6.1. It has simplified the administration (though "wsadmin"). For example, It is very trouble-free to change Multiple Virtual Storage system name directly from the node which was very difficult without "AdminTask".
*"Help" is very helpful to decide syntax problem related to above mentioned objects.

Two Modes of "wsadmin"

The "wsadmin" could be operated by two "modes"; a "Remote mode" and a "Local mode".
* Use: The "Remote mode" is used when IBM WAS's Deployment Manager (Dmgr) is running. The "Local Mode" is used when the server is in down status.
* How to enable: The "Remote mode" is connected through TCP network connection while the "Local mode" does not need TCP connection.
* Advantages: * "Remote mode": It can be accessed from the same or other LPAR. Two "Remote mode" clients will never face conflict. Their respective changes will be intellectually handled by the IBM WAS. * "Local mode": It would not have any problems related to SSL certificates. It can work even when the server is down.
* Disadvantages: * "Remote mode": The IBM WAS must not be in "down" status. There may be an issue of SSL certifications conflict. * "Local mode": It will not work efficiently with multiple access because in the multiple access through "Local mode" the synchronization of changes may create a serious issue. The "Local mode" is weaker than "Remote mode" in respect of the security.

Scripting languages: "JACL" and "Jython"

The "wsadmin" supports "JACL" (Java Command Language) and "Jython" (Java, Python) scripting languages. The choice of "JACL" or "Jython" may depend on the programmer's comfortability. The Java/J2EE or C programmer may be more comfortable with "Jython" whereas TCL experts may prefer "JACL". Though the script syntax is different, one fact should not be forgotten that both "JACL" and "Jython" are equally powerful. The IBM® Jacl to Jython Conversion Assistant program is used to convert "wsadmin" "JACL" scripts into "Jython".

Changing default language

In IBM WebSphere Application Server Version 6.1, the "JACL" is deprecated. To use "Jython" as the scripting language, either of the two following ways.
*You may mention "Jython" in the option "-lang" of "wsadmin" invocation syntax. This is not a permanent change because it remains effective for that particular session only. As the "wsadmin" invoked again it will take "JACL" as a scripting language.
*The other way is, to change default language as the "Jython" instead of "JACL".

To change default language, consider the following steps: (It is for Unix based systems.)
*Be in the following directory: /DeploymentManager/profiles/properties
*Run the file named "wsadmin.properties", using ./wsadmin.properties.
*FTP that file. open it and you will find: "com.ibm.ws.scripting.defaultLang=jacl". Just write jython instead of jacl.
*FTP that modified file and the changing default language is completed.
*Keep in mind that this method would change scripting language permanently to "Jython".

Basic difference between "JACL" and "Jython" syntaxes

Here, five basic commands (for getting help for the relevant "objects") are written in their particular syntaxes. The case-sensitiveness in the scripting must be the crucial thing to be taken care of.

Proficiency in scripting

Points to keep in mind

*The case-sensitiveness of the script syntax.
*It is a good practice to assign commands in a script and run that script using "wsadmin -f " rathen than running each commands individually using "wsadmin -c ". So, prefer "wsadmin -f " to get faster execution.
*Always remember to save your changes. To save the changes, you need to validate those changes then save it. If the changes are not validated then the message will be popped out. In this case, there may be several reasons those have generated the conflicts. For example, you have created a application server profile and you have given some name and if there is an another Application Server with a same name already exists, then the validation will not be completed successfully and the error message will be generated. If you have assigned same port numbers then also this kind of problem would occur.
*Use the command, "AdminConfig.save( )" (If "Jython" is used.) or "$AdminConfig save" ( ) (If "JACL" is used.), periodically for persisting updates of configuration.

References

*http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1

External links

* [http://www.ibm.com/support/techdocs WSADMIN Primer by IBM]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • Jython — Infobox Software name = Jython caption = developer = latest release version = 2.2.1 latest release date = 13 October, 2007 latest preview version = 2.5 Alpha 3 latest preview date = 10 September, 2008 operating system = Cross platform platform =… …   Wikipedia

  • IBM WebSphere Application Server — (WAS), a software application server, is the flagship product within IBM s WebSphere brand. WAS is built using open standards such as Java EE, XML, and Web Services. It works with a number of Web servers including Apache HTTP Server, Netscape… …   Wikipedia

  • WebSphere — Logo WebSphere ist eine Produktlinie der Firma IBM, die unterschiedliche Software für Anwendungsintegration, Infrastruktur (z. B. Transaktionen und Warteschlangen) und eine integrierte Entwicklungsumgebung umfasst. Bekannte WebSphere Produkte… …   Deutsch Wikipedia

  • WebSphere Application Server — IBM WebSphere Application Server (WAS, servidor de aplicaciones WebSphere), un servidor de aplicaciones de software, es el producto estrella dentro de la familia WebSphere de IBM. WAS está construido usando estándares abiertos tales como J2EE,… …   Wikipedia Español

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”