Using WLST to Administer an Oracle Java Cloud Service Instance

You can use the WebLogic Scripting Tool (WLST) to administer the Oracle WebLogic Server domain in your Oracle Java Cloud Service instance from a command line or script.

To administer a service instance through WLST, use one of these methods:

  • You can use a secure shell (SSH) to connect to the virtual machine (VM) that hosts the Administration Server and run WLST commands local to the VM. When running WLST commands local to the VM, you can use both WLST online and offline.

    For more information, see Running WLST Commands on a VM

  • You can connect to the Administration Server by using WLST online and run WLST commands remotely, for example, from a command shell in your local environment. When running WLST commands remotely, you can use WLST online only.

Using WLST Online and Offline

You can use WLST as the command-line equivalent to the WebLogic Server Administration Console (WLST online) or as the command-line equivalent to the Configuration Wizard (WLST offline).

Online WLST commands allow you to connect to a running Administration Server and manage the configuration of an active WebLogic domain, view performance data about resources in the domain, or manage security data. The commands also allow you to connect to Managed Servers (although you cannot modify configuration data from Managed Servers).

Offline—that is, without connecting to a running WebLogic Server instance—WLST allows you to create domain templates, create a new domain based on existing templates, or extend an existing, inactive domain. You cannot use WLST offline to view performance data about resources in a WebLogic domain or modify security data. You cannot run offline commands from a remotely-attached Oracle Java Cloud Service because the domain configuration files are not local to your system, so you cannot manipulate them.

Running WLST Commands on a VM

You can run WLST commands from within a VM that includes an Oracle WebLogic Server installation.

Prior to running WLST, identify the public IP address of the VM and connect to it with SSH, as described in Accessing a VM Through a Secure Shell (SSH).

  1. After connecting to the VM, switch to the oracle user:
    $> sudo su - oracle
    

    The oracle user is used to run Oracle applications and utilities on VMs, including WLST.

  2. At the VM prompt, set the domain environment by using the setDomainEnv.sh command, which resides in /u01/data/domains/domain-name/bin:
    $> . ./setDomainEnv.sh
    

    You must use the . to ensure that the environment variables are set in the current shell.

  3. Launch WLST:
    $>java weblogic.WLST
    
  4. Connect to the Administration Server:
    > connect('loginID', 'password', 'admin-server-host:admin-server-port')
    
    For example:
    > connect('weblogic', 'welcome1', 'service-wls-1:7001')
    
You can now use WLST. Refer to the WLST Command and Variable Reference in one of the following publications:

Running WLST Commands from a Different Host

You can run WLST commands from a host that is not the VM running Oracle WebLogic Server in Oracle Java Cloud Service (for example, from your laptop or a separate machine running in the Cloud). Use the WLST installation on this remote machine to connect to your Oracle Java Cloud Service Administration Server.

By default, remote access to the administration console and WLST over port 7002 is disabled for security purposes.

Alternatively, you can create an SSH tunnel to port 9001 on the Administration Server VM, as described in Creating an SSH Tunnel.

To run WLST commands remotely:
  1. Use the Oracle Java Cloud Service console to identify the public IP address of your Administration Server.
  2. Launch a command shell on a machine with an Oracle WebLogic Server installation.
  3. If you have not updated the default SSL configuration of your Administration Server, set the following environment variable to accept the default SSL certificate:
    export WLST_PROPERTIES="-Dweblogic.security.SSL.ignoreHostnameVerification=true -Dweblogic.security.TrustKeyStore=DemoTrust"
    
  4. Navigate to your Oracle WebLogic Server installation and launch WLST using the wlst.sh script.
    /Middleware_Home/oracle_common/common/bin/wlst.sh
    
  5. From the WLST prompt, connect to the Administration Server at port 7002. Specify the WebLogic Server administrative credentials that you specified when you created the service instance.
    > connect('username', 'password', 't3s://adminServerPublicIP:7002')
    

    For example:

    > connect('weblogic', 'welcome1', '10.11.12.13:7002')
    

    If you are accessing the Administration Server VM via an SSH tunnel, connect to localhost:9001 instead.

You can now use WLST to execute additional commands. Refer to the WLST Command and Variable Reference in one of the following publications: