Set variables for Liberty profile servers

Set one or more WebSphere variables before we can use the job manager to remotely install and manage Liberty profile servers. We can set the variables in an console, a wsadmin script, or the registerHost command. The variables specify the root directories to which to install Liberty profile resources and specify search paths for finding resources that are not yet registered with the job manager.

Liberty profile resources include projects, software development kits (Java runtime environments), Liberty profile runtimes, servers, and applications. For more information, see Liberty profile resources.

For an console, wsadmin, or the registerHost command to set values for Liberty profile server variables, start the job manager or the deployment manager.

We can specify values for WebSphere variables and built-in variables.

WebSphere variables

Before we can install Liberty resources using the job manager, set one or more WebSphere variables. The amount of configuration depends on the topology being deployed. We can set values for variables using the job manager console, deployment manager console, wsadmin, or registerHost command.

We can install Liberty resources to a working, non-shared location or to a shared location. Do not share resources that are installed to the working location.

Resources installed to a shared location can be used by Liberty profile servers that are installed to a working location. For example, we can configure working Liberty profile servers to use one or more of the following types of shared resources:

  • Liberty profile runtime

  • Software development kit

  • Application

Install resources in shared locations as read-only. We can share resources within a host or across hosts using disk sharing approaches such as Network File System (NFS).

During resource installation, unless there is a name conflict, the resources in the Liberty profile compressed file are extracted to the working root directory specified by WLP_WORKING_DIR or to the shared directory specified by WLP_SHARED_DIR.

Default variables Description
WLP_WORKING_DIR Installation or inventory search path for nonshared working Liberty profile resources. If a job submission does not specify that the installation or search directory be shared, then the job uses this variable. By default, Liberty resources are installed to the nonshared working directory that this variable defines.

Specify an absolute path for this variable. Do not specify a relative path.

WLP_SHARED_DIR Installation or inventory search path for shared Liberty profile resources. If a job submission specifies that the installation or search directory be shared, then the job uses this variable.

Specify an absolute path for this variable. Do not specify a relative path.

WLP_ADDITIONAL_DIRS (Optional) Specifies additional paths to search for Liberty resources beyond the paths included in the WLP_SHARED_DIR and WLP_WORKING_DIR variables.

We must configure the additional search paths for Liberty resources to:

  • Search for previously installed software development kits managed separately from the job manager.

  • Search for any server resources that are not installed in the default working and shared directories. For example, you might define different installation locations relative to the home directories of several different users. For more information, see the descriptions of the HOME and USER variables.

Specify an absolute path for this variable. Do not specify a relative path.

Built-in variables

When you use the job manager to remotely install and manage Liberty profile servers, we can set the following built-in variables to customize installation locations and Liberty profile configuration files based on operating system home directory, operating system user, host name, and project membership:

HOME

Contains the home directory of the operating system user name used to submit an Install Liberty profile resources job. We can use the HOME variable to set up a working directory that is relative to the home directory of the submitting user; for example:

    WLP_WORKING_DIR=${HOME}/working

USER

Contains the name of the operating system user used to submit an Install Liberty profile resources job. We can use the USER variable to set up a working directory for each user, relative to a global directory; for example:

    WLP_WORKING_DIR=/working/${USER}

When using the HOME variable or the USER variable to customize the installation location, configure the WLP_ADDITIONAL_DIRS variable with the specific directories for each user; for example:

    WLP_ADDITIONAL_DIRS=/usr/home/user1;/usr/home/user2

If we do not include the directories in the WLP_ADDITIONAL_DIRS variable, inventory jobs do not locate the associated Liberty profile resources on the target hosts.

HOSTNAME

Contains the configured host name of the target host where an Install Liberty profile resources job is run. We can use the HOSTNAME variable in the server bootstrap.properties file; for example:

    hostname=${HOSTNAME}

We can use the hostname variable in the server configuration file, server.xml; for example:

    <httpEndpoint host="${hostname}" httpPort="9081" httpsPort="9444" id="defaultHttpEndpoint"/>

CURRENT_PROJECT

Contains the name of the project included in the Liberty profile resources compressed file.

We can set WebSphere variables for all target hosts at a specified scope or set WebSphere variables at a target host level.


Results

After you save the changes, the changes are viewable in the list of variables on a console WebSphere variables page.

Avoid trouble: After you have defined the variables, see Packaging Liberty profile resources for information on how to properly package files for the Install Liberty profile resources job. If we use IBM Installation Manager to install a Liberty profile, create a subdirectory under the location of WLP_WORKING_DIR. This directory will be used to identify this instance of the Liberty profile runtime. Use this directory as the installation directory during installation with IBM Installation Manager. If WLP_WORKING_DIR is set to /liberty/working, for example, create a runtime_1 subdirectory; then, use /liberty/working/runtime_1 as the installation directory during installation using IBM Installation Manager.gotcha


What to do next

We can now submit a job that installs resources from a Liberty profile resources compressed file, as well as an inventory job that searches for previously existing Liberty profile resources.

We can later set variables that override the values of variables for different target hosts or substitute user-defined variables:


Related concepts

  • Liberty profile resources


    Related tasks

  • Submitting jobs to deploy Liberty profile installations
  • Registering host computers with job managers
  • Install Liberty profile resources using the job manager
  • Start and stop the job manager
  • Packaging Liberty profile resources

  • Administrative job types