Updated Cover Photo

We’ve updated our cover photo to a beautiful sunset on Broome’s Cable Beach.  If you’ve never been there, it’s amazing and worth a trip!

http://www.australia.com/en/places/wa/cable-beach.html

Posted in Uncategorized | Leave a comment

Happy New Year – Federation and HotCache Updates in 12.2.1.2

Been a while since i’ve managed to post here due to some heavy workloads and the usual Christmas and new year break, but am planning to squeeze in some time for Coherence released posts.

In October (yes last year!) we released 12.2.1.2 of Coherence and WebLogic Server. From the Coherence side, this contained a few new features for HotCache but also included a small but significant update for Federation.

Federation

Federation now includes the ability to include custom participants into your topology. Up until now the only “Participants” allowed were Coherence Clusters. Custom participants allow you to define end-points such as files, databases, message bus or any other target you want to.

If you are using the Incubator’s “Push Replication Pattern”, then the addition of custom participants can assist in migrating from Push Replication to Federation. Keep your eyes out for a post on this coming up soon.

HotCache

With this release HotCache includes the following new features:

  • HotCache can be used to warm caches by loading an initial dataset.
  • Support for Oracle SDO_GEOMETRY and XMLType types
  • Configuration has been made easier with ability to use JPA properties to configure  behavior.

 

See the Federation Documentation for more information on custom participants and Release Notes for information on HotCache new features.

 

Posted in News, Uncategorized | Tagged , , , | Leave a comment

JavaOne 2016 Recorded Sessions

If you are like me and were not able to get to JavaOne this year, then please see below for some links to a number of the presentations and sessions.

For the full list of JavaOne 2016 session see here.

 

Posted in News | Tagged , , , | Leave a comment

Replicating HTTP Sessions across Data Centers

Introduction

As explained in a previous post, Coherence*Web is a great feature which allows you to store your HTTP sessions in a Coherence Cluster. Since Coherence introduced Federation in 12.2.1, it has been possible to federate the HTTP session stored in Coherence*Web. This allows applications to replicate HTTP Sessions across data centers, which can tackle scenarios where-in an entire data-center goes down.

The last post on Easier configuration of Federated Caches explained how easy it is to configure federation in a WebLogic Server (WLS) domain. This post will build on that and explain how to extend that approach to federate HTTP sessions as well.

Solution

The first 2 steps for using Federated HTTP session using Coherence*Web is same as explained in Step 1 and Step 2 under the Setup section. Once 2 WLS domains have been installed and configured to use Federation as explained in those steps, the following settings need to be carried out.

Enable Coherence*Web federated session storage

Navigate to the Coherence settings tab of the DataTier WLS Cluster and enable the “Coherence Web Federated Storage Enabled” check-box as shown below

oie_s3OC4PC0TbYL.png

Deploy a web application

Deploy a web application onto the ClientTier WLS cluster. There are 2 configurations required to enable Federated HTTP sessions. They are

Enable Coherence*Web in the web application. This is done by configuring Coherence*Web as the session persistence type in weblogic.xml file of the web application as shown below

weblogic_xml.png

Set the coherence-session-cache-federated context parameter in the web.xml of the web application, as shown below

cwebcontextparam.png

After making the above changes, deploy the web application and navigate to the URL of Site1. Add some entries in the HTTP session. Now use the same HTTP Session to connect to Site2 and validate that the changes done in Site 1 is available.

Using the same HTTP Session

HTTP Sessions are based on Cookies which are exchanged between the Browser and the Server. Once an HTTP session is created, server sends back a session cookie(JSESSIONID is the default cookie name in WebLogic) to the Browser. Browser sends the same cookie back to the server in the subsequent requests. Server validates the cookie that it receives i.e. it checks if the cookie being sent is an existing and valid cookie. In case of Coherence*Web, server checks if the session as provided in the cookie exists in the session cache.

