Resources.properties
From ControlTier
The resources.properties is a ControlTier client configuration file. This is a mapping between resources defined in the project model and CTL nodes. This data is used to drive the node dispatch mechanism for distributed command execution.
Contents |
Use
The resources.properties file is used by:
- The nodedispatch strategy uses this file to look up if the command should be executed locally or remotely.
- ctl-project command: Drives the install action.
- ctl-archive command: Drives filtered extraction.
Location
Client
This configuration file is located within the "etc" directory of a CTL project:
$CTL_BASE/projects/project/etc/resources.properties
Example
/Users/alexh/ctier/ctl/projects/demo/etc/resources.properties
Server
The file is maintained on the server and should be accessible via HTTP. CTL expects the file to be located at the URL: ${framework.webdav.uri}/project/etc/resources.properties
The framework.webdav.uri setting is defined in the CTL configuration file: $CTL_BASE/etc/framework.properties.
Example
http://strongbad:8080/jackrabbit/repository/controltier/projects/demo/etc/resources.properties
Generation and synchronization
Generation
If Workbench is enabled, this file is generated by Workbench (and it will be by default). The file is regenerated on the server any time a node assignment is made for a deployment. In other words, any time the resource model is changed to modify relationships between Nodes and Deployments, the file is regenerated.
To force Workbench to regenerate the file go to Workbench → Admin and then press the "Regenerate resources.properties file" button.
Synchronization
CTL synchronizes with the server, pulling this file if any change has been detected since the last time it was updated.
You can force the synchronization by running the ctl-project command:
ctl-project -a install -p project.
If Workbench is disabled, it is possible to maintain this file directly either manually or external tool. Adhere to the format and locations described here.
Format
This configuration file uses Java properties format of key/value pairs. Keys are based on a dotted notation that identify the kind of entry (ie, object-deployment vs module-deployment) and the node where that deployment resides.
The format of the file is described as shown below.
The primary kind of key in the resources.properties file is an "object-deployment" which maps object deployments to nodes:
### # # format: # # object-deployment.<project>.<type>.<name> = node1, node2,...,nodeN # ###
Example
Two object deployments to node mappings in project "demo" :
# # # The Apache resource named "apache-1" is deployed to nodes web01 and web02 : # object-deployment.demo.Apache.apache-1=web01,web02 # # The Tomcat resource named "simple" is deployed to nodes app02 and app05 : # object-deployment.demo.Tomcat.simple=app02,app05
Note: If Workbench is enabled, do not manually edit the object-deployment entries as your changes will be lost.
