Apply 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 intended for a managed application server target, use the job manager to distribute the properties file to the managed target and apply the changed file to update the application server 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 we are applying the properties file to a deployment manager target, start the deployment manager and the federated node of the deployment manager. If we are applying the properties file to a stand-alone application server target, start the administrative agent. The targets must be managed by the job manager.

  2. Use the extractConfigProperties command in the PropertiesBasedConfiguration command group for the AdminTask object to extract a properties file of an application server that is managed by the job manager. We 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 to extract the server configuration of an application server target 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.

    Important: 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, you must have the appropriate authority.

    If the properties file exists on a managed target, we can run the Collect file job to copy the properties file from the managed target to the job_manager_profile/config/temp/JobManager/jobToken/targetName 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 targets. Remember any value specified for Destination because you use that location for the job that applies the properties file.

    Avoid trouble: We must distribute the properties file to the targets 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 targets. The name of the properties file on the targets becomes whatever value specified for the destination when distributing the file. See the topic on the distribute file job.gotcha

  6. If the properties file uses a variable map file, run the Distribute file job to distribute the variable map file. Remember any value specified 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, we can specify a user name and password for authentication and authorization at the target or targets. When you submit a job to multiple targets, the user name and password or the credentials for the submitter must be applicable to all the job targets.

We can use the administrative console of the job manager or the deployment manager to submit a job that applies a properties file and configures an application server. From the 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.

The steps describe how to use the job manager console or the deployment manager to submit the job. Instead of using a console, we can submit the job by running the configProperties command in the AdministrativeJobs command group to configure the properties for the application server target. See the Administrative job types topic.

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

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

  2. Choose a job to apply a properties file to one or more application server targets.

    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 application server targets to configure by applying a properties file.

    1. Select Target names.

    2. Specify the target names to which you previously distributed the properties file and click Add, or click Find and specify the application server targets as chosen targets on the Find targets page.

    3. Click Next.

    4. If user authentication is required, specify a user name, password, or any other authentication values as needed.

    5. Click Next.

  4. Specify parameters for the configure properties job.

    1. Specify the location of the properties file to apply.

      The properties file location is the destination value that 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 specified for the Distribute file job.

    3. Click Next.

  5. Schedule the job.

    The times and dates specified are relative to the job manager.

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

      If we specify multiple email addresses, separate them by commas. The email addresses are saved in the console preferences. Each email 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 targets to run. We can 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:


What to do next

On the Job status page, click the job ID 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 status is Succeeded, check a target to ensure that the properties file was applied.


Related tasks

  • Set up a job manager environment
  • Start and stop the job manager
  • Start and stop the administrative agent
  • Start and stop the deployment manager
  • Use wsadmin scripting
  • Distributing files from the job manager to targets
  • Extracting properties files
  • Apply properties files
  • Submitting jobs
  • Checking job status

  • Administrative job types
  • Find targets
  • Find target resources


    Related information:

    System administration for WebSphere Application Server V7: Part 4: Properties-based configuration