Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

copy w/failover clarification

0 views
Skip to first unread message

Jason Edgecombe

unread,
Dec 23, 2005, 2:17:11 PM12/23/05
to help-c...@gnu.org
Hi,

I have a question about the failover behavior of the copy command.

In the docs, it says that failover= defines a class that is defined if
the copy fails, not a backup server, is this correct?

For example, would the following pseudocode work:

any::
copy file1 from server1 failover=failoverclass1

failoverclass1::
copy file1 from server2 failover=failoverclass2

failoverclass2::
copy from server3

Would the above pseudocode would walk through a list of servers
(server1, server2, server3)?

I keep seeing people saying that failover only allows one backup server,
which conflicts with my understanding of the failover functionailty.
Which is the correct interpretation?

Sincerely,
Jason


christian pearce

unread,
Dec 23, 2005, 2:29:46 PM12/23/05
to Jason Edgecombe, help-c...@gnu.org
Jason,

The following is an example of the failover in action. Yes you can
have multiple failovers.

I would like to see the ability to define mutiple servers. Alas I
think will have to wait for Cfengine 3.

pearcec@wideload:/var/tmp$ cat copy-test.cf
control:

actionsequence = ( copy )

AddInstallable = ( failed1 failed2 broken )

copy:

any::
/var/tmp/test
dest=/var/tmp/test
server=192.168.1.2
failover=failed1

failed1::
/var/tmp/test
dest=/var/tmp/test
server=192.168.1.3
failover=failed2

failed2::
/var/tmp/test
dest=/var/tmp/test
server=192.168.1.4
failover=broken

alerts:

broken::
"Failed to copy configs"
pearcec@wideload:/var/tmp$ cfagent -f ./copy-test.cf -I
cfengine:: Couldn't open a socket
cfengine:: Unable to establish connection with 192.168.1.2 (failover)
cfengine:: Couldn't open a socket
cfengine:: Unable to establish connection with 192.168.1.3 (failover)
cfengine:: Couldn't open a socket
cfengine:: Unable to establish connection with 192.168.1.4 (failover)
cfengine:: Failed to copy configs
pearcec@wideload:/var/tmp$

> _______________________________________________
> Help-cfengine mailing list
> Help-c...@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-cfengine
>


--
Christian Pearce


Tod Oace

unread,
Dec 23, 2005, 2:35:07 PM12/23/05
to christian pearce, help-c...@gnu.org
On Dec 23, 2005, at 11:29, christian pearce wrote:

> Jason,
>
> The following is an example of the failover in action. Yes you can
> have multiple failovers.
>
> I would like to see the ability to define mutiple servers. Alas I
> think will have to wait for Cfengine 3.

Is that planned? That would be great!

With Cfengine 2 you can copy from server=server1:server2. The problem
with it is if the copy from server1 is successful then it moves ahead
and does another copy from server2. And if server1 isn't responsive
then it seems to hang rather than timing out. Works great if server1
refuses connection though. :)

> --
> Christian Pearce

--
Tod Oace <t...@quay.com>

christian pearce

unread,
Dec 23, 2005, 2:43:40 PM12/23/05
to Tod Oace, help-c...@gnu.org
Ah so that does work, sort of. Yea I would like to have it continue
past the second server if the first one suceeds. Do you see this
behavior documented anywhere?


--
Christian Pearce


Tod Oace

unread,
Dec 23, 2005, 3:08:36 PM12/23/05
to christian pearce, help-c...@gnu.org
On Dec 23, 2005, at 11:43, christian pearce wrote:

> Ah so that does work, sort of. Yea I would like to have it continue
> past the second server if the first one suceeds. Do you see this
> behavior documented anywhere?

The reference manual does say that Cfengine iterates over the server
field ("Iterative expansion is currently restricted to:").T This
isn't how I first interpreted it though. When I saw you could put a
list of servers there I assumed it was for fail over. I still can't
think of an application for pulling something from multiple servers.
Anyone doing this? -Tod

> On 12/23/05, Tod Oace <t...@quay.com> wrote:
>> On Dec 23, 2005, at 11:29, christian pearce wrote:
>>
>>> Jason,
>>>
>>> The following is an example of the failover in action. Yes you can
>>> have multiple failovers.
>>>
>>> I would like to see the ability to define mutiple servers. Alas I
>>> think will have to wait for Cfengine 3.
>>
>> Is that planned? That would be great!
>>
>> With Cfengine 2 you can copy from server=server1:server2. The problem
>> with it is if the copy from server1 is successful then it moves ahead
>> and does another copy from server2. And if server1 isn't responsive
>> then it seems to hang rather than timing out. Works great if server1
>> refuses connection though. :)
>>
>>> --
>>> Christian Pearce
>>
>> --
>> Tod Oace <t...@quay.com>
>>
>>
>
>
> --
> Christian Pearce

--
Tod Oace <t...@quay.com>

Alexander Jolk

unread,
Dec 26, 2005, 6:27:15 AM12/26/05
to Tod Oace, help-c...@gnu.org
Tod Oace wrote:
> The reference manual does say that Cfengine iterates over the server
> field ("Iterative expansion is currently restricted to:"). [...]

> I still can't think of an
> application for pulling something from multiple servers. Anyone doing
> this?

Yes, I'm using this feature in order to collect some information from
all of my hosts. They all locally put a few files named after the local
host name, into /var/cfengine/collect/, and I then copy this directory
from several machines to a single one, recursively so as to finally
collect everything on the master server. Works quite nicely, actually.

Alex


--
Alexander Jolk * BUF Compagnie * al...@buf.com
Tel +33-1 42 68 18 28 * Fax +33-1 42 68 18 29


0 new messages