Before You Begin
This 45-minute tutorial shows you how to use Oracle Cloud Infrastructure Marketplace and a DB System database to provision an Oracle WebLogic Server domain and cluster that includes Java Required Files (JRF) components. The tutorial also shows you how to create a Java Database Connectivity (JDBC) custom data source for the DB System database.
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 a 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 subnets in an existing virtual cloud network (VCN) to support WebLogic Server 12c with a load balancer. You can also use existing subnets if desired. By default the WebLogic Server subnet is public and accessible from external clients, but Oracle WebLogic Server for OCI can provision WebLogic Server in a private subnet. Oracle WebLogic Server for OCI also supports provisioning WebLogic Server in a different VCN than the one used by the database.
This tutorial creates a WebLogic Server JRF-enabled domain that includes the Java Required Files components for building applications with Oracle Application Development Framework (ADF). An existing Oracle Cloud Infrastructure DB System or Oracle Autonomous Database is required in order to provision a JRF-enabled domain. This tutorial uses a DB System 12.x database to contain the JRF components.
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 DB System database you intend to use for the JRF-enabled domain, and the compute instances, load balancer, and network resources that will be created for the domain.
- 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.
- 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.
- You must be able to list databases in the compartment that contains your database, and to create network resources in the same compartment.
See Common Policies. For a sample compartment-level policy, download the text file.
- An SSH public key and corresponding private key.
- A bare metal or virtual machine DB System 12.x or higher
database. See Creating Bare Metal and Virtual Machine DB
Systems.
This tutorial uses a virtual machine DB System database for a JRF-enabled domain based on Oracle WebLogic Server 12c. See the text file. You'll need the database name and host name for your DB System database. You'll also need the PDB name, the compartment and VCN where the database is located, and the private key of the SSH key pair that was used to create the database.
By default Oracle WebLogic Server for OCI creates a security list in the VCN on which the database to contain the JRF components is created. This security list allows the WebLogic Server subnet to access the database port.
- (Optional) A database user other than SYS for the custom data source.
Create a Vault and a Key
- Sign in to the Oracle Cloud Infrastructure console.
- Click the navigation menu . select Identity & Security, and then click Vault.
- Select your Compartment, if not already selected.
- Click Create Vault.
- For Name, enter
WebLogicOCIVault
. - Click Create.
- Click the new vault.
- Click Master Encryption Keys, and then click Create Key.
- For Name, enter
WebLogicOCIKey
. - Click Create Key.
Wait for the key to be created and enabled.
Create Secrets for Your WebLogic and Database Passwords
- In the vault, click Secrets, and then click Create Secret.
- For Name, enter
WebLogicAdminSecret
. - Select the key
WebLogicOCIKey
that you created. - For Secret Contents, enter the password you want to use for the WebLogic Server administrator.
- Click Create Secret.
Wait for the secret to be created.
- Click the secret name.
- Copy the OCID for the WebLogic administrator secret.
- Repeat steps 1 through 7 to create a secret for the password of the SYS user to access the DB System database you intend to use.
Obtain Database Information
- In the Oracle Cloud Infrastructure console, click the navigation menu . Select Oracle Database, and then click Bare Metal, VM, and Exadata.
- Select the Compartment where the DB System database is created.
- Click the name of your DB System.
The DB System Details page displays.
- Under Network, locate and copy the values for VCN, Port, Hostname Prefix, and Host Domain Name.
- Click Copy at the end of the Scan
DNS Name value. Save the value.
This step is not applicable if you're using a bare metal database.
- In the Databases table, click your database name, then take note of the values for Database Home and Database Version.
- Return to the DB System Details page. Under Resources, click Nodes. Then copy the Public IP Address of the node.
- Open an SSH connection to the database node as the
opc
user.Tip: You can create an SSH connection from Cloud Shell if you download your database's private key.
ssh -i <path_to_db_private_key> opc@<db_node_public_ip>
- Switch to the
oracle
user.sudo su oracle
- Use SQL*Plus to connect to the database as the
sys
user using thesysdba
privilege.sqlplus / as sysdba
- To verify the PDB name of your database, execute the
following command.
show pdbs
Create a Stack that Uses the DB System Database
- Click the navigation menu , select Marketplace, and then click All Applications.
- 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 target of the custom data source cannot be a cluster.
- Select a WLS 12c version.
- Select the Compartment where you created
the DB System database.
In this tutorial, WebLogic Server and the database are located in the same compartment and VCN.
- Select the Oracle Standard Terms and Restrictions
check box, and then click Launch Stack.
The Create Stack page displays.
- For Name, enter
MyDBSWLStack
. - Click Next.
The Configure Variables page displays.
- For Resource Name Prefix, enter
MyDBSWLS
. - 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.
- Keep the default selection for the OCI Policies, Provision Bastion Instance and Provision Load Balancer check boxes.
- For Network Compartment, select the same compartment that you selected earlier upon launching the stack.
- For Existing Network, select the VCN where the database was created.
- Select the Create New Subnets check box.
- For WebLogic Server Admin User Name, enter the administrator user name for the new WebLogic Server domain.
- 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.
- Select the Provision with JRF check box. Then for Database Strategy, select Database System.
- For DB System Compartment, select the same compartment that you selected earlier.
- Select your DB System.
- For DB System Network Compartment and DB System Network, select the same compartment and VCN that you selected earlier.
- Select the Database Home, Version of Database Home, and Database in the selected DB System.
- Enter the PDB when the selected database is running Oracle Database 12c or later.
- For OCI DB Admin Secret Compartment, select the compartment where you have the database administration secret.
- For Validated Secret for OCI DB Admin Password, enter the OCID of the secret you created to contain the password for the SYS user in the database you selected.
- Enter the Database Listener Port.
- Ensure the Create DB Security List check box is selected.
- For Compute Shape, select the shape of the
compute instances.
See Compute Shapes.
If you select a flexible shape, for OCPU Count, select the OCPU count for the compute instances. - For Node Count, select 2.
- For WebLogic Server Subnet CIDR, enter a CIDR for the new subnet.
- For Bastion Host Subnet CIDR, enter a CIDR for the new subnet.
- For Bastion
Host Shape, select
VM.Standard2.1
. - For Create or Use Existing Load Balancer, select Create New Load Balancer.
- For Load Balancer Subnet CIDR, enter a CIDR for the new load balancer subnet.
- 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.
- Click Next to verify your configuration variables.
- Click Create.
The Job Details page of your stack is displayed in Resource Manager.
An Apply job is started to provision your stack. To return to this page at a later time, click the navigation menu , select Resource Manager, and then click Jobs.
- 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.
- If the job is in the Failed state, click the job name to view the logs.
Access the WebLogic and Fusion Middleware Consoles
- From the Job Details page, click Application Information.
- For Bastion Instance, click Show, and note the Public IP Address for the compute instance, MyDBSWLS-bastion-instance.
- 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
- 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.
- Under Application Information, click the Web
Logic Server Administration Console URL.
https://wls_private_ip:7002/console
The WebLogic Server Administration Console is displayed.
- Enter the administrator credentials for the domain.
- In the Domain Structure panel on the left, note the domain name, MyDBSWLS_domain.
- Click Deployments, then click Next
to browse the table.
Various libraries, modules, and components are installed for a JRF-enabled domain.
The application
sample-app
is also deployed. - Log out from the WebLogic Console.
- Browse to the following URL, then enter the administrator
credentials for the domain:
https://wls_private_ip:7002/em
The Fusion Middleware Control Console is displayed.
- Click Deployments. Verify the
sample-app
application is deployed.
- Log out from the Fusion Middleware Control Console.
- Return to the Oracle Cloud Infrastructure console.
- Click the navigation menu , select Networking, and then click Load Balancers.
- Click MyDBSWLS-lb. This is the load balancer instance.
- Identify the IP Address for this load balancer.
- Browse to the following URL:
https://lb_public_ip/sample-app
The sample application is displayed.
- Return to the load balancer in the Oracle Cloud Infrastructure console.
- Click the Virtual Cloud Network link.
- Identify the subnets that were created for your stack.
Create a JDBC Custom Data Source for the DB System Database
- Access the WebLogic Server Administration Console. In the Change Center box, click Lock & Edit.
- Expand Services and click Data Sources.
- Click New, and then select Generic Data Source.
- For Name, enter
MyDBSDS
. - For JNDI Name, enter
jdbc/MyDBSDS
. - For Database Type, accept the value Oracle. Click Next.
- For Database Driver, select Oracle's Driver (Thin) for Service connections; Versions:Any.
- Click Next twice to advance to the Connection Properties page.
- For Database Name and Host Name,
enter the values based on your DB System database.
To construct the database name and host name, see the text file.
- For Port, enter the database listen port (1521 by default).
- For Database User Name, enter
sys as sysdba
or any user who has been granted database access. - Enter the Password for the database user, and re-enter the password to confirm.
- Click Next, then verify the URL
has the appropriate format based on your selected database.
Example of the URL for a virtual machine 12.x database connection:
jdbc:oracle:thin:@//<db_hostname>-scan.<db_domain>:<db_port>/<pdb_name>.<db_domain>
- Click Test Configuration. When successful,
the following message displays:
Connection test succeeded.
- Click Next to select the target for your custom data source.
- If you created a domain using WLS Standard Edition, select the first managed server, MyDBSWLS_server_1. Otherwise, select all servers in the cluster.
- Click Finish.
Your custom data source is listed in the Data Sources table.
- In the Change Center, click Activate Changes.
Want to Learn More?
- Oracle WebLogic Server for Oracle Cloud Infrastructure Help Center
- Understanding Oracle WebLogic Server
- Oracle WebLogic Server Standard Edition
- Oracle WebLogic Server Enterprise Edition
- Oracle WebLogic Suite
- Overview of Resource Manager
- Overview of the Compute Service
- Bare Metal and Virtual Machine DB Systems
- Overview of Load Balancing
- Overview of Vault
- VCNs and Subnets