F Configuring the Distributed Java Object Cache

Configure the Java Object Cache (JOC) among all the servers running Oracle Web Services Manager (WSM) and among all the servers running the Oracle WebCenter Portal's Spaces application. This procedure is optional, but increases the performance of Oracle WSM by keeping a local cache instead of having to search for a cache.

F.1 Configuring the Java Object Cache

Configure the distributed Java Object Cache using the MW_HOME/oracle_common/bin/configure-joc.py script, a Python script that you can use 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, restart all affected managed servers for the configurations to take effect.

This procedure describes how to configure the distributed Java Object Cache for Oracle Web Services Manager or for the Spaces application. For other applications, 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).

    ORACLE_HOME/common/bin/wlst.sh
    $ connect()
    

    Enter the Oracle WebLogic Administration user name and password.

  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 the Spaces application:

    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 the Spaces application:

    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 the Spaces application:

    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 enables 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 the Spaces application:

    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 enables 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; see 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.

To run CacheWatcher:

  1. On APPHOST2, run 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
    

    Where:

    • For ORACLE_HOME, use the location of the Oracle WebCenter Portal installation. For example, MW_HOME/Oracle_WC1.

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

    • 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.

  2. At the CacheWatcher's prompt, type lc and then press Enter.

    A group view appears. It 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.