[Csync2] csync2: 2 servers Master-Master

Rabin Yasharzadehe rabin at isoc.org.il
Thu Jun 9 09:23:57 CEST 2016


​
I personally put a random sleep in my cron call,

1 * * * * root  sleep $((RANDOM%60)) && csync2-update
>

where csync2 is a wrapper around csync -xv which handle errors and mail
notifications.

you can move the sleep into the wrapper script,
and only use the delay when there is no tty (which is when the script is
called via cron)

not perfect, but it works nicely.


--
Rabin
​


On Thu, Jun 9, 2016 at 9:47 AM, Гусев Павел <pgusev at qsoft.ru> wrote:

> Hi! If you run csync2 -xv on each node, you can get sqlite-database locks.
> So, if you do not want sqlite-database locks, you can use one of these
> recomendations:
> 1) use csync 2.0, it is possibility to use mysql backend
> 2) on each node authorized_keys file and connect to each node from one
> supermaster node, and run csync2 -xv over ssh in  a cycle, for example:
>
> #!/bin/bash
> list="host1 host2 host3"
> rid=$(date +%s)
>         LOGS_PATH=/var/log/csync2_master/mainapp
>         mkdir -p $LOGS_PATH
>         CUR_DATE=`date +%F`
>
>         find $LOGS_PATH -type f -mtime +30 -exec rm -f {} \;
> 2>&1
> | tee -a $LOGS_PATH/last.log
>
>         for ip in $list;do
>                 echo
> '============================================================'
> 2>&1                                                     | tee -a
> $LOGS_PATH/last.log
>                 echo 'Starting '${trid}' sync on '$ip' at '`date`
> 2>&1
> | tee -a $LOGS_PATH/last.log
>                 timeout 3600 ssh -oStrictHostKeyChecking=no csync2@$ip
> "timeout 3600 sudo csync2 -xv"
> 2>&1                                                             | tee -a
> $LOGS_PATH/last.log
>                 echo 'Finishing '${trid}' sync on '$ip' at '`date`
> 2>&1                                                                      |
> tee -a $LOGS_PATH/last.log
>                 echo
> '============================================================'
> 2>&1                                                     | tee -a
> $LOGS_PATH/last.log
>         done
>         echo -e
> "*****************************************************************************************************************\n"
> 2>&1   | tee -a $LOGS_PATH/last.log
>         sleep 60;
>
> 3) if you do not want previously choices, you can use csync2 -Bxv (key B -
> do not lock sqlite-database, but you can get bad data in database or
> crashed db-file)
>
> Paul Goosev
>
>
>
> 08.06.2016, 18:50, "Rabin Yasharzadehe" <rabin at isoc.org.il>:
>
> check the manual - http://oss.linbit.com/csync2/paper.pdf
> just note that csync2 works by pushing changes, so you'll need to run the
> sync command on each node, to sync both sides.
>
> On Wed, Jun 8, 2016 at 1:12 PM, Solanellas Llobet, Xavier <
> xavier.solanellas at esade.edu> wrote:
>
> Hi,
>
> I would like to configure 2 servers Master-Master using csync2 in
> RedHatLinux.
>
> Do you have a document with step by step to configure 2 servers?
>
>
>
> Thanks.
>
> _______________________________________________
> Csync2 mailing list
> Csync2 at lists.linbit.com
> http://lists.linbit.com/mailman/listinfo/csync2
>
> ,
>
> _______________________________________________
> Csync2 mailing list
> Csync2 at lists.linbit.com
> http://lists.linbit.com/mailman/listinfo/csync2
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linbit.com/pipermail/csync2/attachments/20160609/f0ad7b74/attachment-0001.htm>


More information about the Csync2 mailing list