Oracle by Example brandingCreate a Non-JRF Instance Using Oracle WebLogic Server for OCI With New VCN

section 0Before You Begin

This 30-minute tutorial shows you how to provision an Oracle WebLogic Server cluster in Oracle Cloud Infrastructure using Marketplace and Resource Manager.

Background

You can use Oracle WebLogic Server for Oracle Cloud Infrastructure (Oracle WebLogic Server for OCI) applications in the Oracle Cloud Infrastructure Marketplace to provision a cluster of WebLogic Server nodes. The first node hosts the administration server for the domain along with the first managed server. This service can also provision a load balancer to distribute application traffic across the servers in your cluster. Marketplace uses Oracle Resource Manager to provision the network, compute instances, and load balancer as single unit called a stack.

Oracle Cloud Infrastructure Marketplace offers separate services for:

  • Oracle WebLogic Server Standard Edition
  • Oracle WebLogic Server Enterprise Edition - includes clustering
  • Oracle WebLogic Suite - includes Oracle Coherence for increased performance and scalability, and Active Gridlink for RAC for advanced database connectivity

This tutorial uses Oracle WebLogic Server for OCI to create a virtual cloud network (VCN) and subnets in Oracle Cloud Infrastructure to support WebLogic Server and the load balancer. But you can also use an existing VCN and existing subnets if desired. Refer to this tutorial.

This tutorial creates a basic WebLogic Server domain configuration, which does not require a database. Oracle WebLogic Server for OCI can also be used to create a JRF-enabled domain, if you want to build applications with Oracle Application Development Framework (ADF). An existing Oracle Autonomous Database or Oracle Cloud Infrastructure DB System is required in order to provision a JRF-enabled domain. Refer to this tutorial.

Provisioning a domain in Oracle WebLogic Server for OCI requires one or more secrets in Oracle Cloud Infrastructure Vault. Secrets store one or more passwords you would require when creating a WebLogic Server cluster. This tutorial uses a standard vault, which is hosted on a hardware security module (HSM) partition with multiple tenants, and uses a more cost-efficient, key-based metric for billing purposes. A virtual private vault provides greater isolation and performance by allocating a dedicated partition on an HSM. Each type of vault has a separate service limit in your Oracle Cloud Infrastructure tenancy. The limit for secrets spans all vaults. See Service Limits and Oracle Cloud Infrastructure Vault FAQ.

You can estimate the cost of the resources and services that you want to use to provision your instance. See Oracle Cloud Cost Estimator.

What Do You Need?

  • Your Oracle Cloud Infrastructure user name and password. You must belong to at least one group.

    You must be an Oracle Cloud Infrastructure administrator. If you are not an administrator, you must be able to create dynamic groups and policies, use secrets, and view tenancies in your tenancy.

    Controlled access to these tenancy resources are defined in a root-level policy that is typically created by the Oracle Cloud Infrastructure administrator. For a sample root-level policy, download the text file.

  • An Oracle Cloud Infrastructure compartment.

    This tutorial uses a single compartment, which contains the compute instances, load balancer, and network resources that will be created for the domain.

    See Managing Compartments.

  • A dynamic group that lists the OCID of the compartment in which users who are not administrators can create domains. The Oracle Cloud Infrastructure administrator creates this dynamic group. For a sample dynamic group, download the text file and replace the value with your compartment OCID. For dynamic group policies, see this text file.

    See Managing Dynamic Groups.

  • A compartment-level Oracle Cloud Infrastructure policy that enables you to work with resources and create resources in the compartment you intend to use.

    If you are not an administrator:

    • You must be able to access Marketplace applications and Resource Manager to create stacks and jobs, compute instances, networks (optional), and load balancers (optional) in the compartment.
    • You must also be able to create vaults, keys, and secrets in the compartment.

    See Common Policies. For a sample compartment-level policy, download the text file.

  • An SSH public key and corresponding private key.

section 1Create a Vault and a Key

  1. Sign in to the Oracle Cloud Infrastructure console.
  2. Click the navigation menu Menu icon. select Identity & Security, and then click Vault.
  3. Select your Compartment, if not already selected.
  4. Click Create Vault.
  5. For Name, enter WebLogicOCIVault.
  6. Click Create.

    Wait for the vault to be created.

  7. Click the new vault.
  8. Click Master Encryption Keys, and then click Create Key.
  9. For Name, enter WebLogicOCIKey.
  10. Click Create Key.

    Wait for the key to be created and enabled before you create a secret.


