Replication less then one minute

freebee

Well-Known Member
May 8, 2020
72
4
48
42
Hi.
Have somewhere where I can manually edit the time to replicate?
In past versions, I use zfsnap to sync. I make a script that generates a snapshot and send it. Is a loop. No data loss in 3 years.
Now I use the proxmox cluster with replication, but with 1 minute I can have data loss.
How I can manually edit this time on the console?
 
that's currently not supported (the granularity is 1 minute).

also, just because you have a small replication interval/delta doesn't make the replication any less async in character. if you want sync replication, you need to use a technology that supports that in its architecture, like Ceph.
 
Above i shared my script in bash.
The copy key is because the other place is runing a proxmox (second) and IP is dynamic.
So, o connect, accept the new fingerprint and connect.
I test the connectio before run syncoid, this is to avoid the syncoid create more then one snapshot (sometimes he lots the hard drive, so this test avoid this sucessful).
So, i will try to adopt this script to execute via curl (api) this replication. If someone has the way i will test.

#!/bin/bash

# Don't forget to put StrictHostKeyChecking in /etc/ssh/ssh_config

FILE=/tmp/msg1.txt
REMOTE_POOL="DATA/vm-102-disk-0"
REMOTE_IP="xxx.ddns.net"
REMOTE_PORT="42126"
LOCAL_POOL="rpool/data/vm-102-disk-0"
WAIT_TIME="1"



while true
of
# If this file exists is to continue the execution.
# This is an easy way to control the execution of the script without taking it out of processing.
# Ex: before restarting vpn or internet, stop replication.
if [ -f "/root/activar_replicacao" ]; then

echo "Replication Active"
# IF you can connect to the destination ssh port, do the rest. If not, ignore the following lines and skip straight to count to start the script again.
if nc -zw3 $REMOTE_IP $REMOTE_PORT; then
echo "Connection successful. Testing ssh."
timeout 5 bash -c "ssh -q root@$REMOTE_IP -p $REMOTE_PORT"
ssh_test=$?
if [ $ssh_test = "124" ]; then
echo "Replicating on other place."
syncoid --sshport=$REMOTE_PORT --compress=lz4 $LOCAL_POOL root@$REMOTE_IP:$REMOTE_POOL
echo "Replication on $REMOTE_IP $REMOTE_POOL terminated."
else
echo "Copying the public key again."
ssh-copy-id -i ~/.ssh/id_rsa.pub root@$REMOTE_IP -p $REMOTE_PORT
echo "Key copied."
fi
fi
# Wait time to repeat the loop
sleep ${WAITING_TIME}
fi
done
 
Does somebody know pvesr run --id id-jobid can use other socket for lock ?.
 
Last edited: