F Configuring the Distributed Java Object Cache

The Java Object Cache (JOC) should be configured among all the servers running Oracle Web Services Manager and among all the servers running Oracle WebCenter Spaces. This local cache is provided to increase the performance of Oracle WSM and Oracle WebCenter Spaces.

F.1 Configuring the Java Object Cache

The distributed Java Object Cache can be configured using the MW_HOME/oracle_common/bin/configure-joc.py script. This is a Python script which can be used to configure JOC in the managed servers. The script runs in WLST online mode and expects the Administration Server to be up and running.

When configuring JOC ports for Oracle products, Oracle recommends using ports in the 9988 to 9998 range.

Note:

After configuring the Java Object Cache using the wlst commands or configure-joc.py script, all affected managed servers should be restarted for the configurations to take effect.

Usage

This section demonstrates how to configure the distributed Java Object Cache for Oracle Web Services Manager or for Oracle WebCenter Spaces. For other applications such as ADF or WebCenter Custom Apps, substitute the relevant host, port and cluster names where appropriate.

  1. Connect to the Administration Server using the command-line Oracle WebLogic Scripting Tool (WLST).

    MW_HOME/oracle_common/common/bin/wlst.sh
    $ connect()
    

    Enter the Oracle WebLogic Administration user name and password when prompted.

  2. After connecting to the Administration Server using wlst, start the script using the execfile command, for example:

    wls:/mydomain/serverConfig>execfile('MW_HOME/oracle_common/bin/configure-joc.py')
    
  3. Configure JOC for all the managed servers for a given cluster.

    Enter 'y' when the script prompts whether you want to specify a cluster name, and also specify the cluster name and discover port, when prompted. This discovers all the managed servers for the given cluster and configures the JOC. The discover port is common for the entire JOC configuration across the cluster.

    For Oracle Web Services Manager:

    Do you want to specify a cluster name (y/n) <y>
    Enter Cluster Name : WSM_Cluster
    Enter Discover Port : 9991
    

    For Oracle WebCenter Spaces:

    Do you want to specify a cluster name (y/n) <y>
    Enter Cluster Name : Spaces_Cluster
    Enter Discover Port : 9988
    

    Here is a walkthrough for using configure-joc.py for HA environments:

    For Oracle Web Services Manager:

    execfile('MW_HOME/oracle_common/bin/configure-joc.py')
    .
    Enter Hostnames (eg host1,host2) : SOAHOST1, SOAHOST2
    .
    Do you want to specify a cluster name (y/n) <y>y
    .
    Enter Cluster Name : WSM_Cluster
    .
    Enter Discover Port : 9991
    .
    Enter Distribute Mode (true|false) <true> : true
    .
    Do you want to exclude any server(s) from JOC configuration (y/n) <n> n
    

    For Oracle WebCenter Spaces:

    execfile('MW_HOME/oracle_common/bin/configure-joc.py')
    .
    Enter Hostnames (eg host1,host2) : APPHOST1, APPHOST2
    .
    Do you want to specify a cluster name (y/n) <y>y
    .
    Enter Cluster Name : Spaces_Cluster
    .
    Enter Discover Port : 9988
    .
    Enter Distribute Mode (true|false) <true> : true
    .
    Do you want to exclude any server(s) from JOC configuration (y/n) <n> n
    

The script can also be used to perform the following JOC configurations:

  • Configure JOC for all specified managed servers.

    Enter 'n' when the script prompts whether you want to specify a cluster name, and also specify the managed server and discover port, when prompted.

    For Oracle Web Services Manager:

    Do you want to specify a cluster name (y/n) <y>n
    Enter Managed Server and Discover Port (eg WLS_WSM1:9991, WLS_WSM1:9991) : WLS_WSM1:9991,WLS_WSM2:9991
    

    For Oracle WebCenter Spaces:

    Do you want to specify a cluster name (y/n) <y>n
    Enter Managed Server and Discover Port (eg WC_SPACES1:9988, WC_SPACES2:9988) : WC_SPACES1:9988,WC_SPACES2:9988
    
  • Exclude JOC configuration for some managed servers.

    The script allows you to specify the list of managed servers for which the JOC configuration "DistributeMode" will be set to 'false'. Enter 'y' when the script prompts whether you want to exclude any servers from JOC configuration, and enter the managed server names to be excluded, when prompted.

    For Oracle Web Services Manager:

    Do you want to exclude any server(s) from JOC configuration (y/n) <n>y
    Exclude Managed Server List (eg Server1,Server2) : WLS_WSM1,WLS_WSM3
    

    For Oracle WebCenter Spaces:

    Do you want to exclude any server(s) from JOC configuration (y/n) <n>y
    Exclude Managed Server List (eg Server1,Server2) : WC_SPACES1,WC_SPACES3
    
  • Disable the distribution mode for all managed servers.

    The script allows you to disable the distribution to all the managed servers for a specified cluster. Specify 'false' when the script prompts for the distribution mode. By default, the distribution mode is set to 'true'.

You can also configure the Java Object Cache using the HA Power Tools tab in the Oracle WebLogic Administration Console, as described in Chapter 16, "Using HA Power Tools."

Verify the Java Object Cache configuration using the CacheWatcher utility. See Section F.2, "Running CacheWatcher."

F.2 Running CacheWatcher

You can use the CacheWatcher utility to verify your Java Object Cache distributed configuration. CacheWatcher itself becomes a member of the Cache cluster.

For this example, the managed servers in the cluster are WLS_Server1 and WLS_Server2:

  • WLS_Server1 is running on APPHOST1.

  • Start CacheWatcher on APPHOST2. WLS_Server2 should be down.

To run CacheWatcher:

  1. For ORACLE_HOME, use the location of the Oracle Web Center installation. For example, MW_HOME/Oracle_WC1.

  2. For DOMAIN_HOME, use the full path to the location of your domain, under MW_HOME/user_projects/domains.

  3. Server_Name refers to a managed server name. For example, WLS_Server2. Cachewatcher can use the same javacache.xml file that the Managed Server would use.

  4. On APPHOST2, execute the following:

    "java -classpath ORACLE_HOME/modules/oracle.javacache_
    11.1.1/cache.jar:ORACLE_HOME/modules/oracle.odl_11.1.1/ojdl.jar oracle.ias.cache.CacheUtil
    watch -config=DOMAIN_HOME/config/fmwconfig/servers/<Server_Name>/javacache.xml
    
  5. At the CacheWatcher's prompt, type lc and then press Enter.

    A group view appears.

    The group view indicates the number of cache members. The following is an example of a CacheWatcher run:

    java -classpath MW_HOME/modules/oracle.javacache_11.1.1/
    cache.jar:MW_HOME/modules/oracle.odl_11.1.1/ojdl.jar
    oracle.ias.cache.CacheUtil watch -config=DOMAIN_HOME
    /config/fmwconfig/servers/WLS_Server_Server/javacache.xml"
    cache> lc
    VID:    2
    Size:   2
    Column: 0123456789
    CL:     JJ
    GRP0:   11
    ...
    Member Table:
    #1. J57161:145.87.9.15:86AAC2E:11B28D57BE4:-7FFE, 0
    #2. J35578:145.87.9.14:-9E92850:11B28D5F7E0:-7FFF, 1
    

    After starting CacheWatcher on each host, find two members from the view.

    Note:

    CacheWatcher itself is considered a distributed cache instance. To terminate the CacheWatcher shell, type exit and press Enter.