From b1fff1d2ebbabbca90b0103bc97540bc21c0e920 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Wed, 4 Apr 2018 07:47:45 -0700 Subject: [PATCH] Add haproxy maintenance instructions Change-Id: I236d55a0bbc44d29ef4290972dc30d68f683c040 --- doc/source/git.rst | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/doc/source/git.rst b/doc/source/git.rst index bb1fabcf6f..22ba30d5fe 100644 --- a/doc/source/git.rst +++ b/doc/source/git.rst @@ -44,3 +44,34 @@ host will be served by one backend node unless nodes are added or removed. The jeepyb script create-cgitrepos runs against projects.yaml to generate the /etc/cgitrepos file listing all the git repositories. The git repositories are synced to all the nodes from the Gerrit server. + +Backend Maintenance +=================== + +To temporarily remove a git backend from the HAProxy load balancer, +you can put it in "maintenance" mode. This can be done interactively +on the HAProxy host. Note that long-term changes to the topology +should be made via configuration management. These commands must be +run as root. + +To see the current status of all servers:: + + echo "show stat" | socat /var/lib/haproxy/stats stdio + +To disable a server (eg, git08):: + + echo "disable server balance_git_daemon/git08.openstack.org" | socat /var/lib/haproxy/stats stdio + echo "disable server balance_git_http/git08.openstack.org" | socat /var/lib/haproxy/stats stdio + echo "disable server balance_git_https/git08.openstack.org" | socat /var/lib/haproxy/stats stdio + +To re-enable a server:: + + echo "enable server balance_git_daemon/git08.openstack.org" | socat /var/lib/haproxy/stats stdio + echo "enable server balance_git_http/git08.openstack.org" | socat /var/lib/haproxy/stats stdio + echo "enable server balance_git_https/git08.openstack.org" | socat /var/lib/haproxy/stats stdio + +To run these commands and others interactively, issue the prompt +command to haproxy:: + + socat readline /var/lib/haproxy/stats + prompt