X

Proactive insights, news and tips from Oracle WebLogic Server Support. Learn Oracle from Oracle.

  • November 11, 2015

ONS Configuration in WLS

Stephen Felts
Manager

Fast Application Notification (FAN) is
used to provide notification events about services and nodes as they are added
and removed from Oracle Real Application Clusters (RAC) and Oracle Data Guard
environments. The Oracle Notification
System is used as the transport for FAN. You can find all of the details in the following link.

http://www.oracle.com/technetwork/database/options/clustering/overview/fastapplicationnotification12c-2538999.pdf

Configuring ONS has been available
for Active GridLink (AGL) since WebLogic Server (WLS) 10.3.6. In recent releases, auto-ONS has been added so that it is no longer required
to explicitly configure ONS and this is generally recommended. There are some cases where it is necessary to
explicitly configure the ONS configuration.  One reason is to specify a
wallet file and password (this cannot be done with auto-ONS).  Another
reason is to explicitly specify the ONS topology or modify the number of connections.

ONS configuration has been enhanced
in WLS 12.2.1. The OnsNodeList value
must be configured either with a single node list or a property node list (new
in WLS 12.2.1), but not both.  If the WLS OnsNodeList contains an equals
sign (=), it is assumed to be a property node list and not a single node
list. 

Single Node List:

A comma separated list of ONS daemon listen addresses and ports pairs separated
by colon.

Example:

instance1:6200,instance2:6200

Property Node List:

This string is composed of multiple
records, with each record consisting of a key=value pair and terminated by a
newline ('\n') character.  The following keys can be specified.

  • nodes.<id> A list of nodes representing a unique topology of remote
      ONS servers. <id> specifies a unique identifier for the
    node list -- duplicate entries are ignored. The list of nodes configured in any
    list must not include any nodes configured in any other list for the same client
    or duplicate notifications will be sent and delivered.  The list format is
    a comma separated list of ONS daemon listen addresses and ports pairs separated
    by colon.

  • maxconnections.<id> Specifies the maximum number of concurrent connections
         mainted with the ONS servers. <id> specifies
    the node list to which this parameter applies. The default is 3.

  • active.<id> If true the list is active and connections will
    automatically be established to the configured number of ONS servers. If false
    the list is inactive and will only be used as a fail over list in the event
    that no connections for an active list can be established. An inactive list can
    only serve as a fail over for one active list at a time, and once a single
    connection is re-established on the active list, the fail-over list will revert
    to being inactive. Note that only notifications published by the client after a
    list has failed over   will be sent to the fail over list. <id> specifies
    the node list to which this parameter applies. The default is true.

  • remotetimeout  The timeout period, in milliseconds, for a connection
    to each remote server. If the remote server has not responded within this
    timeout period, the connection will be closed. The default is 30 seconds.

Note that although walletfile
and walletpassword are supported in the string, WLS has separate
configuration elements for these values, OnsWalletFile and
OnsWalletPasswordEncrypted.

This example that is equivalent to the
above single node list:

nodes.1=instance1:6200,instance2:6200

If the datasource is configured to
connect to two clusters and receive FAN events from both, for example in the
RAC with Data Guard situation, then two ONS node groups are needed. For example

nodes.1=rac1-scan:6200
maxconnections.1=4

nodes.2=rac2-scan::6200
maxconnections.2=4

Remember that the URL needs a
separate ADDRESS_LIST for each cluster and set LOAD_BALANCE=ON per ADDRESS to
expand SCAN names.

When using the administration
console to configure an Active GridLink datasource, it is not possible to
specify a property node list during the creation flow.  Instead, it is
necessary to modify the ONS Node value on the ONS tab after creation.  The
following figure shows a property node list with two groups for two RAC
clusters.

http://aseng-wiki.us.oracle.com/asengwiki/download/attachments/5175195785/ons1.jpg?version=2&modificationDate=1447274665009&api=v2

The following figure shows the
Monitoring page for ONS statistics.  Note that there are two entries, one
for each host and port pair.

http://aseng-wiki.us.oracle.com/asengwiki/download/attachments/5175195785/ons2.jpg?version=2&modificationDate=1447274768883&api=v2

The following figure shows the
Monitoring page after testing the rac2 ONS node group.

http://aseng-wiki.us.oracle.com/asengwiki/download/attachments/5175195785/ons3.jpg?version=2&modificationDate=1447274792763&api=v2

You can also use WLST to create the
ONS parameter.  Multiple lines in the ONS value need to be separated by
embedded newlines.  This is a complete example for creating an AGL datasource.

connect('weblogic','welcome1','t3://'+'localhost'+':7001')

edit()

startEdit()

cd('/')

dsName='aglds'

cmo.createJDBCSystemResource(dsName)

cd('/JDBCSystemResources/' + dsName + '/JDBCResource/' + dsName)

cmo.setName(dsName)

cmo.setDatasourceType(‘AGL’)

cd('/JDBCSystemResources/' + dsName + '/JDBCResource/' + dsName +
'/JDBCDataSourceParams/' + dsName )

set('JNDINames',jarray.array([String('jdbc/' + dsName )], String))

cd('/JDBCSystemResources/' + dsName + '/JDBCResource/' + dsName +
'/JDBCDriverParams/' + dsName

cmo.setUrl('jdbc:oracle:thin:@(DESCRIPTION=(CONNECT_TIMEOUT=4)
(RETRY_COUNT=30)(RETRY_DELAY=3) (ADDRESS_LIST=(LOAD_BALANCE=on) (ADDRESS=(PROTOCOL=TCP)(HOST=rac1)(PORT=1521)))(ADDRESS_LIST=(LOAD_BALANCE=on)
(ADDRESS=(PROTOCOL=TCP)(HOST=rac2)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=otrade)))')

cmo.setDriverName( 'oracle.jdbc.OracleDriver' )

cmo.setPassword('tiger')

cd('/JDBCSystemResources/' + dsName + '/JDBCResource/' + dsName +
'/JDBCConnectionPoolParams/' + dsName )

cmo.setTestTableName('SQL ISVALID')

cd('/JDBCSystemResources/' + dsName + '/JDBCResource/' + dsName +
'/JDBCDriverParams/' + dsName + '/Properties/' + dsName )

cmo.createProperty('user')

cd('/JDBCSystemResources/' + dsName + '/JDBCResource/' + dsName +
'/JDBCDriverParams/' + dsName + '/Properties/' + dsName + '/Properties/user')

cmo.setValue('scott')

cd('/JDBCSystemResources/' + dsName + '/JDBCResource/' + dsName +
'/JDBCDataSourceParams/' + dsName )

cmo.setGlobalTransactionsProtocol('None')

cd('/JDBCSystemResources/' + dsName + '/JDBCResource/' + dsName +
'/JDBCOracleParams/' + dsName)

cmo.setFanEnabled(true)

cmo.setOnsNodeList('nodes.1=rac1:6200\nnodes.2=rac2:6200\nmaxconnections.1=4\n')

cd('/SystemResources/' + dsName )

set('Targets',jarray.array([ObjectName('com.bea:Name=' + 'myserver' +
',Type=Server')], ObjectName))

save()

activate()

If you can go with automatically configured ONS, that's desirable but if you need to configure ONS explicitly, WLS 12.2.1 has a lot more power to specify exactly what you need. 

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha