Deployment Synchronizer or Dep-Sync is used to synchronize artifacts within nodes in a cluster. This topic provides instructions on how to set up the registry-based deployment synchronizer to sync artifacts within two WSO2 ESB nodes. There are other synchronization methods available in WSO2 servers such as Subversion (SVN)-based deployment synchronizer, but they need third-party software and are a bit hard to configure compared to registry-based deployment synchronizer.
Before doing the actual registry-based deployment synchronizer configurations, we first need to mount ESB's /_system/config
collection to a single database. To get a clear idea on registry mounting read this.
You cannot use an embedded H2 database for this since H2 allows one connection at a time in its embedded mode. In this example, we use MySQL to do the registry mounting.
Configuring the manager node
You configure DepSync in the <PRODUCT_HOME>/repository/conf/carbon.xml
file on the manager node by making the following changes in the <DeploymentSynchronizer>
tag:
<DeploymentSynchronizer> <Enabled>true</Enabled> <AutoCommit>true</AutoCommit> <AutoCheckout>false</AutoCheckout> <RepositoryType>registry</RepositoryType> </DeploymentSynchronizer>
- The above must be uncommented in the carbon.xml file.
- Here
<Enabled>
is set totrue
to indicate that the registry-based deployment synchronizer is enabled. - The
<AutoCommit>
tag is set to true to indicate that this node can commit the changes to registry. - The
<AutoCheckout>
tag is set tofalse
to indicate that this node is not needed to checkout since this is the only node which do the changes to the configurations. You would set <AutoCheckout> to true if there is more than one manager node.
Configuring the worker node
You configure DepSync in the <PRODUCT_HOME>/repository/conf/carbon.xml
file on the worker node by making the following changes in the <DeploymentSynchronizer>
tag:
<DeploymentSynchronizer> <Enabled>true</Enabled> <AutoCommit>false</AutoCommit> <AutoCheckout>true</AutoCheckout> <RepositoryType>registry</RepositoryType> </DeploymentSynchronizer>
- Here
<Enabled>
is set totrue
to indicate that the registry-based deployment synchronizer is enabled. - The
<AutoCommit>
tag is set tofalse
to indicate that this node cannot commit the changes to registry. - The
<AutoCheckout>
tag is set totrue
to indicate that this node needed to checkout since this node needed to sync up with the manager node.