Scaling with HAProxy and EC2 Autoscaling groups
Léonard Hetsch
144

there is another improvement, currently it is reloading even if there are no new servers in the autoscaling group. I have updated last 2 lines with this

if !FileUtils.compare_file(‘/etc/haproxy/haproxy.cfg.tmp’,’/etc/haproxy/haproxy.cfg’)

FileUtils.cp(“/etc/haproxy/haproxy.cfg.tmp”, “/etc/haproxy/haproxy.cfg”)

FileUtils.rm(“/etc/haproxy/haproxy.cfg.tmp”)

stdout = `service haproxy reload`

puts “ -> reloaded HAProxy: #{stdout}”

end

and line number 36 with FileUtils.cp(“/etc/haproxy/haproxy.cfg.template”, “/etc/haproxy/haproxy.cfg.tmp”)

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.