Stopping Liberty servers using the job manager
We can submit the Stop Liberty profile server job to stop a Liberty server on one or more target hosts.
Start the job manager if it is not already running.
The Liberty server to stop must be running. See "Starting Liberty servers using the job manager."
Your ID at the job manager must be authorized for the administrator role or the operator role to submit jobs.
When registering a target host with the job manager, we can save operating system security information. When submitting a job to one or more targets for which security information has not been saved, specify an authorized operating system user name and either password or public-private key information for the user name. The security credentials must be valid for all job targets.
A Liberty server requires a Java development kit (JDK) or Java runtime environment (JRE) to run this job. Set the JDK or JRE location by completing one of the following actions:
- Set the JAVA_HOME property to the JDK or JRE location in the server.env file, located in the server directory. The job reads the JAVA_HOME property and sets it on the target environment before running the command to start the server. However, this property is not used by the Liberty server command if we start the server manually.
(ZOS) The server.env file must be in EBCDIC encoding.
- (UNIX) (ZOS) Set the JAVA_HOME property to the JDK or JRE location in the user .bashrc file.
- (UNIX) (ZOS) Append the JDK or JRE path to the PATH environment variable.
- (Windows) Set the JAVA_HOME property to the JDK or JRE location as a system environment variable.
- (Windows) Append the JDK or JRE path to the PATH system variable.
If JAVA_HOME is not specified in server.env or in the user environment, the job manager looks for the JDK or JRE in the user search path.
(UNIX) (ZOS) The job manager cannot access a user's full environment. To specify additional environment variables, set the variables in the SSH exec channel.
- Login as root.
- In the /etc/ssh/sshd_config file, set PermitUserEnvironment to yes.
- Restart sshd. Run stopsrc -s ssh and then startsrc -s ssh.
- Login as the user to run the Liberty server.
- Change directory to the .ssh directory under the user home. Create a property file called environment and, in the file, set JAVA_HOME=absolute_path_to_the_Java_home.
Use the administrative console of the job manager or the deployment manager to stop Liberty servers on one or more target hosts. From the console, choose the Stop Liberty server job, specify server and job options, review the summary, and submit the job.
Instead of using a console, we can run the stopLibertyProfileServer job script in the AdministrativeJobs command group. See the Administrative job types topic.
Tasks
- From the navigation tree of the administrative console, click...
Jobs > Submit
- Choose a job to stop a Liberty.
- Select the Stop Liberty profile server job type from the list.
- Optionally specify a description of the job.
- Click Next.
- Choose the job targets.
- Select a group of targets from the list, or select Target names.
Only groups of targets that are valid for the job type that we selected are displayed in the list of target groups.
- If we selected Target names, then specify a target name and click Add, or click Find and specify the chosen targets on the Find targets page.
- If we did not choose to save security authentication information when registering the target hosts with the job manager, specify an operating system user name and password or public-private key information for access to the target hosts. The security credentials must be valid for all the job targets.
- Click Next.
- Specify parameters for the stop Liberty server job.
- For Server to be stopped, specify the fully-qualified resource ID of the Liberty server to stop. For example, to stop the defaultServer server in the wlp runtime, specify the following resource ID:
runtime/wlp/liberty_server/defaultServer- Click Next.
- Schedule the job.
The times and dates specified are relative to the job manager.
- Optionally specify one or more email addresses where notifications are sent when the job finishes.
If we specify multiple email addresses, separate them with commas.
- Select when the job is available for submission.
- Select the job expiration.
- Optionally specify a recurring interval for the job, a start date and time for the interval, and an end date and time for the interval.
- Click Next.
- Review the summary, and click Finish to submit the job.
The targets run the job and attempt to stop the server.
What to do next
On the Job status page, click the ID of the Stop Liberty profile server job and view the job status. Click the status refresh icon
to refresh the displayed status.
If the job is not successful, view any error messages that result from running the job, correct the error condition, and submit the job again.
If the job is successful, the status on the Target resources page of the server is Stopped. Click Jobs > Target resources > resource_name to see the resource status.
Restart the job manager Starting Liberty servers using the job manager Checking job status Administrative job types Find targets Find target resources Target resources collection