section 2Create a Secret for Your WebLogic Password

  1. In the vault, click Secrets, and then click Create Secret.
  2. For Name, enter WebLogicAdminSecret.
  3. Select the key WebLogicOCIKey that you created.
  4. For Secret Contents, enter the password you want to use for the WebLogic Server administrator.

    The password must start with a letter, is between 8 and 30 characters long, contain at least one number, and, optionally, any number of the special characters ($ # _).

  5. Click Create Secret.

    Wait for the secret to be created.

  6. Click the secret name.
  7. Copy the OCID for the secret.

section 3Create the Stack

  1. Click the navigation menu Menu icon. select Marketplace, and then click All Applications.
  2. Click one of the following Oracle WebLogic applications:
    • Oracle WebLogic Server Standard Edition BYOL
    • Oracle WebLogic Server Enterprise Edition BYOL
    • Oracle WebLogic Server Enterprise Edition UCM
    • Oracle WebLogic Suite BYOL
    • Oracle WebLogic Suite UCM

    Note: If you choose Standard Edition, the two managed servers in the domain will not be part of a cluster.

  3. Select a 12c Version of WebLogic Server to run on your domain.
  4. Select the Compartment in which to create the stack.
  5. Select the Oracle Standard Terms and Restrictions check box, and then click Launch Stack.

    The Create Stack page displays.

  6. For Name, enter MyWLStack.
  7. Click Next.

    The Configure Variables page displays.

  8. For Resource Name Prefix, enter MyWLSNew.
  9. For SSH Public Key, upload the SSH public key file or paste the contents of your SSH public key file. After creating the stack, you can connect to the WebLogic Server compute instances by using an SSH client and the corresponding private key.
  10. Select the Create a Virtual Network check box.

    Keep the default selection for the OCI Policies and Provision Load Balancer check boxes.

    Note: The Provision Bastion Instance check box is not available when you create a new VCN. 

  11. For Virtual Cloud Network Name, enter MyWLStackNetwork.

    This tutorial uses the same compartment for Network Compartment.

  12. For WebLogic Server Admin User Name, enter the administrator user name for the new WebLogic Server domain.
  13. For WebLogic Server Admin Secret Compartment, select the compartment where you have the WebLogic Server administration secret and then for Validated Secret for WebLogic Server Admin Password, select the secret that contains the administration password.
  14. For Compute Shape, select the shape of the compute instances.

    See Compute Shapes.

    In case of a flexible shape, for OCPU Count, select the OCPU count for the compute instances..
  15. For Node Count, select 2.
  16. For WebLogic Server Subnet CIDR, enter a CIDR for the new subnet.
  17. For Bastion Host Subnet CIDR, enter a CIDR for the new subnet.
  18. For Bastion Host Shape, select VM.Standard2.1.
  19. For Load Balancer Subnet CIDR, enter a CIDR for the new load balancer subnet.

    Note: When you create a new VCN, you can create a new load balancer only.

  20. For Minimum Bandwidth For Flexible Load Balancer and for Maximum Bandwidth For Flexible Load Balancer, retain the default values. 

    This creates a flexible load balancer with the specified minimum and maximum bandwidth.

  21. Click Next to verify your configuration variables.
  22. Click Create.

    The Job Details page in Oracle Resource Manager is displayed.

    An Apply job is started to provision your stack. To return to this page at a later time, click the navigation menu Menu icon, select Developer Services. Under the Resource Manager group, click Jobs.

  23. Periodically monitor the progress of the Apply job until it is finished.

    If an email address is associated with your user profile, you will receive an email notification.

  24. If the job is in the Failed state, click the job name to view the logs.

section 4Test WebLogic Server

  1. From the Job Details page, click Application Information.
  2. For Bastion Instance, copy the Public IP Address for the compute instance, MyWLSNew-bastion-instance.
  3. From your computer, open an SSH tunnel to use dynamic port forwarding to an unused port on the bastion compute instance. Connect as the opc user and provide the path to the private key that corresponds to the public key that you specified when you created the stack.

    The SSH command format is:

    ssh -C -D port_for_socks_proxy -i path_to_private_key opc@bastion_public_ip

    The following example uses port 1088 for SOCKS proxy:

    ssh -C -D 1088 -i ~/.ssh/mykey.openssh opc@198.51.100.1

  4. In your browser settings, set up the SOCKS (version 5) proxy configuration. Specify your local computer and the same SOCKS port that you used in your SSH command.
  5. Under Application Information, click the Web Logic Server Administration Console URL.

    https://wls_private_ip:7002/console

    The WebLogic Server Administration Console is displayed.

  6. Enter the administrator credentials for the domain.
  7. From the Domain Structure panel on the left, click Deployments.
  8. Locate the sample-app application.
  9. Return to the Oracle Cloud Infrastructure console.
  10. Click the navigation menu Menu icon, select Networking, and then click Load Balancers.
  11. Click MyWLSNew-lb.
  12. Identify the IP Address for this load balancer.
  13. Browse to the following URL:

    https://lb_public_ip/sample-app

    The sample application is displayed.

  14. Return to the load balancer in the Oracle Cloud Infrastructure console.
  15. Click the Virtual Cloud Network link, MyWLSNew-MyWLStackNetwork.
  16. Identify the subnets that were created for your stack.

section 5Delete the Stack (Optional)

  1. Click the navigation menu Menu icon, select Developer Services. Under the Resource Manager group, click Stacks.
  2. Click MyWLStack.
  3. Click Terraform Actions, and then select Destroy.
  4. When prompted for confirmation, click Destroy.
  5. Periodically monitor the progress of the Destroy job until it is finished. Ensure that all resources of the stack are deleted successfully.

    If an email address is associated with your user profile, you will receive an email notification.

  6. Click Delete Stack.

more informationWant to Learn More?