Browser will send the cookie back in the subsequent requests only the host-name of the next request matches that of the previous request. In typical deployments, there will be a load-balancer which sits in front of the managed server of both sites, so that even if a Site goes down, the load-balancer will point the next HTTP requests to the site which is available. We will not cover that topic here, but in-turn suggest a simple way to simulate such a set-up.

Let us assume that host.site1.oracle.com is the hostname of the managed server on Site1 and it IP address is host-site1-ip-address. Similarly host-site2-ip-address will be the IP Address of Site2 managed server. In the hosts file(/etc/hosts in linux), add an entry as follows

host-site1-ip-address webapphost

and access the web application using a browser using “webapphost” as the hostname (Please switch off any proxies in the system for this browser session). Execute some actions in the web application such that the session has some data populated. Keep the browser session open and change the entry in the hosts file as below

host-site2-ip-address webapphost

Refresh the browser session(use ctrl + F5 so that browse refreshes the pages). The next request will go to the managed server of Site2, and the session details should still be available. For example, if the web application was a shopping cart application and you had added some entries in the shopping cart, the shopping cart must be the same when you access the managed server of Site2.

Example Web Application

The attached web application can be used as a sample application to test the set-up. The web application is already Coherence*Web federation enabled as explained above, and can be deployed to the ClientTier WLS clusters of Site1 and Site2 domains. You can use the same script provided in the previous blog if you want to generate such a set-up.

Once the web application is deployed, as explained in “Using the same HTTP Session” section above, make the necessary changes in the hosts file and open the following URL in the web application

http://webapphost:7007/shoppingcart/shopping.jsp

and add some entries in the cart. Change the hosts file to point to Site2 IP Address and then refresh the browser (use ctrl + F5 so that the page is refreshed properly) and navigate to the shopping cart. You should see the items that have been added in the first request, still part of the shopping cart.

JVisualVM

The Coherence JVisaulVM plugin can be used to monitor federation related metric as explained here. The Coherence*Web federated session cache can also be monitored using JVisualVM. Sample screenshot is shown below:

cweb-jvisualvm.png

Posted in Uncategorized | Leave a comment

Coherence Federated caches made easy in WebLogic 12.2.1.1

Introduction

Coherence 12.2.1 introduced Federated Caching which allows asynchronous federation of cache data across multiple geographically dispersed clusters. In Coherence version 12.2.1.1 when using Coherence with Managed Coherence Servers you can now use the WebLogic Server (WLS) Admin console to more easily configure federated caches across a typical 2 domain WLS set-up. (For more information about Federation, please refer to the official documentation here.)

This blog will cover this feature with quick explanations and screenshots including an example script to setup a sample environment.

Federation

Coherence federation supports multiple topologies, including active-active, active-passive, hub-spoke and central-federation. In order to configure federation, the are 2 basic steps which are typically involved:

  • Configure the topology and the list of local and remote participants using a Coherence operational override file
  • Define and use  a federated cache scheme

Configuring Federation

Please read on to carry out either manual or scripted configuration of Federation.

Manual Configuration

In order to manually configure Federation, it is assumed that you have 2 WLS domains set-up with storage-enabled and disabled WLS Clusters(Similar to OOTB example Coherence domain). Each domain must have a Coherence cluster configured and the Coherence cluster names must be different in the the 2 domains. Since the cluster name is used as the “participant” name, and participant names must be unique in a federation topology, the Coherence cluster names must be different. All of the managed servers must be associated with the Coherence cluster in the respective domain.

For this scenario, let us assume that the the WebLogic domains are named Site1 and Site2, and the Coherence clusters defined in the respective domains are named as CohCluster_Site1 and CohCluster_Site2.

Step 1

Navigate to the Federation tab of Coherence cluster settings page of CohCluster_Site1, and select a topology, for example active-active. Enter the remote participant name as “CohCluster_Site2” and enter the host-name of any of the managed server of Site2 in the remote participant host field, as shown below:

oie_Z393NZcaizM1.png

Step 2

