15 Managing Failover Groups

Learn about how to configure the Oracle Traffic Director instances in a failover group in the active-passive and active-active modes.

This section contains the following topics:

Creating Failover Groups

Learn how to implement a high available pair of Oracle Traffic Director instances by creating failover groups.

Before You Begin

  • Decide the unique VIP address that you want to assign to the failover group.

    • The VIP addresses should belong to the same subnet as that of the nodes in the failover group.

    • The VIP addresses must be accessible to clients.

  • Identify the instances that would be part of the failover group. The nodes should be in the same subnet.

  • Identify the network interface for each node.

    A network interface, on the node where instance is running, upon which the VIP must be managed. The first network interface that results in a match is used as the network interface for the VIP.

    For this comparison, depending on whether the VIP specified for the failover group is an IPv4 or IPv6 address, the administration server considers only those network interfaces on the host that are configured with an IPv4 or IPv6 address, respectively.

  • You can bind to a VIP IP address within the HTTP listener by performing a system configuration that allows you to bind to a non-existing address, as a sort of forward binding. Perform one of the following system configurations:

    echo 1 > /proc/sys/net/ipv4/ip_nonlocal_bind

    or,

    sysctl net.ipv4.ip_nonlocal_bind=1 (change in /etc/sysctl.conf to keep after a reboot)

    Make sure that the IP addresses of the listeners in the configuration for which you want to create a failover group are either an asterisk (*) or the same address as the VIP. Otherwise, requests sent to the VIP will not be routed to the virtual servers.

  • Ensure that the router ID for each failover group is unique.

    If the router ID is not specified, the default router ID will be a random number between 1 and 255.

Creating Failover Groups Using Fusion Middleware Control

To create a failover group by using the Fusion Middleware Control, do the following:

  1. Log in to Fusion Middleware Control, as described in Graphical User Interface-Fusion Middleware Control..

  2. Click the WebLogic Domain button at the upper left corner of the page.

  3. Select Administration > OTD Configurations.

    A list of the available configurations is displayed.

  4. Select the configuration for which you want to create a failover group.

  5. Click the Traffic Director Configuration In the Common Tasks pane.

  6. Select Administration > Failover Groups.

    The Failover Groups page is displayed. It shows a list of the Failover Groups defined for the configuration.

  7. Click Create.

    The New Failover Group wizard is displayed.

  8. Follow the on-screen prompts to complete creation of the failover group by using the details—virtual IP address, network interface, primary, backup instances, and so on—that you decided earlier.

    After the failover group is created, the Results screen of the New Failover Group wizard displays a message confirming successful creation of the failover group.

  9. Click Close on the Results screen.

    The details of the failover group that you just created are displayed on the Failover Groups page.

Creating Failover Groups Using WLST

To create a failover group, run the otd_createFailoverGroup command.

For example, the following command creates an active-passive failover group with the following details:

  • Configuration: ha

  • Primary instance: 1.example.com

  • Backup instance: 2.example.com

  • Virtual IP address: 192.0.2.1

props = {}
props['configuration'] = 'ha'
props['virtual-ip'] = '192.0.2.1'
props['primary-instance'] = '1.example.com'
props['backup-instance'] = '2.example.com'
props['primary-nic'] = 'eth0'
props['backup-nic'] = 'eth0'

props['failover-type'] = 'active-passive'
otd_createFailoverGroup(props)

Note:

After creating a failover group you must run otd_startFailover on those machines as a root user. This is to manually start the failover. If this command is not executed, failover will not start and there will be no high availability.

For example, the following command creates an active-active failover group with the following details:

  • Configuration: ha

  • Primary instance: 1.example.com

  • Backup instance: 2.example.com

  • Virtual IP address: 192.0.2.1

props = {}
props['configuration'] = 'ha'
props['virtual-ip'] = '192.0.2.1'
props['failover-type'] = 'active-active'
otd_createFailoverGroup(props)

