Created
April 7, 2011 08:24
-
-
Save ArthurClune/907330 to your computer and use it in GitHub Desktop.
sample ldirectord.erb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
virtual=<%= vip %>:<%= port %> | |
<% if weights.empty? then -%><% real_servers.each do |real_server| -%> | |
real=<%= real_server %>:<%= port %> gate | |
<% end -%><% else -%><% real_servers.zip(weights).each do |real_server, weight| -%> | |
real=<%= real_server %>:<%= port %> gate <%= weight %> | |
<% end -%><% end -%> | |
<% if not checktype.empty? then -%> | |
checktype=<%= checktype -%> | |
<% end -%> | |
<% if not service.empty? then -%> | |
service=<%= service %> | |
<% end -%> | |
<% if not checkcommand.empty? then -%> | |
checkcommand=<%= checkcommand %> | |
<% end -%> | |
protocol=<%= protocol %> | |
scheduler=<%= scheduler %> | |
persistent=<%= persistent %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
virtual=192.168.1.1:53 | |
real=192.168.1.2:53 gate | |
real=192.168.1.3:53 gate | |
protocol=udp | |
scheduler=rr | |
persistent=300 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
virtual=<%= vip %>:<%= port %> | |
<%= | |
out="" | |
if weights.empty? then | |
real_servers.each do |real_server| | |
out += " real=" + real_server + " port:" + port + " gate\n" | |
end | |
else | |
real_servers.zip(weights).each do |real_server, weight| | |
out += " real= " + real_server + " port:" + port + " gate " + weight + "\n" | |
end | |
end | |
if not checktype.empty? then | |
out += " checktype=" + checktype + "\n" | |
end | |
if not service.empty? then | |
out += " service=" + service + "\n" | |
end | |
if not checkcommand.empty? then | |
out += " checkcommand=" + checkcommand + "\n" | |
end | |
out += " protocol=" + protocol + "\n" | |
out += " scheduler=" + scheduler + "\n" | |
out += " persistent=" + persistent | |
out | |
-%> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment