GDNSD-PLUGIN-WEIGHTED(8) | gdnsd | GDNSD-PLUGIN-WEIGHTED(8) |

plugins => { weighted => { multi = false # default service_types = up up_thresh => 0.5 # default corpwww => { lb01 = [ lb01.example.com., 99 ] lb02 = [ lb02.example.com., 15 ] lb03 = [ lb03, 1 ] } frontwww6 => { service_types = up multi = true wwwhost01 = [ 2001:db8::123, 4 ] wwwhost02 = [ 2001:db8::456, 1 ] wwwhost03 = [ 2001:db8::789, 2 ] } pubwww => { service_types = [ web_check, foo ] up_thresh => 0.01, pubhost01 = [ 192.0.2.1, 44 ] pubhost02 = [ 192.0.2.2, 11 ] pubhost03 = [ 192.0.2.3, 11 ] pubhost04 = [ 192.0.2.4, 11 ] } cdnwww => { service_types = web_check datacenter1 => { d1-lb1 = [ 127.0.0.1, 2 ] d1-lb2 = [ 127.0.0.2, 2 ] } datacenter2 => { d2-lb1 = [ 127.0.0.3, 2 ] d2-lb2 = [ 127.0.0.4, 2 ] d2-lb3 = [ 127.0.0.5, 1 ] } } mixed => { multi => false, addrs_v4 => { lb1 = [ 127.0.0.3, 2 ] lb2 = [ 127.0.0.4, 2 ] } addrs_v6 => { multi => true www6set1 = { lb01 => [ 2001:db8::123, 4 ] lb02 => [ 2001:db8::456, 1 ] } www6set2 = { lb01 => [ 2001:db8::789, 4 ] lb02 => [ 2001:db8::ABC, 1 ] } } } cn => { service_types = my_cn_check foo = [ lb01.example.com., 99 ] bar = [ lb02.example.com., 15 ] } } }Zonefile RRs referencing the above:

www.corp 300 DYNC weighted!corpwww www6.front 300 DYNA weighted!frontwww6 www 300 DYNC weighted!pubwww cdn 300 DYNA weighted!cdnwww mixed-a 300 DYNA weighted!mixed cnames 300 DYNC weighted!cn

X => { multi => false # default # odds below assume no addresses are down: lb01 => [ 192.0.2.1, 45 ] # 25% chance (45/180) lb02 => [ 192.0.2.1, 60 ] # 33% chance (60/180) lb03 => [ 192.0.2.1, 75 ] # 42% chance (75/180) }

X => { multi => true # odds below assume no addresses are down: lb01 => [ 192.0.2.1, 45 ] # 75% chance (45/60) lb02 => [ 192.0.2.1, 60 ] # 100% chance (60/60) lb03 => [ 192.0.2.1, 60 ] # 100% chance (60/60) # overall possible result-sets: # lb01,lb02,lb03 -> 75% # lb02,lb03 -> 25% }

X => { group1 => { lb01 => [ 192.0.2.1, 10 ] lb02 => [ 192.0.2.1, 20 ] lb03 => [ 192.0.2.1, 30 ] } group2 => { lb01 => [ 192.0.2.7, 10 ] lb02 => [ 192.0.2.8, 20 ] lb03 => [ 192.0.2.9, 30 ] } }The grouped single case, of course, occurs when the configuration layout is as shown above, and the "multi" parameter is "false" (the default). In grouped-single mode, essentially the groups are weighted against each other similarly to the single case for ungrouped addresses, resulting in the choice of a single group from the set of groups. Then the addresses within the chosen group are weighted against each other in multi-style, returning potentially more than one address from the chosen group. Specifically, each group's odds of being the single group chosen is "group_dyn_weight / total_dyn_weight", where the group's dynamic weight is the sum of the dynamic weights within it ("DOWN" addresses are zero), and the total dynamic weight is the dynamic sum of all groups. Then within each group, the odds of each address being included in the multi-response set is "addr_dyn_weight / group_max_dyn_weight". "up_thresh" operates on all groups as a whole, and if the non-"DOWN" sum of all weights in all groups fails to meet the standard of "ceil(up_thresh * total_sum_configured_weight)", then all addresses will be treated as if they are "UP" for selection purposes, and resource-level failure will be signalled upstream.

2017-07-15 | gdnsd 2.2.4 |