This documentation is for WSO2 Enterprise Integrator version 6.1.1 . View documentation for the latest release in the 6.x.x family and the latest release in the 7.x.x family.

All docs This doc

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note

However, using a shared file system is the first preference that WSO2 recommends to synchronize the artifacts among the nodes, . That is because you can publish synapse artifacts to any of the nodes, avoiding the vulnerability of a single point of failure that is present when using remote synchronization (Rsync). 

...

Using Remote Synchronization (Rsync)

Use the following deployment synchronization recommendations based on the rate of change of artifacts that happen in your cluster:

...

Another common approach for synchronizing artifacts across all cluster nodes is to use rsyncuse the Rsync tool, which is a file copying tool. If you are unable to maintain a shared file system, you can synchronize content using Rsync. Therefore, you can first deploy artifacts in one node of the cluster and then  use rsync to use Rsync to copy those artifacts to other nodes as described below.

...

.

...

  1. Create a file called nodes-list.txt that lists all the nodes in the deployment. The following is a sample of the file for two nodes.

    Tip

    Different nodes are separated by new lines.

    Code Block
    languagetext
    titlenodes-list.txt
    [email protected]:~/setup/192.168.1.1/ei_node/repository/deployment/server
    [email protected]:~/setup/192.168.1.2/ei_node/repository/deployment/server
  2. Create a file to synchronize the  <PRODUCT_HOME>/repository/deployment/server/ directory between the nodes.

    Note

    You must create your own SSH key and define it as the pem_file. Alternatively, you can use an existing SSH key. Specify the ei_server_dir depending on the location in your local machine. Change the logs.txt file path and the lock location based on where they are locatedin your machine.

    Tip

    Configure rsync in the <EI_HOME>/repository/tenant/ directory to share the tenant artifacts across the cluster.

    Code Block
    languageapplescript
    titlersync-for-ei-depsync.sh
    #!/bin/sh 
    ei_server_dir=~/wso2ei-6.2.0/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 nodes-list.txt
    pushd `dirname $0` > /dev/null
    SCRIPTPATH=`pwd`
    popd > /dev/null
    echo $SCRIPTPATH
     
     
    for x in `cat ${SCRIPTPATH}/nodes-list.txt`
    do
    echo ================================================== >> /tmp/carbon-rsync-logs/logs.txt;
    echo Syncing $x;
    rsync --delete -arve "ssh -i  $pem_file -o StrictHostKeyChecking=no" $ei_server_dir $x >> /tmp/carbon-rsync-logs/logs.txt
    echo ================================================== >> /tmp/carbon-rsync-logs/logs.txt;
    done
  3. Execute the following command in your CLI to create a Cron job that executes the above file every minute for deployment synchronization.   

    Code Block
    languageactionscript3
    *   *  *   *   *     /home/ubuntu/setup/rsync-for-depsync/rsync-for-ei-depsync.sh

...