wsadmin -c "$adminapp install x:/myapp.ear" -lang jacl
however, this simplicity is deceiving and the preceding example is really just the "hello world" of deployment - a nice demo, but not typical of the real world.
in a real enterprise environment, there are hundreds of interrelated applications spread over dozens of remote application servers, and regular updates that need to be deployed to the right servers, all the while maintaining application availability to users. even worse, most large enterprises have different sets of operating environments, or stages, each requiring different setups for the same application. for example, the security role mappings and the database used for a specific application in a microsoft windows integration stage are likely different from those used for that same application on a linux production server.
the result might be that at 3 a.m. when some random group of 20 applications has just been rebuilt because of an automated production build of source code management (scm) code changes, those particular 20 applications each needs to have its updates deployed to its correct individual application server somewhere in the enterprise. and, although it is 3 a.m. in north america, it is prime time elsewhere in the world, so the application updates need to be done in a way that maintains high application availability. this update build and deployment process is regularly repeated, each time involving a randomly different set of updated applications.
command line wsadmin and jacl/jython scripts 【推荐阅读:Interview With Dan B】
this two-part article discusses application deployment, particularly automated updates, to ibm websphere application servers in a large-scale enterprise environment. it applies to versions 5.0, 5.1, and 6.0, and also includes an introduction to a few version 6.0 enhancements. this article is not intended to be used as a reference for all the details of websphere application server administration, but it does describe the key concepts used, and contains a list of references. although the beginning of the article reviews some fairly basic base server and managed server concepts and operations, much of the remainder of the article will discuss certain complex concepts or operational considerations that will be new even to very experienced enterprise application server administrators.
part 1 discusses wsadmin deployment to base and managed servers. it also discusses why phased deployments are needed to maintain applications in a websphere application server network-deployment managed cell, and how to maintain high availability in such an environment.
part 2 of the article will discuss pre- and post-deployment validation and gradual deployment of incompatible versions of applications. it will also discuss the design and implementation of a downloadable automated deployment example program that illustrates how to automate the deployment of randomly built collections of enterprise applications or updates, and how to automatically target those applications or updates to the correct servers, including stage-specific application setup.
the problem
websphere application server has an extensive administration program, the administration console. it also has an equivalent command-line tool, wsadmin, which can be run interactively and which accepts a file of scripted commands. for scripting, wsadmin supports the two script languages jacl and jython. (see the reference section for links to related material.) in the examples in this artic... 下一页