# Deployment Synchronizer

Deployment synchronizer can be used to synchronize the main repository of a Carbon server with a collection in the registry. This feature is sometimes also referred to as the registry based repository synchronizer. Deployment synchronizer has a number of use cases.

1. Maintaining an up-to-date backup of the Carbon repository
2. Sharing a single Carbon repository among multiple servers (through a shared registry)
3. Enforcing artifact updates in the registry to be deployed on a server at runtime

Perhaps the most interesting use case of the deployment synchronizer is the second item listed above. Assume a cluster of Carbon servers that share the configuration registry. With the deployment synchronizer it is possible to maintain all the nodes in the cluster in sync through the shared registry. One of the nodes can be designated as the master node and it can upload its local repository to the registry using the deployment synchronizer. Other nodes (slave nodes) can then download the same repository from the registry and deploy locally. To support this use case, synchronizer has to be run in auto commit mode in the master node. When in auto commit mode, it will periodically upload the changed artifacts in the local repository to the registry. Similarly slave nodes should run the synchronizer in the auto checkout mode. If needed registry eventing can be employed to run the checkout operations so that a checkout will be made only when some artifact has changed in the shared registry.

Note that Carbon repository is located in the repository/deployment/server directory by default. Once enabled, deployment synchronizer uploads the contents of this directory to a collection named repository/deployment/server in the configuration registry (this is configurable).

## Deployment Synchronizer Control Panel

While the deployment synchronizer can be engages and configured from the carbon.xml file the, control panel allows the user to engage it from the Carbon management console.

To access the Deployment Synchronizer Control Panel select Configure > Deployment Synchronizer from the left navigation panel of the Carbon management console. The following page will be displayed.

Figure 1: Deployment Synchronizer Control Panel (Synchronizer Home Page)

## Enabling the Synchronizer

To enable the synchronizer simply check the required features (eg: auto commit) and click the 'Enable' button. Synchronizer will get initialized and start running periodically as specified in the 'Synchronization Period' parameter. When the auto checkout option is checked, an additional option named 'Use Eventing' will be enabled. This can be checked if you want to trigger checkout actions on registry events.

When the synchronizer is enabled additional information will be shown on the UI as shown below.

Figure 2: Deployment Synchronizer Enabled

You can use the additional panels to monitor the progress of auto commit and checkout operations (by observing timestamps). It is also possible to execute a commit operation or a checkout operation manually by clicking on the corresponding buttons. To disable the synchronizer simply hit the 'Disable' button at any time.