Set monitored directory deployment values
Before we can use the monitored directory application deployment service, enable it. We can optionally change the default monitored directory and polling interval values. By default, the monitored directory application deployment service is not enabled, the monitored directory is app_server_root/monitoredDeployableApps, and the polling interval is 5 seconds.
See topics on monitored directory deployment to determine whether monitored directory deployment offers a suitable way to deploy your enterprise application files:
- Install enterprise application files by adding them to a monitored directory
- Install enterprise application files by adding properties files to a monitored directory
Restriction:
- Install an enterprise application file by adding a file to a monitored directory is available only on distributed and z/OS operating systems. It is not supported on IBM i operating systems.]
- The monitored directory application deployment service is not supported on nodes that are registered with an administrative agent.
We can use an administrative console or wsadmin scripting to enable or disable monitored directory deployment and change the monitored directory and polling interval.
A monitoredDirectoryDeployment object has the following attributes:
- enabled
- Default is false. Set to true to enable monitored directory deployment.
- monitoredDirectory
- Default is USER_INSTALL_ROOT}/monitoredDeployableApps. Optionally set to a different file system directory. To change the default monitored directory, specify a different directory path for this setting. List the entire value for the directory, including the environment variable.
For base (stand-alone) application servers, the default monitored directory is the monitoredDeployableApps/servers/server_name directory of the application server profile.
For deployment managers, the default monitored directories are the monitoredDeployableApps/servers/server_name, monitoredDeployableApps/nodes/node/servers/server_name, and monitoredDeployableApps/clusters/cluster_name directories of the dmgr profile.
- pollingInterval
- Default is 5 seconds. Optionally set to a different number of seconds. Valid values are 5 or higher. The product changes 0 (zero) or negative values to 5 when the server starts.
- Use the Global deployment settings page of an administrative console to set monitored directory values.
- Click Applications > Global deployment settings.
- To enable monitored directory deployment, select Monitor directory to automatically deploy applications.
To disable monitored directory deployment, clear Monitor directory to automatically deploy applications.
- To change the monitored directory path, specify a new value for Monitored directory.
Ensure that the directory that specified for Monitored directory exists. The product does not create the directory for you.
- To change the polling interval, specify the number of seconds for Polling interval.
- Click Apply.
- For an administrative console for a base (stand-alone) application server to change monitored directory values, restart the application server.
If we are using an administrative console for a deployment manager to change monitored directory values, restart the deployment manager.
To view a default value, after a non-default value is set, clear the field.
- Use wsadmin scripting to set monitored directory values.
- Start wsadmin at a command prompt for the bin directory of the profile.
- Set the cell context for the profile to a variable.
Run the AdminConfig getid command and set a variable for the cell name of the profile. For example, to set the c1 variable to the myNode01Cell cell name, run the following command:
Jython:
c1 = AdminConfig.getid('/Cell:helyarNode01Cell/')
Using Jacl:
set c1 [$AdminConfig getid /Cell:myNode01Cell/]
- Set the monitoredDirectoryDeployment attribute of the cell to a variable.
Run the AdminConfig showAttribute command and set a variable for the monitored directory deployment attribute of the cell. For example, to set the md variable to the monitoredDirectoryDeployment attribute, run the following command:
Jython:
md = AdminConfig.showAttribute(c1, "monitoredDirectoryDeployment")
Using Jacl:
set md [$AdminConfig showAttribute $c1 monitoredDirectoryDeployment]
- Set monitored directory values.
- To enable monitored directory deployment, run the AdminConfig modify command and set the enabled attribute to true.
Jython:
AdminConfig.modify(md, [['enabled', "true"]])
Using Jacl:
$AdminConfig modify $md {{enabled true}}
To disable monitored directory deployment, run the modify command and set the enabled attribute to false. The product converts values other than true or false to a boolean value of false.
Jython:
AdminConfig.modify(md, [['enabled', "false"]])
Using Jacl:
$AdminConfig modify $md {{enabled false}}
- To change the polling interval, run the modify command and set the pollingInterval attribute to a positive integer. Values other than integers result in a com.ibm.ws.scripting.ScriptingException error.
Jython:
AdminConfig.modify(md, [['pollingInterval', "10"]])
Using Jacl:
$AdminConfig modify $md {{pollingInterval 10}}
- To change the monitored directory, run the modify command and set the monitoredDirectory attribute to a directory on the computer.
Jython:
AdminConfig.modify(md, [['monitoredDirectory', "/newPath"]])
AdminConfig.modify(md, [['monitoredDirectory', "C:/newPath"]])
Using Jacl:
$AdminConfig modify $md {{monitoredDirectory /newPath}}
$AdminConfig modify $md {{monitoredDirectory C:/newPath}}
Ensure that the specified monitored directory exists. The product does not create the newPath directory for you.
- To clear an attribute value and reset it to the default value, run the unsetAttributes command.
Jython:
AdminConfig.unsetAttributes(md, 'enabled') AdminConfig.unsetAttributes(md, 'pollingInterval') AdminConfig.unsetAttributes(md, 'monitoredDirectory')Using Jacl:
$AdminConfig unsetAttributes $md {enabled} $AdminConfig unsetAttributes $md {pollingInterval} $AdminConfig unsetAttributes $md {monitoredDirectory}
- To view monitored directory values, run the AdminConfig show command.
Jython:
print AdminConfig.show(md)
Using Jacl:
$AdminConfig show $md
Running the show command displays attribute values such as the following:
[enabled false] [monitoredDirectory ${USER_INSTALL_ROOT}/monitoredDeployableApps] [pollingInterval 5]
- Save configuration changes.
Jython:
AdminConfig.save()
Jacl:
$AdminConfig save
- If we are changing monitored directory values for a base (stand-alone) application server, restart the application server.
If we are changing monitored directory values for a deployment manager, restart the deployment manager.
Results
The product sets monitored directory deployment attributes to the values that specified.
What to do next
If we enabled monitored directory deployment, deploy the applications by adding files to a monitored directory.
Subtopics
- Global deployment settings
Use this page to manage settings that apply to all applications or to a subset of application types.
Related concepts
Ways to install enterprise applications or modules
Related tasks
Install enterprise application files by adding them to a monitored directory Install enterprise application files by adding properties files to a monitored directory Start the wsadmin scripting client
Directory conventions