Multiple Filesystem Deployment Target Configuration

Showing results for 
Search instead for 
Did you mean: 

Multiple Filesystem Deployment Target Configuration

0 0 1,074

Obsolete Pages{{Obsolete}}

The official documentation is at:



This is an example of how to configure more than one File System Deployment Target in the same Deployment Receiver Engine, regardless of whether that deployment receiver is running in stand alone mode or within Alfresco. This example also omits any mention of the transport protocol (Java RMI or HTTP), as this is configured externally. Please note that this is not a complete, end-to-end example of how to configure the stand-alone deployment receiver. This example also completely ignores any configuration which takes place on the authoring server. We consider only the common configuration required of any deployment receiver.

This example focuses on configuration which achieves the following objectives:

  1. A single root directory contains all configured deployment targets.
  2. This single root directory should be specifiable from a properties file.
  3. Each deployment target consists of a single directory containing a 'metadata' and a 'data' directory.
  4. The autoFix parameter of all deployment targets is identical, and configurable from a properties file.
  5. Directories for logfiles and temporary files are contained by the root directory.
  6. The same authenticator is used for all deployment targets.
  7. Individual deployment targets are configured in separate files.

The resultant directory structure, assuming deployment targets named web1, web2 ... webN, is:

  • BaseDirectory
    • logs
    • temp
    • web1
      • metadata
      • data
    • web2
      • metadata
      • data
    • ...
    • webN
      • metadata
      • data


  • The Deployment Receiver Engine has been configured with a bean id of 'deploymentReceiverEngine'.
  • The enclosing system is properly configured to load the relevant property files.
  • A Deployment Receiver Authenticator appropriate to the runtime environment has been configured with a bean id of 'targetAuthenticator'.
  • A command queue has been configured with a bean id of 'deploymentReceiverCommandQueue'.

Required properties

This configuration example requires that the following properties be set correctly:

Sets Property
On Component
deployment.filesystem.errorOnOverwrite errorOnOverwrite File System Receiver Service Flag indicating whether overwriting files unrelated to the deployment is an error condition.
deployment.filesystem.baseDir base of all paths File System Receiver Service, File System Deployment Target Path to base of the directory structure
deployment.filesystem.autofix autoFix File System Deployment Target Flag to control the automatic repair of metadata.


A rough outline of the approach is as follows:

  1. Write the configuration common to all the directories, save to deployment-fsr-target.xml
  2. Make a template which can be used for all the targets (directory-template.xml).
  3. Customize the template for each target (web1-fsr.xml, web2-fsr.xml...)
  4. Install the configuration files in the appropriate place.

Common configuration

Two beans are common to all targets: the File System Receiver Service and its housekeeper. In deployment-receiver-context.xml, which I am using as a starting point for this example, the housekeeper does not appear to be used. Therefore it will also appear to not be used in the following configuration file.

Conceptual details of the configuration follow:


Class : org.alfresco.deployment.impl.fsr.FileSystemReceiverServiceImpl
Id : fileSystemReceiverService

errorOnOverwrite ${deployment.filesystem.errorOnOverwrite}
dataDirectory ${deployment.filesystem.baseDir}/temp
logDirectory ${deployment.filesystem.baseDir}/logs
commandQueue bean ref: deploymentReceiverCommandQueue


Class : org.alfresco.deployment.impl.fsr.FileSystemReceiverHousekeeper
Id : fileSystemReceiverHousekeeper

fileSystemReceiverService bean ref: fileSystemReceiverService


    <bean id='fileSystemReceiverService' class='org.alfresco.deployment.impl.fsr.FileSystemReceiverServiceImpl'
        <property name='errorOnOverwrite'><value>${deployment.filesystem.errorOnOverwrite}</value></property>
        <property name='dataDirectory'>
        <property name='logDirectory'>
        <property name='commandQueue'><ref bean='deploymentReceiverCommandQueue' /></property>
    <bean id='fileSystemReceiverHousekeeper' class='org.alfresco.deployment.impl.fsr.FileSystemReceiverHousekeeper'
     <property name='fileSystemReceiverService'><ref bean='fileSystemReceiverService'/></property>

    <import resource='classpath*:alfresco/deployment/*-fsr.xml' />
    <import resource='classpath*:alfresco/extension/deployment/*-fsr.xml' />

Directory template

The objective of making a template is so that targets can be quickly declared with minimal editing. In this case, the only parameter required to fill in the template is the target name. Any text editor (or sed for that matter) should be capable of instantiating this template quickly.

The template creates only two beans, and one is a utility which is used to register the target with the deployment engine. Both beans are anonymous (i.e., they have no id property.) Conceptual details follow:

anonymous registration bean

Class : org.alfresco.deployment.impl.server.DeploymentTargetRegistrationBean
Id : anonymous
init-method : register

registry bean ref: deploymentReceiverEngine
target bean definition (see below)

anonymous target bean

Class : org.alfresco.deployment.impl.fsr.FileSystemDeploymentTarget
Id : anonymous

rootDirectory ${deployment.filesystem.baseDir}/TARGET/data
metaDataDirectory ${deployment.filesystem.baseDir}/TARGET/metadata
autoFix ${deployment.filesystem.autofix}
authenticator bean ref: targetAuthenticator
fileSystemReceiverService bean ref: fileSystemReceiverService



    <bean class='org.alfresco.deployment.impl.server.DeploymentTargetRegistrationBean'

        <property name='name'>

        <property name='registry'>
            <ref bean='deploymentReceiverEngine'/>

        <property name='target'>
            <bean class='org.alfresco.deployment.impl.fsr.FileSystemDeploymentTarget'

                <property name='rootDirectory'>

                <property name='metaDataDirectory'>

                <property name='autoFix'>

                <property name='fileSystemReceiverService'>
                    <ref bean='fileSystemReceiverService'/>

                <property name='name'>

                <property name='authenticator'>
                    <ref bean='targetAuthenticator'/>

Template customization

To customize the above template, simply do a case-sensitive global search and replace. Replace the string TARGET with the name you have chosen for your target. Because this name will appear in the path, it should be a legal directory name on whatever system you plan on running your filesystem deployment receiver. Wise users will avoid spaces and special characters.

After the substitution is done, save the file as {your directory name here}-fsr.xml.

Configuration file installation

The proper location to install the files depends on whether you are running the stand alone deployment receiver or your receiver is running within Alfresco itself.

Stand alone receiver : deployment/*
Alfresco : extension/deployment/*

Multiple Collections of Directories

The pattern in this file may be used to support more than one 'series' of deployment targets. Take, for instance, the situation where one base directory contains all web projects to be served by Apache httpd, and another base directory contains all web projects to be served by Apache Tomcat. Instead of performing the configuration on this page once, resulting in a single deployment-fsr-target.xml and the associated directory files {directory}-fsr.xml, it would be necessary to perform the configuration once for each collection of directories. If the two series were 'httpd' and 'tomcat':

  1. there would be two targets: deployment-httpd-target.xml and deployment-tomcat-target.xml
    1. each target should use a different property in place of deployment.filesystem.baseDir
    2. each target should use a different filename pattern to include directories
  2. two directory templates would have to be made, one for each series
    1. each directory template should use the same replacement property for deployment.filesystem.baseDir as its corresponding target file
    2. customizations of each template should be named appropriately (directory-httpd.xml or directory-tomcat.xml)

Application Note for users of Alfresco Community 3.2r2

Any target configured as a 'Test' server will likely fail. Before trying to debug your target configuration too much, just configure it as a 'Live' server and see if the error persists. See ALF-1527. It looks like this is fixed on head right now and will be fixed in the Community 3.3 release.


Community Edition