Inter-node dependency

72 views
Skip to first unread message

lupin...@gmail.com

unread,
Feb 26, 2015, 9:59:18 AM2/26/15
to puppet...@googlegroups.com
Hello,

I'm pondering what is the best way to approach this problem( without MCollective).

I have a serverA than will run a DB backup copy it over to serverB, then serverB do restore then notify serverA for it to execute the next phase of action.

This scenario will have to take at least four occurences back and forth between the two servers, this is to setup a log shipping for a DB server.

In my mind I can think of;

A) scp a file as flag every after execution between servers so it will only proceed to next step if flag file is present.
B) Export an Exec resources from one server to another
C) Create a wrapper script for tasks intended for serverB, execute the script from serverA using Exec resource.

I'm biased on B) if it's doable as I would love to have this pure DSL as much as possible but what would be the downside, performance?


Appreciate any input and further ideas.

cheers lupin

Garrett Honeycutt

unread,
Feb 28, 2015, 3:08:27 PM2/28/15
to puppet...@googlegroups.com
Hi,

What is sounds like you have is a recurring task, not a desired system
state. Suggest using puppet to setup ssh keys and a cron job that runs
your backup script.

Best regards,
-g

--
Garrett Honeycutt
@learnpuppet
Puppet Training with LearnPuppet.com
Mobile: +1.206.414.8658

lupin...@gmail.com

unread,
Mar 6, 2015, 12:50:14 PM3/6/15
to puppet...@googlegroups.com
hi,

thank you for the reply, however the end state really is to have both machine in sync and working as pair of primary/standby Database log shipping.

The flow therefore are:
1) create backup in serverA
2) copy to serverB
3) restore copy serverB
4) start replication mode serverB
5) start replication serverA

the crucial point of ordering dependency is between 4 & 5, I've done an exported file resource on serverB to serve as flag for serverA to start but it fails to complie the catalog since that dependency is not in the catalog yet.

Felix Frank

unread,
Mar 6, 2015, 12:53:23 PM3/6/15
to puppet...@googlegroups.com
Hi,

I'm with Garrett - Puppet is an awkward fit for this task.

Have you considered a classic publish/subscribe queue such as RabbitMQ
or Gearman? Puppet can set those up for you, and your nodes can then
orchestrate themselves in a more natural fashion.

HTH,
Felix

lupin...@gmail.com

unread,
Mar 9, 2015, 3:59:46 AM3/9/15
to puppet...@googlegroups.com


Hello Frank, Garret,

Thanks for the insightful advises, especially the message queue stuff but seems an  overkill for my requirement. I ended up using the "exported" resource and wait for apparent convergence after multiple Puppet run.
Cheers
Lupin
Reply all
Reply to author
Forward
0 new messages