6 Multiserver Domains with Native Clustering

You can create, configure, and administer multiserver domains that are based on native clustering. With native clustering he domain receives a native clustering implementation based on TOTEM, but you cannot take advantage of Oracle Event Processing high availability quality of service options. If you require high availability quality of service options, build your multiserver domain with Oracle Coherence.

This chapter includes the following sections:

6.1 Create a Multiserver Domain

To create a multiserver domain, start by using the Configuration Wizard to create one domain with one server. This is a standalone-server domain.

To convert the standalone-server domain to a multiserver domain, you can do one of two things:

  • Copy and rename the server you just created and then edit the config.xml file for each server so that they all have the same multicast name, multicast port, and domain name.

  • Use the Configuration Wizard to generate additional stand-alone servers and then edit the config.xml file for each server so that they all have the same multicast name, multicast port, and domain name.

The procedures in this chapter use the first approach.

6.2 Create a Multiserver Domain with Default Groups

You can create a multiserver domain that uses only the two predefined deployment groups, the singleton group and the domain group. These groups are described in Singleton Server Deployment Group. In a domain that uses default groups, all servers must be completely homogeneous.

If a domain must support servers that are not completely homogeneous, configure this by creating custom groups. See Create a Multiserver Domain with Custom Groups.

Create a multiserver domain with default groups:

  1. Use the Configuration Wizard to create a standalone-server domain.
  2. Change to the directory where you put the new standalone-server domain when you created it.

    By default, the location is

    Oracle/Middleware/my_oep/user_projects/<domainname>.

  3. Copy and rename the server directory until you have the number of servers that you need under the domain.
  4. Update the config.xml file for each member server by adding a cluster child element of the root config element. The following example shows a server that is part of a domain called myDomain.
    <config>
      <domain>
         <name>myDomain</name>
      </domain>
      <cluster>
         <server-name>myServer1</server-name>
         <multicast-address>239.255.0.1</multicast-address>
         <identity>1</identity>
         <enabled>evs4j</enabled>
      </cluster> 
    ...
    </config>
    

    You can use the following child elements of cluster:

    • server-name: The server-name child element of cluster specifies a unique name for the server. Oracle Event Processing Visualizer uses the value of this element when it displays the server in its console. The default value if the element is not set is Server-identity where identity is the value of the identity element.

    • server-host-name: Specifies the host address/IP used for point-to-point HTTP multiserver communication. Default value is localhost.

      This element is mandatory if one or more Oracle Event Processing servers in your multiserver domain are on different hosts and you plan to manage the multiserver domain using the Oracle Event Processing Visualizer. It is also mandatory if a server is deployed on a host machine that has multiple IP addresses configured (whether in a multiserver or standalone-server environment).

    • multicast-address: The multicast-address element is required unless all servers of the multiserver domain are hosted on the same computer; in that case you can omit the multicast-address element and Oracle Event Processing automatically assigns a multicast address to the multiserver domain based on the computer's IP address.

      If, however, the servers are hosted on different computers, then you must provide an appropriate domain-local address. Oracle recommends you use an address of the form 239.255.X.X, which is what the auto-assigned multicast address is based on.

      All the Oracle Event Processing servers using this multicast-address must be on the same subnet.

    • identity: The identity element identifies the server's identity and must be an integer between 1 and INT_MAX. Oracle Event Processing numerically compares the server identities during multiserver operations; the server with the lowest identity becomes the domain coordinator. Be sure that each server in the multiserver domain has a different identity; if servers have the same identity, the results of multiserver operations are unpredictable.

    • enabled: By default the clustering of the servers in a multiserver domain is disabled for Oracle Coherence, so to enable Oracle Event Processing native clustering use <enabled>evs4j</enabled>.

    Note:

    When adding cluster element child elements, observe the correct element order as Order of Cluster Element Child Elements describes.

    For each server of the multiserver domain, the multicast-address elements must contain the same value. The identity and server-name elements, however, must be different for each server in the multiserver domain. The following example shows the config.xml file of a second server, called myServer2, in the myDomain multiserver domain. The identity value for his server is 2.

    <config>
      <domain>
         <name>myDomain</name>
      </domain>
      <cluster>
         <server-name>myServer2</server-name>
         <multicast-address>239.255.0.1</multicast-address>
         <identity>2</identity>
         <enabled>evs4j</enabled>
      </cluster> 
    ...
    </config>
    

    See Order of Cluster Element Child Elements for a description of additional multiserver-related configuration elements and the required order of child elements.

  5. Optionally, secure the messages that are shared between the servers in a domain by configuring encryption and digital signatures.
  6. Consider enabling Oracle Event Processing Visualizer on a subset of machines within the multiserver domain so that in the event of a failure, you can use Visualizer to troubleshoot from a machine that is still operating.

    Note:

    Enabling Oracle Event Processing Visualizer on a given Oracle Event Processing Server can impact the performance of the server depending on the Oracle Event Processing Visualizer workload.

  7. Start all servers in your multiserver domain.

6.3 Create a Multiserver Domain with Custom Groups

Use this procedure if you plan to deploy applications that are not homogeneous and require a custom configuration. If all of the servers in your domain are completely homogeneous, you do not need to create custom server groups.

Instead, use the predefined default server groups: the singleton group and the domain group. See Create a Multiserver Domain with Default Groups.

In this procedure, assume you have created three servers: myServer1, myServer2, and myServer3. You want myServer1 to be a member of the selector group and myServer2 and myServer3 to be members of the strategy group.

Create a multiserver domain with Custom Server Groups:

  1. Use the Configuration Wizard to create a standalone-server domain.
  2. Copy and rename the server directory until you have the number of servers that you want under the domain.
  3. Update the config.xml file for each member server by adding a cluster child element of the root config element. Within the cluster child element, add a group element to specify the server group.

    Note:

    When you add cluster element child elements, observe the correct element order as Order of Cluster Element Child Elements describes.

    The groups element can include more than one server group name in a case where the server is a member of more than one server group. Separate multiple server group names with commas.

    The groups element is optional. If a server configuration does have a groups element, then the server is a member of the default groups (domain and singleton). For more information about the domain and singleton groups, see Server Groups.

    The following examples show the relevant snippets from the config.xml file for myServer1, myServer2, and myServer3. The groups entry for myServer1 puts it in the selector group. The groups entry for myServer2 and myServer3, put them in the strategy group.

    myServer1:

    <config>
      <domain>
         <name>myDomain</name>
      </domain>
      <cluster>
         <server-name>myServer1</server-name>
         <multicast-address>239.255.0.1</multicast-address>
         <identity>1</identity>
         <enabled>evs4j</enabled>
         <groups>selector</groups>
      </cluster>
    ...
    </config>
    

    myServer2:

    <config>
      <domain>
         <name>myDomain</name>
      </domain>
      <cluster>
         <server-name>myServer2</server-name>
         <multicast-address>239.255.0.1</multicast-address>
         <identity>2</identity> 
         <enabled>evs4j</enabled>
         <groups>strategy</groups>
      </cluster> 
    ...
    </config>
    

    myServer3:

    <config>
      <domain>
         <name>myDomain</name>
      </domain>
      <cluster>
         <server-name>myServer3</server-name>
         <multicast-address>239.255.0.1</multicast-address>
         <identity>3</identity>
         <enabled>evs4j</enabled>
         <groups>strategy</groups>
      </cluster> 
    ...
    </config>
    
  4. Optionally, secure the messages that are shared between the servers in a domain by configuring encryption and digital signatures.
  5. Consider enabling Oracle Event Processing Visualizer on a subset of machines within the multiserver domain so that in the event of a failure, you can use Visualizer to troubleshoot from a machine that is still operating.

    Note:

    Enabling Oracle Event Processing Visualizer on a given Oracle Event Processing Server can impact the performance of the server depending on the Oracle Event Processing Visualizer workload.

  6. Start all servers in your multiserver domain.

6.4 Update a Multiserver Domain

You update servers in a multiserver domain the same way that you update the one server in a standalone-server domain: You either launch the Configuration Wizard or edit the XML properties file to use silent mode. The only difference between updating one server and multiple servers is that in a multiserver domain, you perform the update on each server individually. Using an XML properties file in silent mode might be your best option in a multiserver domain.

When you use the Configuration Wizard to update a server, you can update only the listen port and the JDBC data source configuration. In silent mode, you can add a server and update anything for which there is a data value.

To update the existing configuration of an existing server you provide values for the following data values in the XML properties file:

  • Set CONFIGURATION_OPTION to updateDomain.

  • Set the DOMAIN_NAME and DOMAIN_LOCATION options to the name and location of the existing domain. In the example, the values are myDomain and C:\Oracle\Middleware\my_oep\user_projects\domains, respectively.

  • Set the SERVER_NAME option to the name of the new server you want to add to the existing domain. In the example, this would be myServer2.

  • If this server is running on the same computer as the other servers in the multiserver domain, then be sure that the new server configuration options, such as NETIO_PORT are different than the options for any existing server in the domain. The database options can be the same if you want the new server to connect to the same database as the existing servers.

    If the server is on a different machine than the other servers in the multiserver domain, then the ports do not have to be different.

The following example is an XML properties file that updates an existing server in a multiserver domain.

<?xml version="1.0" encoding="UTF-8"?>
<bea-installer xmlns="http://www.bea.com/plateng/wlevs/config/silent">
  <input-fields>
    <data-value name="CONFIGURATION_OPTION" value="createDomain" />
    <data-value name="USERNAME" value="wlevs" />
    <data-value name="PASSWORD" value="wlevs" />
    <data-value name="SERVER_NAME" value="myServer1" />
    <data-value name="DOMAIN_NAME" value="myDomain" />
    <data-value name="DOMAIN_LOCATION" value="C:\Oracle\Middleware\my_oep\user_projects\domains" />
    <data-value name="NETIO_PORT" value="9102" />
    <data-value name="KEYSTORE_PASSWORD" value="my_keystore_password" /> 
    <data-value name="PRIVATEKEY_PASSWORD" value="my_privatekey_password" />
    <data-value name="DB_URL" value="jdbc:bea:oracle://localhost:1521:XE" />
    <data-value name="DB_USERNAME" value="db_user" />
    <data-value name="DB_PASSWORD" value="db_password" />
  </input-fields>
</bea-installer>

6.5 Secure the Messages Sent Between Servers in a Multiserver Domain

The servers in a multiserver domain update their state by exchanging multiserver-related messages. These messages should be checked for integrity.

You can use a private key to ensure integrity. The private key must be shared by all of the servers within the domain.

Secure Messages Sent Between Servers

  1. Stop all servers in your multiserver domain, if they are currently running.
  2. Edit the config.xml file of each server in the multiserver domain by adding the security child element to the cluster element.

    By default the config.xml file is in Oracle/Middleware/my_oep/user_projects/domains/<domainname>/<servername>/config/

    <config>
      <domain>
         <name>myDomain</name>
      </domain>
      <cluster>
         <server-name>myServer1</server-name>
         <multicast-address>239.255.0.1</multicast-address>
         <identity>1</identity>
         <enabled>evs4j</enabled>
         <security>encrypt</security>
      </cluster> 
    ...
    </config>
    

    You must specify one of the following values for the security child element:

    • none: No security is configured for the multiserver domain. This is the default value.

    • encrypt: Encrypt multiserver messages.

    Observe the correct order of child elements in the cluster element. See Order of Cluster Element Child Elements.

  3. Edit the security-config.xml file for each server in the multiserver domain by adding the encryption-service child element to the config root element.

    By default the security-config.xml file is in Oracle/Middleware/my_oep/user_projects/domains/<domainname>/<servername>/config/

    <config>
      <encryption-service>
         <signature-enabled>true</signature-enabled>
      </encryption-service>
      <css-realm>
       ...
    </config>
    
  4. Ensure that the myDomain/servername/.aesinternal.dat file for each server in the multiserver domain is exactly the same by copying the file from one server to the other servers.

    This file is created by the Configuration Wizard when you first created the server. Oracle Event Processing uses this file for encrypting messages.

  5. Start one of the servers in your domain.

    See Start and Stop a Server in a Multiserver Domain.

    Because of the encryption-service element that you added to the security-config.xml file, Oracle Event Processing creates the *.msasig.dat file in the main server directory. Oracle Event Processing uses this file for digitally signing messages.

  6. Stop the server you just started.
  7. Copy the *.msasig.dat file to the other servers.
  8. If you plan to use Oracle Event Processing Visualizer with the servers in this domain, see Configure SSL in a Multiserver Domain for Visualizer.
  9. Start all servers in your multiserver domain.

6.6 Use Multiserver Domain APIs to Manage Group Membership Changes

In an active-active system, you deploy actively executing applications homogeneously across several servers. There are cases when these homogeneously-deployed applications need to elect a coordinator application to lead. In this case, events that result from the coordinator application are kept and passed to the next component in the EPN. The results of secondary servers are dropped. If the coordinator fails, then one of the secondary servers must be elected as the new coordinator.

To enable this behavior in an application, the adapter or event bean, usually in the role of an event sink, must implement the following interface:

com.bea.wlevs.ede.api.cluster.GroupMembershipListener

This interface enables the event sink to listen for multiserver domain group membership changes. At runtime, Oracle Event Processing calls the onMembershipChange callback method whenever membership changes occur.

The callback method signature follows:

onMembershipChange(Server localIdentity, Configuration groupConfiguration); 

In the implementation of the onMembershipChange callback method, the event sink uses the Server object (localIdentity) to verify if it is the leader. This can be done be comparing localIdentity with the result of Configuration.getCoordinator() run on the second parameter, groupConfiguration. This parameter also allows a server to know what the current members of the group are by executing Configuration.getMembers().

To only keep events when it is a coordinator, the event sink must get a new Server identity every time membership in the group changes. Group membership changes occur when, for example, another server within the group fails and is no longer the coordinator.

The following interface is for listening to membership changes to the domain as a whole, rather than changes to the server group.

com.bea.wlevs.ede.api.cluster.DomainMembershipListener

In a hot-hot configuration, there is a non-zero delay in failure notification. If you use the notification APIs to implement clustering, you will lose and not process events that occur in the window of time between the server failure and the notification being delivered to the new master server.

See Java API Reference for Oracle Event Processing.

6.7 Start and Stop a Server in a Multiserver Domain

To start the servers in a multiserver domain, start each server separately by running its start script. This is the same way you start a server in a standalone server domain.

See Start and Stop a Server in a Standalone-Server Domain for details.

If you have not configured custom groups for the multiserver domain, then all servers are members of just the predefined domain group, which contains all the servers in the multiserver domain, and a singleton group, one for each member server. This means, for example, if there are three servers in the multiserver domain then there are three singleton groups.

If, however, you have configured custom groups for the multiserver domain, then the servers are members of the groups for which they have been configured, as well as the pre-defined groups.