This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Configuring rsync for Deployment Synchronization
Deployment synchronization can be done using rsync, which is a file copying tool. These changes must be done in the manager node and in the same directory.
Create a file called
workers-list.txtthat lists all the worker nodes in the deployment. The following is a sample of the file where there are two worker nodes.workers-list.txt
ubuntu@192.168.1.1:~/setup/192.168.1.1/as/as_worker/repository/deployment/server ubuntu@192.168.1.2:~/setup/192.168.1.2/as/as_worker/repository/deployment/serverCreate a file to synchronize the
<PRODUCT_HOME>/repository/deployment/serverfolders between the manager and all worker nodes.rsync-for-carbon-depsync.sh
#!/bin/sh manager_server_dir=~/wso2as-5.2.1/repository/deployment/server/ pem_file=~/.ssh/carbon-440-test.pem #delete the lock on exit trap 'rm -rf /var/lock/depsync-lock' EXIT mkdir /tmp/carbon-rsync-logs/ #keep a lock to stop parallel runs if mkdir /var/lock/depsync-lock; then echo "Locking succeeded" >&2 else echo "Lock failed - exit" >&2 exit 1 fi #get the workers-list.txt pushd `dirname $0` > /dev/null SCRIPTPATH=`pwd` popd > /dev/null echo $SCRIPTPATH for x in `cat ${SCRIPTPATH}/workers-list.txt` do echo ================================================== >> /tmp/carbon-rsync-logs/logs.txt; echo Syncing $x; rsync --delete -arve "ssh -i $pem_file -o StrictHostKeyChecking=no" $manager_server_dir $x >> /tmp/carbon-rsync-logs/logs.txt echo ================================================== >> /tmp/carbon-rsync-logs/logs.txt; doneCreate a Cron job that executes the above file every minute for deployment synchronization. Do this by running the following command in your command line.
* * * * * /home/ubuntu/setup/rsync-for-depsync/rsync-for-depsync.sh