Home > Oracle, weblogic > Deploy the application with Coherence*Web for HTTP session management (Part -4-)

Deploy the application with Coherence*Web for HTTP session management (Part -4-)

Whilst HTTP session replication is a powerful way to enable applications to continue running even in the  event of server failure, the main issue is that the HTTP session information is held in the JVM memory of the running WebLogic server. If your application has lots or users, and or large HTTP session objects this means the application server could soon run out of memory and therefore stop your applications from scaling well. A solution to this problem is to off load the HTTP session management into a Cache. In our case we are going to off load the HTTP sessions into Coherence. This application uses Coherence*Web to achieve this.

In WebLogic Server 12C, Coherence 12C is automatically installed, and if you choose, can be tightly integrated into the WebLogic Management Framework – This means the WebLogic Console can be used to create Coherence Clusters using a concept we called Coherence Managed Servers – the process of creating these is almost identical to creating WebLogic Server Clusters. In the same way that we have just seen in the previous lab nodemanager is used to start, stop, and restart failed Coherence Servers.

The only difference in this version is the WebLogic web application deployment descriptor now has:

<session-descriptor>

<persistent-store-type>coherence-web</persistent-store-type>

</session-descriptor>

  1. Go to Environment -> Servers

Click Control

Select wlsdevManaged-1 and wlsdevManaged-2 and click Shutdown/Force Shutdown now.

Acknowledge the stopping of the servers by clicking Yes..

Ekran Resmi 2015-09-06 21.47.00

  1. Login to the WebLogic Console
  2. Make sure you have clicked Lock and EditEkran Resmi 2015-09-06 21.47.06

Click on Environment / Coherence Clusters

  1. Create a new Coherence Cluster

Click New in the Coherence Cluster table (as above in screenshot)

Name:  wlsdevdayCohCluster

And Click Next.

 Ekran Resmi 2015-09-06 21.47.14

Enter Unicast Listen Port as 8888 and Click Next.Ekran Resmi 2015-09-06 21.47.19

Target the Cluster at the wlsdevCluster and Click Finish.

Ekran Resmi 2015-09-06 21.47.26

Make sure you activate your changes.

  1. Click Lock & Edit. Open the Coherence cluster created, click on tab Well Known Addresses

Create a new one

Name:                          wka

Listen Address:             wins-vbox.localdomain

Listen Port:                  8088

Click OK.

Ekran Resmi 2015-09-06 21.47.32

Make sure you activate your changes.

  1. Click on ‘Loack & Edit’. Go to Environment -> Clusters, click on wlsdevCluster

Click tab Coherence. Verify that the information on the screen is the following:

Coherence Cluster: wlsdevdayCohCluster

Ensure that Local Storage Enabled and Coherence Web Local Storage are NOT CHECKED
This ensures that the WebLogic Cluster will not hold state, and will only be a client of the Coherence Cluster.

Make sure the screen looks like the screenshot below, then click Save. And activate your changes in the end

 Ekran Resmi 2015-09-06 21.47.39

 

  1. Click on ‘Lock & Edit’. Go to Environment, expand Clusters and click Server Templates

Click on wlsdevManaged-Template

Click on tab Coherence

Make sure the following are specified and checked:

Coherence Cluster: wlsdevdayCohCluster

Unicast Listen Address: localhost

Unicast Listen Port: 8088

Checked Unicast Port Auto Adjust

Uncheck Local Storage Enabled

 Ekran Resmi 2015-09-06 21.47.46

 

Click on Save and don’t forget to activate your changes

  1. Now let’s create the new Cluster for the Coherence Managed Servers
  2. As when we created the WebLogic Cluster, in the WebLogic Console go to Clusters, Click on ‘Lock & Edit’ and create a new Dynamic Cluster (This will be a dynamic Coherence cluster!!)
  3. Call the dynamic cluster CoherenceManagedCluster and Click

 Ekran Resmi 2015-09-06 21.47.52

 

Leave the next screen as default, and click Next.

 Ekran Resmi 2015-09-06 21.47.58

 