Managing Failover Groups

After creating failover groups, you can list them, view their settings, change the primary instance for a failover group, switch the primary and backup instances, and delete them.

To manage the failover groups, the failover daemon needs to run as a privileged user (typically root), otd_startFailover command should be executed as a privileged user on the machines on which the primary and backup instances of the failover group run. Similarly to stop the daemon, you should run the otd_stopFailover. The configuration parameters for the keepalived daemon are stored in a file named keepalived.conf in the config directory of each instance that is part of the failover group. See otd_startFailover and otd_stopFailover commands in the WebLogic Scripting Tool Command Reference for Oracle Traffic Director.

You can view, modify, and delete failover groups by using either Fusion Middleware Control or the WLST. Note that to change the VIP or any property of a failover group, you should delete the failover group and create it afresh.

Managing Failover Groups Using Fusion Middleware Control

To view, modify, and delete failover groups by using the Fusion Middleware Control, do the following:

  1. Log in to Fusion Middleware Control, as described in Graphical User Interface-Fusion Middleware Control.
  2. Click the WebLogic Domain button at the upper left corner of the page.
  3. Select Administration > OTD Configurations.

    A list of the available configurations is displayed.

  4. Select the configuration for which you want to manage failover groups.
  5. Click the Traffic Director Configuration In the Common Tasks pane.
  6. Select Administration > Failover Groups.
  7. The Failover Groups page is displayed. It shows a list of the Failover Groups defined for the configuration.
    • To view the properties of a failover group, click its virtual IP.

    • To switch the hosts for the primary and backup nodes, click the Toggle Primary button. In the resulting dialog box, click OK.

    • To delete a failover group, click the Delete button. In the resulting dialog box, click OK.

  8. If you add or remove a failover instance from an active-active failover group, ensure to stop and start the failover group on all nodes to see the changes.

Note:

  • If you want to assign a different primary or backup instance in a failover group, you should create the failover group afresh.

  • There can be a maximum of 255 failover groups across configurations.

Managing Failover Groups Using WLST

For example, run the otd_listFailoverGroups command, for list of failover groups:

props = {}
props['configuration'] = 'ha'
otd_listFailoverGroups(props)

For example, run the otd_toggleFailovergroupPrimary command, for toggle a failover group:

props = {}
props['configuration'] = 'ha'
props['virtual-ip'] = '10.128.67.44'
otd_toggleFailovergroupPrimary(props)

For example, run the otd_getFailoverGroupProperties command, for change properties of a failover group:

props = {}
props['configuration'] = 'ha'
props['primary-instance'] = '1.example.com'
otd_getFailoverGroupProperties(props)

For example, run the otd_deleteFailoverGroup command, for deleting a failover group:

props = {}
props['configuration'] = 'ha'
props['virtual-ip'] = '10.128.67.44'
otd_deleteFailoverGroup(props)

WLST commands specific to active-active HA

For example, run the otd_addFailoverInstance command, for adding a failover instance:

props = {}
props['configuration'] = 'ha'
props['virtual-ip'] = '10.128.67.44'
props['instance'] = '1.example.com'
props['nic'] = 'eth0'
otd_addFailoverInstance(props)

For example, run the otd_removeFailoverInstance command, for removing a failover instance:

props = {}
props['configuration'] = 'ha'
props['virtual-ip'] = '10.128.67.44'
props['instance'] = '1.example.com'
otd_removeFailoverInstance(props)

For example, run the otd_listFailoverInstances command, for the list of failover instances:

props = {}
props['configuration'] = 'ha'
props['virtual-ip'] = '10.128.67.44'
otd_listFailoverInstances(props)

For example, run the otd_setFailoverInstanceOrder command, for changing the failover instance order.

props = {}
props['configuration'] = 'ha'
props['virtual-ip'] = '10.128.67.44'
props['instances'] = '1.example.com, 2.example.com'
otd_setFailoverInstanceOrder(props)