OpenVZ Forum


Home » General » Support » Sync'ing between servers
Sync'ing between servers [message #376] Thu, 17 November 2005 21:00 Go to next message
tbenoit is currently offline  tbenoit
Messages: 10
Registered: November 2005
Junior Member
Our use for OpenVZ is a little different than most. We'll be running 1 VPS on each server normally. When we will run 2 VPS on a server is when a primary server dies and will take an unacceptable amount of time to come back up.

With that in mind, we'd like to be able to replicate each VPS to its backup server(s). For example:

SERVER1 = VPS1 (VPS2's backup server)
SERVER2 = VPS2 (VPS1's backup server)

We'd like to use `rsync` every so often (hour, or several hours) to sync VPS1 onto SERVER2 and VPS2 onto SERVER1 which will allow us to more easily bring up the VPS on the backup server if needed.

1) Is this even possible, considering potential corruption issues? I tend to think "Yes". The Application won't have an issue with it. I'm just confirming from an OpenVZ side it'll be ok.

2) If it is, here's the list of directories/files I have set to `rsync`, to sync VPS1 onto SERVER2 (into the same directory structure, of course). Am I missing anything?

..... /vz/private/VPS1
..... /vz/root/VPS1
..... /etc/sysconfig/vz-scripts/VPS1.conf


As always, many thanks for all of your assistance. I truly appreciate it.



Thanks
Re: Sync'ing between servers [message #379 is a reply to message #376] Fri, 18 November 2005 13:43 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

/vz/root is not required. it's mounted VPS content, the same as in private...


http://static.openvz.org/userbars/openvz-developer.png
Re: Sync'ing between servers [message #380 is a reply to message #376] Fri, 18 November 2005 14:07 Go to previous messageGo to next message
tbenoit is currently offline  tbenoit
Messages: 10
Registered: November 2005
Junior Member
Many thanks for the clarification. I do appreciate it.


Thanks
Re: Sync'ing between servers [message #385 is a reply to message #380] Sat, 19 November 2005 19:35 Go to previous messageGo to next message
youp is currently offline  youp
Messages: 82
Registered: September 2005
Location: Belgium
Member

i use virtuozzo and synchronise by crontab in the night ...

i use this script for that :

#!/bin/bash
set +x
date=`date '+%y%m%d%H%M%S'`

VMRUN=`/usr/sbin/vzlist | grep running | grep $IP | wc -l`

if [ $VMRUN == "1" ]; then
/usr/bin/rsync -avz --delete -e ssh /vz/private/$VZ/root/ root@$DESTINATION:/vz/private/$VZ/root/ > /allitscript/logTFT/$VZ-$date.log
fi

if the primary server failed :

i will start the VPS the backup server with this command :

mv /etc/sysconfig/vz-scripts/$VZ.conf.stdby vers /etc/sysconfig/vz-scripts/$VZ.conf

vzctl set $VZ --disabled no --save

vzquota drop $VZ
vzctl start $VZ

it's work great Wink


Re: Sync'ing between servers [message #388 is a reply to message #385] Sun, 20 November 2005 02:30 Go to previous messageGo to next message
tbenoit is currently offline  tbenoit
Messages: 10
Registered: November 2005
Junior Member
Many thanks.

Automating the failover was going to be my next step (kind of a "poor man's" cluster).

I appreciate the script. Will save me time from starting my own from scratch.


Thanks
Re: Sync'ing between servers [message #390 is a reply to message #388] Sun, 20 November 2005 09:02 Go to previous messageGo to next message
youp is currently offline  youp
Messages: 82
Registered: September 2005
Location: Belgium
Member

i research somebody wich use peerfs , this file system could be synchronise (block mode) in real time on two server , i think it's really a good solution for create a poor cluster Wink
but i don't test it ...
Re: Sync'ing between servers [message #391 is a reply to message #390] Sun, 20 November 2005 15:07 Go to previous messageGo to next message
tbenoit is currently offline  tbenoit
Messages: 10
Registered: November 2005
Junior Member

Thanks for the info. It sounds interesting. I'll check it out. Smile



Thanks
Re: Sync'ing between servers [message #392 is a reply to message #390] Sun, 20 November 2005 18:46 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

youp, I know nothing about peerfs, but I know that we have some investigations about DRBD driver in this direction. DRBD does the same - syncronized block device. Probably, this can help you as well.

http://static.openvz.org/userbars/openvz-developer.png
Re: Sync'ing between servers [message #393 is a reply to message #392] Sun, 20 November 2005 19:51 Go to previous message
youp is currently offline  youp
Messages: 82
Registered: September 2005
Location: Belgium
Member

yes, it can help me or other people who create a cluster with openvz, i am interressed Wink

thanks
Previous Topic: debian sarge
Next Topic: VPS template for Redhat Enterprise Linux 4
Goto Forum:
  


Current Time: Mon Nov 04 21:42:52 GMT 2024

Total time taken to generate the page: 0.03412 seconds