help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: copy failover


From: Jeffrey Koetsier
Subject: Re: copy failover
Date: Wed, 12 Feb 2003 10:37:01 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021226 Debian/1.2.1-9

I gathered some more info. Hopefully it gives you some more insight.

-CONFIG- (this file gets included from my cfagent.cf)

control:
       addinstallable  = ( myfile myretry )
       actionsequence  = ( copy )
       fileserver      = ( cfengine.domain.nl )

copy:
 any::
       /cfengine/files/FILEA   dest=/etc/FILENAME mode=755
                               owner=root group=root
                               server=$(fileserver)
failover=myretry define=myretry elsedefine=myretry

 myretry::
       /cfengine/files/FILEB   dest=/etc/FILENAME mode=755
                               owner=root group=root
                               server=$(fileserver)

I gave the FILEA all the possible define entries to just execute 'myretry' no matter what.
But it won't do it.

-CFAGENT debug info-
/cfengine/files/FILEA
+755
-7022
dest: /etc/FILENAME
action: fix
Size > -1
recurse=0
uids = ( 0 )
gids = ( 0 )
filters:
exclude:
ignore:
symlink:
include:
classes = any
method = t (time/checksum)
server = cfengine.domain.nl (encrypt=n,verified=n)
accept the server's public key on trust? n
purging = n
host entry cache = 1473192 = 10.200.197.112
Define myretry
ElseDefine myretry
FailoverClasses myretry

/cfengine/files/FILEB
+755
-7022
dest: /etc/FILENAME
action: fix
Size > -1
recurse=0
uids = ( 0 )
gids = ( 0 )
filters:
exclude:
ignore:
symlink:
include:
classes = myretry
method = t (time/checksum)
server = cfengine.domain.nl (encrypt=n,verified=n)
accept the server's public key on trust? n
purging = n
host entry cache = 1473384 = 10.200.197.112
Define
ElseDefine
FailoverClasses myretry

-CFSERVD debug-
box: Strongly authentication of client client.domain.nl/10.200.197.113
box: Couldn't stat filename /cfengine/files/FILEA from host client.domain.nl

box: lstatbox: Host authorization/authentication failed or access denied
box: From (host=client.domain.nl,user=root,ip=10.200.197.113)

Somehow if the file is 'unstattable' (not there) it returns an access denied and doesn't set any variables. When I put FILEA on my fileserver, it will copy it, and also (because I used define/elsedefine/failover all together) copy FILEB. And in the debug output I see nicely: AddMultipleClasses(myretry), AddClassToHeap(myretry), Appending [myretry] and then copies FILEB.

Thanks for the support

Jeffrey Koetsier

Wipf, Stefan wrote:

Sorry, my response is to a slightly different problem.  Looks like
your config should work just fine.  Did you run cfengine in verbose
or debug mode to see if the 'myretry' class gets turned on?


Stefan Wipf wrote:
You will need a second copy statement in your actionsequence, because
by the time your failover class gets turned on cfengine has already
moved to the next action.

This has worked for us:

strategies:
  { load_balance
    _update_attempt1: "5"
    _update_attempt2: "5"
  }

control:
  server1             = ( host1 )
  server2             = ( host2 )
  server3             = ( host3 )
  addinstallable      = ( _update_attempt1 _update_attempt2
_update_failed1 _update_failed2 _update_failed )
  actionsequence      = ( copy copy )

copy:

  _update_attempt1::
    /FILE dest=/FILE  server=$(server1)
                      failover=_update_attempt2:_update_failed1

  _update_attempt2::
    /FILE dest=FILE   server=$(server2)
                      failover=_update_attempt1:_update_failed2

  ### final attempt
  _update_failed1._update_failed2::
    /FILE dest=FILE   server=$(server3)
                      failover=_update_failed

Jeffrey Koetsier wrote:
Hi All,

The last few hours i've been poking around with a simple filecopy and
some sort of redundancy.

I want to copy FILEA to /etc/FILENAME, if this FILEA doesn't exists it
should go run another class to copy FILEB to /etc/FILENAME.

ie:

copy:
  myfile::
    /cfengine/files/FILEA      dest=/etc/FILENAME mode=755 owner=root
group=root server=$(fileserver) failover=myretry

  myretry::
    /cfengine/files/FILEB      dest=/etc/FILENAME mode=755 owner=root
group=root server=$(fileserver)

instead of failover=myretry I tried define=myretry or
elsedefine=myretry. But none of them work.

This is what I see on my fileserver side:

box: Couldn't stat filename /cfengine/files/FILEA from host box2
box: lstatbox: Host authorization/authentication failed or access denied

Which is ok, but it doesn't continue with the myretry class.

Any ideas how to solve this within CFEngine instead of using shellscript
 thingies?

Thanks

_______________________________________________
Help-cfengine mailing list
Help-cfengine@gnu.org
http://mail.gnu.org/mailman/listinfo/help-cfengine
--
Stefan Wipf
swipf@htc.com






reply via email to

[Prev in Thread] Current Thread [Next in Thread]