WebSphere Application Server v8 Primer

Size: px
Start display at page:

Download "WebSphere Application Server v8 Primer"

Transcription

1 Chapter 5 WebSphere Application Server v8 Primer By Joseph Amrith Raj

2 Monitored Deployment/Auto-deployment 2 J O S E P H S W E B S P H E R E L I B R A R Y WebSphere Application Server v8 Primer, part-5: Monitored deployment / Auto-deployment WebSphere Library

3 Monitored Deployment/Auto-deployment 3 Table of Contents Monitored Directory... 4 Settings... 4 Deployment... 5 UnDeployment... 6 Final comments:... 7 Next Steps:... 7 References... 8 About Author... 9 Connect With US... 10

4 Monitored Deployment/Auto-deployment 4 In WebSphere Application Server v8, you can specify a deployment directory location which websphere can monitor and do deployments. Monitored Directory Monitor Directory specifies whether to enable monitored directory deployment. You can use monitored directory deployment to install or update an enterprise application file on an application server or cluster, or to uninstall an application file that was previously installed using monitored directory deployment. You can install or update an application file by dragging or copying an EAR, WAR, JAR, SAR to a monitored directory. The application file must conform to the Java Platform, Enterprise Edition (Java EE) specification. To uninstall a deployed application file, remove it from the monitored directory. This sound like the webapps directory of the tomcat server to me, at this moment. Now, let us see how it works. Settings By default, this option is disabled. To enable, go to Applications >Global Deployment Settings 1. Monitor Directory to automatically deploy application must select to enable the option. 2. Monitored Directory Directory where you will place your deploy-able files and websphere should monitor For base (stand-alone) application servers, the default monitored directory is the monitoreddeployableapps/servers/server_name directory of the application server profile. For deployment managers, the default monitored directories are the monitoreddeployableapps/servers/server_name, monitoreddeployableapps/nodes/node_name/servers/server_name,

5 Monitored Deployment/Auto-deployment 5 and monitoreddeployableapps/clusters/cluster_name directories of the deployment manager profile. 3. Polling interval Specifies the number of seconds that elapse before the WebSphere scans a monitored directory for new applications. Default is 5 seconds. 4. Click apply, save change and restart server [ before restart nothing happened in the monitored directory ] For base (stand-alone) application servers, the default monitored directory is the monitoreddeployableapps/servers/server_name directory of the application server profile. For deployment managers, the default monitored directories are the monitoreddeployableapps/servers/server_name, monitoreddeployableapps/nodes/node_name/servers/server_name, and monitoreddeployableapps/clusters/cluster_name directories of the deployment manager profile. I ve changed the Monitored directory to {USER_INSTALL_ROOT}/Autodeploy. Created AutoDeploy directory under C:/IBM/WWebSphere8/profiles/AppServer01 [this is my USER_INSTALL_ROOT]. then restarted server. Now i can see 2 new directories under {USER_INSTALL_ROOT}/Autodeploy with names deployment properties and Servers. Under servers directory i ve another directory with name server1 which is actually my server name. So the directory that is now being monitored by WebSphere is {USER_INSTALL_ROOT}/Autodeploy/servers/server1 Deployment Ok.. Now let s do a deployment. for the testing purpose i took cachemonitor.war from installableapps and placed it in the monitored directory. After 5 seconds.. i can see the following update in my SystemOut.log [4/25/11 11:59:45:538 PDT] WatchService I CWLDD0007I: Event id Start of processing. Event type: Added, File path: C:\IBM\WebSphere8\profiles\AppSrv01\AutoDeploy\servers\server1\CacheMonitor.ear. [4/25/11 11:59:46:273 PDT] AppManagement I CWLDD0028I: Event id The target of the current operation is [WebSphere:cell=josephNode01Cell,node=Node01,server=server1]. [4/25/11 11:59:46:304 PDT] AppManagement I CWLDD0014I: Event id Installing application Dynamic Cache Monitor [4/25/11 11:59:48:741 PDT] webcontainer I com.ibm.ws.webcontainer.internal.webcontainer addextensionfactory SRVE0239I: Extension

6 Monitored Deployment/Auto-deployment 6 Factory [class com.ibm.ws.soa.sca.web.extension.scawebextensionfactory] was registered successfully. [4/25/11 11:59:48:741 PDT] webcontainer I com.ibm.ws.webcontainer.internal.webcontainer addextensionfactory SRVE0240I: Extension Factory [class com.ibm.ws.soa.sca.web.extension.scawebextensionfactory] has been associated with patterns [""]. [4/25/11 11:59:48:788 PDT] WebSphereSCAS I Added Servlet mapping: /dojo [4/25/11 11:59:48:788 PDT] WebSphereSCAS I Added Servlet mapping: /dojo [4/25/11 11:59:48:788 PDT] WebSphereSCAS I Added Servlet mapping: /tuscany [4/25/11 11:59:48:788 PDT] WebSphereSCAS I Added Servlet mapping: /tuscany [4/25/11 11:59:49:538 PDT] InstallSchedu I ADMA5013I: Application Dynamic Cache Monitor installed successfully. This clearly says that the deployment is successful. Now go to Applications > Application Types > websphere enterprise applications in the admin console. I can see the dynamic cache monitor deployed ans started successfully. Another thing i noticed here is it generated [updated] the plugin-cfg.xml and propagated it to my Web Server [IHS]. UnDeployment Now that deployment is successful.. Let s test the UnDeployment. Just remove the application EAR file from monitored directory and wait for 5 sec [polling interval] [4/25/11 12:06:56:268 PDT] WatchService I CWLDD0007I: Event id Start of processing. Event type: Deleted, File path: C:\IBM\WebSphere8\profiles\AppSrv01\AutoDeploy\servers\server1\CacheMonitor.ear. [4/25/11 12:06:57:002 PDT] AppManagement I CWLDD0028I: Event id The target of the current operation is [WebSphere:cell=jpaturiwxp03Node01Cell,node=Node01,server=server1]. [4/25/11 12:06:57:018 PDT] AppManagement I CWLDD0023I: Event id Stopping application Dynamic Cache Monitor [4/25/11 12:06:57:049 PDT] AdminHelper A ADMN1010I: An attempt is made to stop the Dynamic Cache Monitor application. (User ID = defaultwimfilebasedrealm/server:josephnode01cell_node01_server1) [4/25/11 12:06:57:049 PDT] CompositionUn A WSVR0192I: Stopping composition unit WebSphere:cuname=Dynamic Cache Monitor in BLA WebSphere:blaname=Dynamic Cache Monitor. [4/25/11 12:06:57:049 PDT] ApplicationMg A WSVR0217I: Stopping application: Dynamic Cache Monitor [4/25/11 12:06:57:081 PDT] ApplicationMg A WSVR0220I: Application stopped: Dynamic Cache Monitor

7 Monitored Deployment/Auto-deployment 7 [4/25/11 12:06:57:752 PDT] CompositionUn A WSVR0193I: Composition unit WebSphere:cuname=Dynamic Cache Monitor in BLA WebSphere:blaname=Dynamic Cache Monitor stopped. [4/25/11 12:06:57:752 PDT] AppManagement I CWLDD0024I: Event id Application Dynamic Cache Monitor is stopped on: WebSphere:cell=jpaturiwxp03Node01Cell,node=Node01,server=server1,status=success. [4/25/11 12:06:57:752 PDT] AppManagement I CWLDD0017I: Event id Uninstalling application Dynamic Cache Monitor [4/25/11 12:07:00:143 PDT] AppBinaryProc I ADMA7021I: Distribution of application Dynamic Cache Monitor completed successfully. It was successfully uninstalled and again updated and propagated my plugin configuration accordingly. Final comments: It is really simple and works well. I liked the plugin configuration update part. Since i m working on Base/Beta version, we have restrictions on the clusters, LB etc.. It would be interesting to see the deployment on the clusters. Next Steps: Try and use the deploymentproperties file to customize the deployments, updates, undeployments.

8 Monitored Deployment/Auto-deployment 8 References 1. as_v8/was/8.0/administration/wasv8_monitoreddirectorydeploy/player.html

9 Monitored Deployment/Auto-deployment 9 About Author Joseph Amrith Raj is a technical consultant for multiple WebSphere products. He worked on various product consulting and support teams including WebSphere Application Server, WebSphere MQ, WebSphere Message Broker, Enterprise Service Bus and WebSphere Process Server. He has 7 years of experience in administration, troubleshooting, consulting and he has significant experience in architecture, strategy and leadership positions. He is IBM certified for WAS, WMQ, WPS, SOA and Cloud Computing.

10 Monitored Deployment/Auto-deployment 10 Connect With US Get notified on upcoming tutorials Subscribe, to get this WebSphere blog posts directly to your inbox : here Tell us your feedback and what you want Please leave your comments in the comments section below the post Send us suggestions for future topics and improvements about the content at webspherelibrary@live.com Be Connected! Connect with us on Facebook Connect with us on Twitter More about us : profile