Applying properties files to configure servers using the job manager

In a flexible management environment, we can submit the Configure properties job to apply properties files to application servers managed by the job manager. After you edit a properties file that is intended for a managed appserver node, use the job manager to distribute the properties file to the managed node and apply the changed file to update the appserver configuration.

Properties files provide a way to query and change the product configuration. The files list the most commonly used properties in name and value pairs.

Before we can submit a job to apply a properties file, do the following:

  1. Start the job manager. If applying the properties file to a dmgr node, start the dmgr and the federated node of the dmgr. If applying the properties file to a stand-alone appserver node, start the administrative agent. The target nodes must be managed by the job manager.

  2. Use the extractConfigProperties command in the PropertiesBasedConfiguration command group for AdminTask to extract a properties file of an appserver that is managed by the job manager. You must run the extractConfigProperties command locally or run a wsadmin script that extracts the properties file in a Run wsadmin script job. The job manager does not have a job that specifically extracts a properties file.

    For example, suppose you want to extract the server configuration of an appserver node that has a server named server1 and a profile named AppSrv02. Run the following wsadmin commands from the bin directory of the AppSrv02 profile:

    wsadmin -lang jython
    
    AdminTask.extractConfigProperties('[-propertiesFileName server.props -configData Server=server1 ]')
    

    The product extracts the server configuration to a file named server.props in the bin directory of the AppSrv02 profile.

  3. Open an editor on the properties file, change the value of one or more properties, and save the file.

    The properties file must be in UTF-8. The generated file is in UTF-8 automatically. Ensure that the file remains in UTF-8 after any edits. Use an editor that handles UTF-8, or US-ASCII if the file does not have characters outside the 7-bit US-ASCII character set.

  4. Copy the properties file to the /config/temp/JobManager directory of the job manager profile.

    If the JobManager directory does not exist, create the JobManager directory in the job manager profile /config/temp directory. To create and access the directory, have the appropriate authority.

    If the properties file exists on a managed node, we can run the Collect file job to copy the properties file from the managed node to the job_manager_profile/config/temp/JobManager/jobToken/nodeName directory. See the topic on the collect file job.

  5. Run the Distribute file job to distribute the properties file from the job manager to one or more application server nodes. Remember any value that you specify for Destination because you use that location for the job that applies the properties file.

    Avoid trouble: You must distribute the properties file to the target nodes before we can run the Configure properties job. The distribute file job copies the properties file in the /config/temp/JobManager directory of the job manager profile to the target nodes. The name of the properties file on the target nodes becomes whatever value that you specify for the destination when distributing the file. See the topic on the distribute file job.

  6. If the properties file uses a variable map file, run the Distribute file job to distribute the variable map file. Remember any value that you specify for Destination.

Your ID at the job manager must be authorized for the administrator role or the operator role to submit jobs. When you submit a job, you can specify a user name and password for authentication and authorization at the target node or nodes. When you submit a job to multiple target nodes, the user name and password or the credentials for the submitter must be applicable to all the job targets.

Use the admin console of the job manager to submit a job that applies a properties file and configures an application server. From the job manager console, choose the Configure properties job, specify the properties file to apply, specify job options, schedule the job, review the summary, and submit the job. The job makes the following changes to an application server configuration:

Optionally, we can specify that the job manager use variables that are set in a variable map file when applying the properties file. Specify the location of a variable map file to include with the properties file.

This page describes how to use the job manager console to submit the job. Instead of using the job manager console, we can submit the job by running the configProperties command in the AdministrativeJobs command group to configure the properties for the appserver node. See the Administrative job types topic.

The configure properties job uses the applyConfigProperties command in the PropertiesBasedConfiguration command group for AdminTask to configure the properties for the target node.

 

  1. Click Jobs > Submit from the navigation tree of the job manager administrative console.

  2. Choose a job to apply a properties file to one or more appserver nodes.

    1. Select the Configure properties job type from the list.

    2. Optionally describe the job.

    3. Click Next.

  3. For the job target, choose the appserver nodes to configure by applying a properties file.

    1. Select Node names.

    2. Specify the node names to which you previously distributed the properties file and click Add, or click Find and specify the appserver nodes as chosen nodes on the Find nodes page.

    3. Click Next.

    4. If user authentication is required, specify the user name and password.

    5. Click Next.

  4. Specify parameters for the configure properties job.

    1. Specify the location of the properties file that you want to apply.

      The properties file location is the destination value that you specified for the Distribute file job.

    2. If the properties file uses a variable map file, specify the location of the variable map file.

      Use the destination value that you specified for the Distribute file job.

    3. Click Next.

  5. Schedule the job.

    The times and dates that you specify are relative to the job manager.

    1. Optionally specify one or more e-mail addresses where notifications are sent when the job is done.

      If you specify multiple e-mail addresses, separate them by commas. The e-mail addresses are saved in the console preferences. Each e-mail address is validated for format errors.

    2. Select when the job is available for submission.

      We can submit the job to be available now, or specify a time and date that the job is retrieved from the job manager.

    3. Select the job expiration.

      The job expiration is the time at which the job will no longer be available for nodes to run. Use the default expiration, specify a time and date for the job expiration, or specify an amount of time in which the job expires. The default expiration is defined on the Job manager configuration page.

    4. 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.

    5. Click Next.

  6. Review the summary, and click Finish to submit the job.

 

Results

The job manager performs the following operations:

 

Next steps

On the Job status page, click the job ID and view the job status. Click the status refresh icon

Refresh view icon for job status 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 status is Succeeded, check a target node to verify the properties file was applied.



Related tasks
Set up a job manager environment
Starting and stopping the job manager
Starting and stopping the admin agent
Starting and stopping the dmgr
Use wsadmin scripting
Distributing files from the job manager to nodes
Extracting properties files using wsadmin scripting
Applying properties files using wsadmin scripting
Submitting jobs
Check job status

Related reference
Administrative job types using wsadmin scripting
Find nodes
Find node resources

Related information
System administration for WAS V7: Part 4: Properties-based configuration

   



Last updated Nov 10, 2010 8:23:07 PM CST