Oracle WebLogic Server 12c: Creating a Basic Cluster

Overview

    Purpose

    This tutorial shows you how to use the Oracle WebLogic Server 12c administration console to configure a basic cluster.

    Time to Complete

    Approximately 1/2 hour

    Introduction

    A WebLogic Server cluster consists of multiple managed servers running simultaneously, running the same applications, and working together to provide increased scalability and reliability. A cluster appears to a client as one WebLogic Server instance. Web application client requests go to the cluster proxy, which passes those requests to one of the servers in the cluster. A cluster proxy can be a web server, a hardware load balancer, or even another instance of WebLogic Server itself. The managed servers that make up a cluster can run on the same machine or on different machines. For increased reliability, managed servers in a cluster typically run on more than one machine.

    This tutorial shows you how to use the Oracle WebLogic Server 12c (12.1.3) administration console to create a basic cluster and add servers to it. Additional tutorials extend this cluster's capabilities to support load balancing and failover of Java Platform, Enterprise Edition applications.

    Hardware and Software Requirements

    • Oracle Linux 5.6+
    • Oracle WebLogic Server 12c (12.1.3)

    Prerequisites

    Before starting this tutorial, you should have completed the Oracle by Example tutorials titled:

    1. Oracle WebLogic Server 12c: Installing WebLogic Server and Creating a Domain
    2. Oracle WebLogic Server 12c: Configuring Managed Servers

Creating a Cluster of Existing Servers

    To create a cluster of existing managed servers, perform the following steps:

    If the administration server of the domain is not already running, start it.

    1. Open a Terminal window and navigate to the domain directory. In this tutorial, the domain directory is /scratch/domains/mydomain.
    2. In the domain directory, enter the following command: $> ./startWebLogic.sh.
    3. At the prompt, enter the credentials of the domain administrator. In this tutorial, the username is weblogic and the password is Welcome1.
    4. Note: The password is not displayed.

    If any of the managed servers of the domain are running, shut them down.

    1. Open a web browser and enter the URL for the administration console: http://hostname:port/console. In this tutorial, the URL is http://<ip_address>:7001/console.

      Note: Replace <ip_address> with the host name or IP address of your administration server.

    2. On the Welcome screen, log in with the username and password that you entered to start the administration server.
    3. In the administration console, under Domain Structure, expand Environment, and then click Servers.
    4. On the Control tab, under Summary of Servers, select the check box for each running managed server, and then select Force Shutdown Now from the Shutdown list.
    5. At the prompt to confirm the forced shutdown, click Yes, refresh your browser, and ensure that all managed servers show the SHUTDOWN state.

    Creating a cluster is a change to the domain's configuration, so you must first lock the configuration. In the Change Center, click Lock & Edit.

    Under Domain Structure, expand Environment, click Clusters, and then select Cluster from the New list above the Clusters table.

    On the Create a New Cluster page, enter cluster1 for the name, select Unicast for the messaging mode, leave Unicast Broadcast Channel blank, and then click OK.

    Note: Because Unicast is selected, the two Multicast fields are disabled.

    A message indicates that the cluster was created successfully.

    In the Clusters table, click cluster1 (the name of the new cluster). In "Settings for cluster1," click the Configuration tab and the Servers subtab, and then click Add in the Servers table.

    On the Add a Server to Cluster page, ensure that Select an existing server, and add it as a member of this cluster is selected, select a managed server, and then click Finish.

    Repeat step 7 to add the two remaining managed servers to the cluster.

    In the Change Center, click Activate Changes.

    The following message is displayed: "All changes have been activated. No restarts are necessary."

Starting the Clustered Servers

    To start the managed servers that are now part of a cluster, perform the following steps:

    Start server1.

    1. Open a Terminal window and navigate to the bin directory under your domain directory. In this tutorial, the domain directory is /scratch/domains/mydomain.
    2. Enter the following command: startManagedWebLogic.sh.
    3. This command takes two arguments:

      • The name of the managed server that you want to start
      • The URL of the administration server

      In this tutorial, those arguments are:

      • server1
      • http://<ip_address>:7001

      Note: Replace <ip_address> with the host name or IP address of your administration server.

    4. At the prompt for a username and password, enter the credentials of the domain administrator.

      Note: The password is not displayed.

    In the Terminal window, look for messages from the <Cluster> subsystem, and notice the message that indicates the server is listening for communication from other cluster members. To ensure that the server starts successfully, wait for the following message: The server started in RUNNING mode.

    In two other Terminal windows, repeat steps 1 and 2 to start the server2 and server3 managed servers.

Monitoring the Cluster

    To monitor the cluster by using the WebLogic Server administration console, perform the following steps:

    In the administration console, under Domain Structure, expand Environment, click Clusters, and then click cluster1 in the Clusters table.

    Under "Settings for cluster1," click the Monitoring tab and the Summary subtab.

    The table under the Summary subtab indicates that all three managed servers are currently participating in the cluster. Other cluster information is also displayed. To see even more information in the table, click the Customize this table link.

    In the Available area, select columns of interest, click the right arrow to add them to the Chosen area, and then click Apply.

    You can also move columns that do not interest you from Chosen to Available.

Summary

    In this tutorial, you learned how to:

    • Use the administration console to define a new cluster
    • Add servers to a cluster
    • Use server log messages to confirm a server's participation in a cluster
    • Use the administration console to monitor a cluster

    Resources

    Credits

    • Lead Curriculum Developer: Bill Bell
    • Original Oracle by Example tutorial for version 11g created by: TJ Palazzolo
    • Other Contributors: Susan Moxley

To navigate this Oracle by Example tutorial, note the following:

Hide Header Buttons:
Click the title to hide the buttons in the header. To show the buttons again, click the title again.
Topic List:
Click a topic to navigate to that section.
Expand All Topics:
Click the button to show or hide the details for the sections. By default, all topics are collapsed.
Hide All Images:
Click the button to show or hide the screenshots. By default, all images are displayed.
Print:
Click the button to print the content. The content that is currently displayed or hidden is printed.

To navigate to a particular section in this tutorial, select the topic from the list.