Select Use a single machine for all dynamic servers and choose Machine and click Next.

Ekran Resmi 2015-09-06 21.48.06

On the screen below, change:
Listen Port for First Server: 9100

SSL Listen Port for First Server: 10100

Click Next.

Ekran Resmi 2015-09-06 21.48.14

Review the final screen, and click Finish (Make sure you active your changes)

Finally, we need to make sure this cluster is part of the Coherence cluster, and able to store data, to do this, go to the list of clusters, click on CoherenceManagedCluster
As on the screenshot below click on the Coherence tab. Click on ‘Lock & Edit’.
Select wlsdevdayCohCluster in the selection box and click SaveEkran Resmi 2015-09-06 21.48.21

Having clicked saved, this will open up 2 check boxes. Make sure these are both ticked as per the screenshot below.

Ekran Resmi 2015-09-06 21.48.28

Click on Save again. Don’t forget to Activate changes.
Click on Server Templates, you should see a new template called
CoherenceManagedCluster-Template. Click on it


Click on tab Coherence. Click on ‘Lock & Edit’

Make sure the following are specified and checked:

Coherence Cluster:                  wlsdevdayCohCluster

Unicast Listen Adddress:          wins-vbox.localdomain

Unicast Listen Port:                  8088

Checked                                  Unicast Port Auto Adjust

Ekran Resmi 2015-09-06 21.48.35 

Click on Save and then activate the changes.

  1. Start the new Coherence servers, Go to Environment -> Servers. Click Control.
    Select CoherenceManagedCluster-1 and CoherenceManagedCluster-2 and click Start to start the servers. Before you go to the next step, wait until these servers are running
  1. Go to Environment -> Servers. Click Control. Select wlsdevManaged-1 and wlsdevManaged-2 and click Start to start the servers. Wait for the servers to get started.
  1. Now deploy the application

As before click Lock & Edit in the change center. .

Select Deployments from the Domain Structure pane.

Click Install.

Enter the Path as “/u01/content/weblogic-innovation-seminars/WInS_Demos/weblogic-basics/lab2”

And Select the ClustWLSSessionSampleCounterAppV1-1.0-SNAPSHOT.war

            Click Next.

Ekran Resmi 2015-09-06 21.48.42

Choose Install this application as an application and Click Next.

Target the Application to wlsdevCluster and Click Next.

 Ekran Resmi 2015-09-06 21.48.50

 

Select Copy this application onto every target for me and Click Finish.

This is the different way to install the application directly to cluster.

Click on ‘Activate Changes’. Check the box near to application and Select Start->Servicing all request->Yes.

  1. Let us do some testing……

As in lab 2, perform an uncontrolled shutdown of the managed server using the kill -9 command. In fact, if you’re brave enough kill both managed servers, Keep the Browser open, and when one of the managed servers comes back continue to use the application – the session state should be maintained as it was held in the Coherence Cache, rather than in WebLogic Servers memory.

Go to Browser and type the URL: http://localhost:7002/ClustWLSSessionSampleCounterAppV1/

Ekran Resmi 2015-09-06 21.49.02

Find out the wlsdevManaged server processes and kill them both.

Ekran Resmi 2015-09-06 21.49.08

Go to the Servers page and you would find that both the servers are being started (by the NodeManager).

Ekran Resmi 2015-09-06 21.49.14

Once one of the servers is started – the page will show the correct data. All this had been stored in Coherence.

Ekran Resmi 2015-09-06 21.49.21

  1. Before going to the next lab, let’s remove coherence configuration and also the same application (ClustWLSSessionSampleCounterAppV1-1.0-SNAPSHOT)..

Go to console, click on ‘Lock & Edit’. Go to Deployments, select ‘ClustWLSSessionSampleCounterAppV1-1.0-SNAPSHOT’ and Stop->Force Stop Now. And then Delete the application. Activate the changes.

Go to console, Lock&Edit, go to Environment -> Clusters.

Click wlsdevCluster, go to Coherence tab and select None for Coherence Cluster.

Save and then Activate your changes.
To reduce resource usage you might also want to stop the coherence servers.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: