Registering host computers with job managers
We must register a remote host computer with a job manager to enable the job manager to access applications, command files, and other resources on the host computer.
Create a job manager profile and start the job manager.
A remote host target is not required to have any WebSphere Application Server products installed. There are no software requirements for this host beyond its operating system. To register remote hosts, we can use the Targets page of an administrative console or the wsadmin registerHost command.
To register Liberty profile servers with a job manager, use a procedure for registering a target with a host. We can set variables for Liberty profile servers in a registerHost command.
- Use the Targets page of the job manager console or the deployment manager console to register hosts.
- Click Jobs > Targets > New Host.
- On the New target page, specify parameters that identify the remote host and specify security information.
- Specify the host computer name in one of the following formats:
- Fully qualified domain name servers (DNS) host name string, such as xmachine.manhattan.ibm.com
- Default short DNS host name string, such as xmachine
- Numeric IP address, such as 127.1.255.3
The host can be the same computer on which the product is installed or a different computer.
- Optionally, specify the operating system of the target host.
- For Administrative user with installation authority, specify an administrative user name for the target host.
- Specify the password or private key file for the administrative user so that the job manager can access and run jobs on the host. If the host does not require a password, we can specify a null String value of "".
- Specify other parameters as needed.
Best practice: Select Save security information and you will not need to enter the user name and password for every job manager action on the host.best-practices
- Click OK.
- Use the wsadmin registerHost command to register hosts. The command is in the JobManagerNode command group.
- Open a command window on the bin directory of the job manager profile.
- Run wsadmin to start wsadmin.sh and, optionally, use the Jython language.
wsadmin -lang jython
- Run the registerHost command to make the host computer a target of the job manager.
AdminTask.registerHost('[-host host_computer -hostProps [ [osType operating_system] [username administrative_user][privateKeyFile key_file_path] [passphrase passphrase][saveSecurity true] ]')host is the computer name of the host to register with the job manager. Specify a host value.
hostProps specifies properties of the host.
defined properties. We can specify one or more defined properties for the registerHost command, or specify
Property name Property description osType The operating system type. Specify osType to enable the command to complete faster. This optional property determines the means for connecting with the host. Valid values are:
- aix
- hpux
- os400
- linux
- solaris
- windows
- os390
username A user with authority to log in to the host. Required. password The password for the given username. A value for password or privateKeyFile must be specified. If the host does not require a password, we can specify a null String value of "". privateKeyFile The path to the private keyfile. If we do not specify a value for password, then specify a value for privateKeyFile. passphrase A passphrase for the privateKeyFile, if needed. saveSecurity Whether to store security properties (username, password, privateKeyFile, passphrase) with the host and used as default values for job submissions. If this property is given a value of true, then the security properties are stored with the host and used for subsequent job submissions to this host. imDataLocations The fully qualified path of one or more Installation Manager data locations. Separate multiple paths by a semicolon. This property is useful if we have non-default Installation Manager data locations on the targets. If an invalid data location is specified, it will not be saved. If the specified data location can be detected by the inventory job, it will not be saved. We can use the find data location job to search for data locations on the system. The find data location job automatically updates this property. AdminTask.registerHost('[-host hostname -hostProps [ [imDataLocations datalocation1; datalocation2] [password ****] [saveSecurity true] [username username] ]]')This property is optional.
property_name A user-defined target property name and value, specified with the format: [property_name property_value]
We can specify paths for Liberty profile variables; for example:
[WLP_WORKING_DIR /working] [WLP_SHARED_DIR /shared] [WLP_ADDITIONAL_DIRS /addl]This example defines three properties.This property is optional.
Alternatively, we can run the registerHost command in interactive mode:
AdminTask.registerHost('-interactive')
Results
After the host is registered with the job manager, the console or wsadmin displays the unique ID (UUID) of the host.
Example
We can set variables for Liberty profiles in the host properties when registering a host with the registerHost command. The variables specify the root directories to which to install Liberty profile resources and specify search paths for finding resources.
- Open a command prompt at the bin directory of the job manager profile.
- Start wsadmin.sh and use the Jython scripting language.
wsadmin -lang jython
- Run an AdminTask registerHost command that specifies the variable name and value.
For example, set the WLP_WORKING_DIR variable to use the C:\liberty directory:
AdminTask.registerHost('-host host -hostProps [[username admin][password password] [saveSecurity true][WLP_WORKING_DIR C:/liberty]]')
What to do next
Verify that the host is registered with the job manager and that the job manager can list the target resources.
Related tasks
Set up a job manager environment Start and stop the administrative agent Start and stop the job manager Registering nodes with the job manager using commands Set variables for Liberty profile servers
JobManagerNode (AdminTask)