Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for haproxyctl #56

Open
ivomarino opened this issue Feb 15, 2017 · 0 comments
Open

Add support for haproxyctl #56

ivomarino opened this issue Feb 15, 2017 · 0 comments
Assignees

Comments

@ivomarino
Copy link
Member

ivomarino commented Feb 15, 2017

This version of haproxyctl http://packages.ubuntu.com/xenial/all/haproxyctl/download, from Ubuntu Xenial, can be installed without issues on Trusty:

haproxyctl show info
Name: HAProxy
Version: 1.6.11-1ppa1~trusty
Release_date: 2016/12/27
Nbproc: 1
Process_num: 1
Pid: 13539
Uptime: 0d 0h06m13s
Uptime_sec: 373
Memmax_MB: 0
Ulimit-n: 4033
Maxsock: 4033
Maxconn: 2000
...

haproxyctl allows us to easily add/remove servers on the fly from cli, another approach would be:

echo "show info" | nc -U /var/run/haproxy/admin.sock | head -10
Name: HAProxy
Version: 1.6.11-1ppa1~trusty
...

# active or backup DOWN for maintenance (MAINT) 
echo "disable server www-backend/localhost" | nc -U /var/run/haproxy/admin.sock
echo "enable server www-backend/localhost" | nc -U /var/run/haproxy/admin.sock

# maintenance page for all, except 192.168.80.1 and 10.0.0.100
echo "add acl #6 0.0.0.0/0" | nc -U /var/run/haproxy/admin.sock
echo "add acl #7 192.168.80.1" | nc -U /var/run/haproxy/admin.sock
echo "add acl #7 10.0.0.100" | nc -U /var/run/haproxy/admin.sock

# disable maintenance page again
echo "del acl #7 10.0.0.100" | nc -U /var/run/haproxy/admin.sock
echo "del acl #7 192.168.80.1" | nc -U /var/run/haproxy/admin.sock
echo "del acl #6 0.0.0.0/0" | nc -U /var/run/haproxy/admin.sock
@ivomarino ivomarino self-assigned this Feb 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant