Sunday 23 June 2013

Moving a profile to a new host in Websphere Application Server


Hi all,

I have a scenario where I am working with two servers and both are having same setup one is my primary and second is standby. Antecedently my profile is crashed on primary setup while doing some R&D. It is best practice to take backup of your profile before doing any changes but I didn't. After a lot of searching I got a solution to move profile from one server to different. Then I recover my profile by moving standby profile to primary. Here is the process I followed.

Procedure:

  1. Stop all the processes running related to the profile of witch you want to move.
  2. Then run the manageprofiles command with the backupProfile option, and specify the profile
    Name to be backed up and the backup file name with appropoiate location.
    manageprofile.bat -backupProfile -profileName AppSrv02 -backupFile D:\IBM\WebSphere\AppServer\profiles\AppSrv02Backup.zip
  1. When the backup has finished, transfer the backup file from the one server to the another
    server.and run manageprofiles using the restoreProfile option as follows
    manageprofile.bat -restoreProfile -backupFile D:\IBM\WebSphere\AppServer\profiles\AppSrv02Backup.zip
  1. start up wsadmin without connecting to a WebSphere process
    wsadmin.bat -conntype NONE -lang jython
  2. Once wsadmin is ready, invoke the changeHostName utility command for the AdminTask object as
    shows below.
    wsadmin>AdminTask.changeHostName ('[-interactive]')
    *Node Name (nodeName): Node Name of your Profile
    *Host Name (hostName): New host name
    System Name (systemName): (oprional)
    Regenerate Certificates (regenDefaultCert):(oprional)

    Press F to finish.
  1. Invoke the AdminConfig.save() utility command to save changes.
  2. Start the application server and you can see the changes reflected in the admin console

Hope this will help you to change you the only hostname of your profile also.



Effort only fully releases its reward after a person refuses to quit.”

Regards,
Akhilesh B. Humbe

Wednesday 12 June 2013

How to Delete Websphere Application Server Profile ?


Hi all,

Here we are going to discuss how to delete the profile in Websphere Application server environment. I used the following to remove application server profile.

Note: Before deleting profile we need to stop all services associate with it.
e.g. Stop the Application server and webServer if configured.

Procedure:
  1. First list all profiles on a server:
    List the profile using one of these commands
    Windows: was_install_dir\bin\manageprofiles.bat –listProfiles
    UNIX/Linux: was_install_dir/bin/manageprofiles.sh –listProfiles
  2. Remove a WebSphere Application Server profile:
    Delete the profile using one of these commands:
    On Windows: was_install_dir\bin\manageprofiles.bat –delete –profileName profile
    On UNIX/Linux: was_install_dir/bin/manageprofiles.sh –delete –profileName profile
  3. Ensure that references to the deleted profile are removed from the profile registry by running the following command:
    On Windows: was_install_dir\bin\manageprofiles.bat –validateAndUpdateRegistry
    On UNIX/Linux: was_install_dir/bin/manageprofiles.sh –validateAndUpdateRegistry
  4. Delete the profile directory tree (if it was not deleted by the previous action).
    Delete the profile Directory using one of these commands:
    On Windows: was_install_dir\profiles\rmdir /s profileDirectory
    On UNIX/Linux: was_install_dir\profiles\rm -R profileDirectory

Hope this will help you to delete the profile in your environment and for more option of manageprofile run the command manageprofiles.bat –help

Effort only fully releases its reward after a person refuses to quit.”

Regards,
Akhilesh B. Humbe

Monday 3 June 2013

What is Edge Side Include (ESI) ?

ESI caching is an in-memory caching solution that is implemented through the web server plug-in. The ESI processor can cache pages or fragments of pages at the HTTP server layer.
The Web server plug-in contains a built-in ESI processor. The ESI processor can cache whole pages, as well as fragments, providing a higher cache hit ratio. The cache implemented by the ESI processor is an in-memory cache, not a disk cache, therefore, the cache entries are not saved when the Web server is restarted.

When a request is received by the Web server plug-in, it is sent to the ESI processor, unless the ESI processor is disabled. It is enabled by default. If a cache miss occurs, a Surrogate-Capabilities header is added to the request and the request is forwarded to the WebSphere Application Server. If servlet caching is enabled in the application server, and the response is edge cacheable, the application server returns a Surrogate-Control header in response to the WebSphere Application Server plug-in.

The value of the Surrogate-Control response header contains the list of rules that are used by the ESI processor to generate the cache ID. The response is then stored in the ESI cache, using the cache ID as the key. For each ESI include tag in the body of the response, a new request is processed so that each nested include results in either a cache hit or another request that forwards to the application server. When all nested includes have been processed, the page is assembled and returned to the client.

The ESI processor is configurable through the WebSphere Web server plug-in configuration file plugin-cfg.xml. The following is an example of the beginning of this file, which illustrates the ESI configuration options.

After the basic of ESI now the question is How do I use the application cache monitor to display static content on the plug-in Edge Side Include (ESI) cache and clear the plug-in ESI cache without a restart of the web server?

There is default application, the cache monitor application is located in the installableApps directory and is installed as "Dynamic Cache Monitor: The main functions of the "Dynamic Cache Monitor" (CacheMonitor) application as it relates to the static caching in the plug-in ESI cache are:
  • You can manually change the state of the cache without having to restart the web server
  • You can display what is being cached in the plug-in ESI Cache
These functions are only related to static caching in the plug-in ESI. There are additional function related to dynamic caching referenced in the information center topic Cache monitor.
To manage and monitor static caching in the plug-in ESI cache using the WebSphere Application Server application cache monitor go through the following steps.

1. Both the CacheMonitor.ear (Dynamic Cache Monitor ) and DyncCacheEsi.ear     (DyncCacheEsi) applications must be installed. 


2. Change the 3 critical values for management of the plug-in ESI cache and for monitoring using the cache monitor application in the plugin-cfg.xml file



Set esiEnable =true
esiEnable will enable or disable the ESI processor. ESI is enabled by default. If ESI is disabled, then the other ESI options are ignored.

Set esiMaxCacheSize= 1024
esiMaxCacheSize is the maximum size of the cache in 1K byte units. The default maximum size of the cache is 1 megabyte. Each web server process will contain its own cache, so consideration should be given to the cache size as it related to the number of plug-in processes. If the response content has a content-length response header, the web server plug-in checks for the response content size. If the size of the response content body is larger than the available ESI caching space, the response is passed through without being handled by ESI.

Set esiInvalidationMonitor =true
esiInvalidationMonitor, specifies if the ESI processor should receive invalidation from the application server.

3. Following are 3 methods by which entries are removed or made invalid from the ESI cache:

Expired timeout
The default Timeout values is set to 300 seconds. You can change the timeout value by adding the property com.ibm.servlet.file.esi.timeOut to the Java virtual machine (JVM) command line parameters. The following example shows how to set a one minute timeout on static data cached in the plug-in:

-Dcom.ibm.servlet.file.esi.timeOut=60

Purge entry to make room for newer entries:
When the plug-in ESI cache is filled, entries will be purged from the cache based on their pending expiration (those closest to expiration will be purged first).

Explicit invalidation:
The application server or cache monitor application sends an explicit invalidation for a group of entries. For this mechanism to be enabled, the esiInvalidationMonitor property must be set to true and the cache monitor DynaCacheEsi.ear applications must be installed on the application server. The DynaCacheEsi application is located in the installableApps directory and is named DynaCacheEsi.ear .

4. Go to the WebSphere Application Server > Server_Name > Web container and enable servlet Caching



5. To display the static plug-in ESI cache :


http://<hostName>:port/cachemonitor/
where hostname is the hostname of the application server or the web server (if the cache monitor application is mapped to a web server) port is the port of the application sever or the web server.


Notes: You must click Refresh from the Edge Statistics Panel to get updated statistics

Effort only fully releases its reward after a person refuses to quit.”
Regards,
Akhilesh B. Humbe

Sunday 2 June 2013

IBM HTTP Server (Web Server) and Websphere Application Server

 Hi all,
Here we are going to discuss very basic concepts of Web server and application server.
Following are very basic questions but normally we confused on this.
  1. What is difference between Web application server and web server ? like we are using IBM WAS and IHS.
  2. Can I use only one of them without using other ? like can I host a JSP on WAS without using IHS ?
The basic answer for this is, a web server just serves content. In particular, it doesn't have a Java web container or ejb container. An application server has these two extra Java pieces. You can use one without the other. However, you cannot run a J2EE application on a web server. You can certainly host a JSP on WAS without using IHS.
 
The Web server:
A Web server handles the HTTP protocol. If user wants to access any application from the Web browser , the Web server receives an HTTP request first and it responds with an HTTP response, such as sending back an HTML page. After processing a request, a Web server may respond with a static HTML page or image, send a redirect, or delegate the dynamic response generation to some other program. When a request comes into the Web server, the Web server simply passes the request to the program (Application) best able to handle it. The Web server doesn't provide any functionality beyond simply providing an environment in which the server-side program(Application) can execute and pass back the generated responses. The server-side program usually provides for itself such functions as transaction processing, database connectivity, and messaging.

While a Web server may not itself support transactions or database connection pooling, it may employ various strategies for fault tolerance and scalability such as load balancing, caching, and clustering features oftentimes erroneously assigned as features reserved only for application servers.
The Application server:
An application server exposes business logic to client applications through various protocols, possibly including HTTP. While a Web server mainly deals with sending HTML for display in a Web browser, an application server provides access to business logic for use by client application programs. The application program can use this logic just as it would call a method on an object (or a function in the procedural world). Such application server clients can include GUIs (graphical user interface) running on a PC, a Web server, or even other application servers. The information traveling back and forth between an application server and its client is not restricted to simple display markup. Instead, the information is program logic. Since the logic takes the form of data and method calls and dynamic HTML, the client can employ the exposed business logic however it wants. In most cases, the server exposes this business logic through a component API, such as the EJB (Enterprise JavaBean) component model found on J2EE (Java 2 Platform, Enterprise Edition) application servers. Moreover, the application server manages its own resources. Such gate-keeping duties include security, transaction processing, resource pooling, and messaging.

Like a Web server, an application server may also employ various scalability and fault-tolerance techniques. The Web container in WebSphere Application Server has an embedded HTTP transport (the so-called WebContainer Inbound Chain), which allows for direct connection to the application without the need for a separate Web server. While using this transport as a Web server is very handy for testing or development purposes it should not be used in production environments. If the users connect directly to the WebContainer Inbound Chain, then they bypass the plug-in and the workload management it performs, as well as the failover and session affinity mechanisms it provides and not to mention the ESI dynamic caching function in the Web server plug-in, if enabled. For performance and security reasons, it is recommended that you use a stand-alone Web server and the HTTP plug-in for the Web server in a production environment.
Effort only fully releases its reward after a person refuses to quit.”
Regards,
Akhilesh B. Humbe

Popular Posts