Repeat the corresponding step for Site2, Navigate to the Federation tab of Coherence cluster settings page of CohCluster_Site2, and select a topology, for example active-active. Enter the remote participant name as “CohCluster_Site1” and enter the host-name of any of the managed server of Site1 in the remote participant host field, as shown below

site2.png

Step 3

Create a GAR application with  federated-scheme defined in its cache configuration as shown below, and deploy the GAR application to the storage enabled managed servers of Site1 and Site2.

federated-scheme.png

Note: See below of links to an example GAR to download.

Step 4

Create an EAR which packages the GAR file, and a web application which can modify the data in the federated cache, and deploy the EAR onto the storage disabled servers of both WLS domains.

Open the web application deployed onto Site1, modify any cache data, navigate to the same web application in Site2 and see that the modified cache contents are visible in Site2 as well.

Scripted Configuration

The following steps will create 2 pre-configured WLS domains and deploy the required application.

Pre-Requisites

In order to run the example, 2 machines are required. WebLogic 12.2.1.1.0 release must be installed in both the machines and the environment must have been initialized by sourcing $MW_HOME/wlserver/server/setWLSEnv.sh

Running the Example

Let us assume the following:

Site Name
Hostname
Domain
Site1 host.site1.company.com Site1
Site2 host.site2.company.com Site2

The setup.py WLST script used in the following steps has the following arguments:

  • all – command to issue all actions such as creating the domain, deploying, etc.
  • Local domain name
  • Remote cluster name (CohCluster_<Remote Domain Name>
  • Remote host name

For Primary site on host.site1.company.com, execute the following

  • Unzip setup.zip
  • cd federated-example
  • java weblogic.WLST setup.py all Site1 CohCluster_Site2 host.site2.company.com

For Secondary site on host.site2.oracle.com, execute the following

Navigate to the URL http://host.site1.company.com:7007/example-web-app/faces/ContactList.jsp and add some entries in the cache, you can use the insert 20 Random Contacts button for inserting entries.

Navigate to the URL http://host.site2.company.com:7007/example-web-app/faces/ContactList.jsp and validate that the data entered in Site1 is visible. Since federation is asynchronous, there may a small time-lag when the data is populated in Site2. Refresh the browser if the data is not visible in first view.

Monitoring via JVisualVM

The Coherence JVisaulVM plugin can be used to monitor federation related metrics as explained here.

Troubleshooting

If the example does not work, after the WLST commands are executed successfully, the most common error scenario is that Site1 is not able to contact Site2. This can be easily debugged as follows

Navigate to the storage1 server log at $MW_HOME/user_projects/domains/Site1/servers/storage1/logs/storage1.log  and look for the following lines

<1468245534568> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-000000> <2016-07-11 19:28:54.568/215.612 Oracle Coherence GE 12.2.1.2.0 <Error> (thread=Worker:0, member=1): Exception connecting to CohCluster_Site2: com.tangosol.net.messaging.ConnectionException: could not establish a connection to one of the following addresses

The above error indicates that Site1 could not connect to Site2, it can be because of a firewall or wrong host-name etc. The logs will also show more errors(if any) related to Federation.

Posted in Examples, Uncategorized | Tagged , , , | 1 Comment

Announcing Coherence 12.2.1.1.0

Coherence 12.2.1.1.0 has been released and is now available for download from OTN. This builds on the previous 12.2.1.0.0 release in last October and includes some nice extras for those working with Federation and Persistence as well as many additional features for existing and new users of Coherence.

See the Official Coherence Blog for more information.

Posted in News, Uncategorized | Tagged , | Leave a comment

Devoxx Talk on “The Illusion of Statelessness”

Just watched a great talk from Aleksander Seovic (one of the Coherence Architects from Oracle) on “The Illusion of Statelessness” which he gave at Devoxx Poland just last week.

His short 35 min talk covers best practices when building scalable distributed applications, data grids features in general as well as some Coherence capabilities to help scale your applications.

To watch this talk, and others, see this YouTube link.

 

Posted in News, Uncategorized | Tagged , , | Leave a comment