FAQ
I'm looking for a way to balance out services when insuring the content of
configuration files.

Example is how to do this with /etc/yp.conf:
##
domain example.com server 192.168.1.2
domain example.com server 192.168.1.3
domain example.com server 192.168.1.4
##

I'd like to *change the order of the entries *in a random or rotating
fashion so that multiple machines would get a *different *order so that we
can scale the services without having to invest in a load balancer.

Obviously, we wouldn't want the contents to continually change on every
machine, so the tests would need to be appropriate.

Any ideas?

Thanks.

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/4GzGrjJgRtQJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Search Discussions

  • Jcbollinger at Oct 10, 2012 at 8:49 pm

    On Wednesday, October 10, 2012 11:10:32 AM UTC-5, trevman wrote:
    I'm looking for a way to balance out services when insuring the content of
    configuration files.

    Example is how to do this with /etc/yp.conf:
    ##
    domain example.com server 192.168.1.2
    domain example.com server 192.168.1.3
    domain example.com server 192.168.1.4
    ##

    I'd like to *change the order of the entries *in a random or rotating
    fashion so that multiple machines would get a *different *order so that
    we can scale the services without having to invest in a load balancer.

    Obviously, we wouldn't want the contents to continually change on every
    machine, so the tests would need to be appropriate.

    Any ideas?
    There are lots of ways you could do this, but the the ready-built
    fqdn_rotate() function in Puppetlabs's add-in "stdlib" module
    (https://github.com/puppetlabs/puppetlabs-stdlib) would probably serve as a
    good foundation. Put the NIS server IPs in an array, shuffle it with
    fqdn_rand(), and read the results out into your yp.conf template. Each
    node will have a consistent order as long as its FQDN does not change.


    John

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/Q_WmB-vH70UJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Trevman at Oct 11, 2012 at 10:08 pm
    I'll check out the library and the fdqn_rotate function.

    Thanks.

    On Wednesday, October 10, 2012 12:55:21 PM UTC-7, jcbollinger wrote:


    On Wednesday, October 10, 2012 11:10:32 AM UTC-5, trevman wrote:

    I'm looking for a way to balance out services when insuring the content
    of configuration files.

    Example is how to do this with /etc/yp.conf:
    ##
    domain example.com server 192.168.1.2
    domain example.com server 192.168.1.3
    domain example.com server 192.168.1.4
    ##

    I'd like to *change the order of the entries *in a random or rotating
    fashion so that multiple machines would get a *different *order so that
    we can scale the services without having to invest in a load balancer.

    Obviously, we wouldn't want the contents to continually change on every
    machine, so the tests would need to be appropriate.

    Any ideas?
    There are lots of ways you could do this, but the the ready-built
    fqdn_rotate() function in Puppetlabs's add-in "stdlib" module (
    https://github.com/puppetlabs/puppetlabs-stdlib) would probably serve as
    a good foundation. Put the NIS server IPs in an array, shuffle it with
    fqdn_rand(), and read the results out into your yp.conf template. Each
    node will have a consistent order as long as its FQDN does not change.


    John
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/XieYuut56GoJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedOct 10, '12 at 4:13p
activeOct 11, '12 at 10:08p
posts3
users2
websitepuppetlabs.com

2 users in discussion

Trevman: 2 posts Jcbollinger: 1 post

People

Translate

site design / logo © 2022 Grokbase