Koozali.org: home of the SME Server

Two Affa Servers - Suggestions

Offline Mirfster

  • *
  • 62
  • +0/-0
Two Affa Servers - Suggestions
« on: June 04, 2016, 01:55:51 PM »
Hi all,

Just wanted to ask what the suggested scenario would be if one wanted two offsite AFFA Servers to backup the same onsite SME Server?

Would you suggest:
  • AFFA Server #1 backup at a certain time (say 6AM) and AFFA Server #2 backup later (say 6PM)
  • AFFA Server #1 just handle the backup and AFFA Server #2 try and Backup AFFA Server #1
  • Not worth even trying
  • Another route or suggestion
« Last Edit: June 04, 2016, 02:00:02 PM by Mirfster »

Offline Jean-Philippe Pialasse

  • *
  • 2,912
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Two Affa Servers - Suggestions
« Reply #1 on: June 06, 2016, 05:23:59 AM »
Hi,

What is the purpose ?

Before trying a solution, one have to describes its need. Without doing so you might miss the simplest solution by trying to use the chosen mean as if it where the only solution available.

Offline Mirfster

  • *
  • 62
  • +0/-0
Re: Two Affa Servers - Suggestions
« Reply #2 on: June 06, 2016, 01:55:42 PM »
Looking at having one SME Server "On-Site" that will backup the main Server (for quick DR).  In addition to that, there will be an "Off-Site" Server that I would like to also have with AFFA (as part of a DR).  /This is slightly changed from my initial comment.

I wasn't sure which route would be best to under take and if having two separate Servers trying to connect to the same Main Server would cause a conflict or not.

Offline ReetP

  • *
  • 3,949
  • +6/-0
Re: Two Affa Servers - Suggestions
« Reply #3 on: June 07, 2016, 12:29:48 AM »
I backup my cloud box box to two separate machines so I can restore from either, and it has been fine.

The first backup/run on each takes a while, but thereafter I just make sure there are reasonable gaps between the syncs, especially if there is a lot of data to shift.

I also use unison to do some other backups in a similar fashion syncing from one server to a couple of different locations (damn..... I ought to build a contrib around it)

I can't see much point in one affa backing up another though. The point is to be able to restore a machine quickly, (the killer feature of affa on Koozali SME) and your solution does not really do that.

B. Rgds
Johm

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Mirfster

  • *
  • 62
  • +0/-0
Re: Two Affa Servers - Suggestions
« Reply #4 on: June 07, 2016, 03:31:30 AM »
I can't see much point in one affa backing up another though. The point is to be able to restore a machine quickly, (the killer feature of affa on Koozali SME) and your solution does not really do that.

Agreed, that is why I was thinking that also mentioned:
Would you suggest:
  • AFFA Server #1 backup at a certain time (say 6AM) and AFFA Server #2 backup later (say 6PM)

Only thing is I am unsure if it would have any issues if two different AFFA Servers were trying to backup the same Parent Server...

Offline ReetP

  • *
  • 3,949
  • +6/-0
Re: Two Affa Servers - Suggestions
« Reply #5 on: June 07, 2016, 12:41:36 PM »
Would you suggest:
AFFA Server #1 backup at a certain time (say 6AM) and AFFA Server #2 backup later (say 6PM)

Yup - that would be a lot better.

On mine I only have very small amounts of data so they are unlikely to clash. With my Unison syncs they run quite close together so I have a small bash wrapper to check if a job is already running like this:

Code: [Select]
#!/bin/sh
#
# From here : http://www.franzone.com/2007/09/23/how-can-i-tell-if-my-bash-script-is-already-running/
#
# Is it me running ? If so, bailout
if [ ! -z "`ps -C \`basename $0\` --no-headers -o "pid,ppid,sid,comm"|grep -v "$$ "|grep -v "<defunct>"`" ]; then

#script is already running - abort
 exit 1

fi

If you know the name of the actual process you can modify it a little like this (substitute affa for the relevant process) :

Code: [Select]
if [ ! -z "`ps -C affa --no-headers -o "pid,ppid,sid,comm"|grep -v "$$ "|grep -v "<defunct>"`" ]; then

You could either call the wrapper in the cron by modifying the affa cron template here /etc/e-smith/templates/etc/cron.d/affa/00jobs

Code: [Select]
   56 $OUT .= "$minute $hour * * * root  /sbin/e-smith/affa --watchdog=$nwd --run $k\n";

Or alternatively add the above in perl in the actual /sbin/e-smith/affa file using something like this:

http://stackoverflow.com/questions/455911/whats-the-best-way-to-make-sure-only-one-instance-of-a-perl-program-is-running

(possibly an idea to integrate to affa !!)

Note these are only some pointers.. I don't guarantee anything will actually work ;-)

You could also use some of the affa config properties

https://wiki.contribs.org/Affa#Default_configuration_properties

e.g. killAt

That will make sure the job is stopped.

Again, testing is required.

B. Rgds
John
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation