Bug 1013166 - [RFE] Add the ability to adjust when haproxy shutsdown the app cart in the lead gear
Summary: [RFE] Add the ability to adjust when haproxy shutsdown the app cart in the le...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Image
Version: 1.x
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Ben Parees
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks: 1013167
TreeView+ depends on / blocked
 
Reported: 2013-09-27 23:41 UTC by Timothy Williams
Modified: 2014-04-28 06:49 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1013167 (view as bug list)
Environment:
Last Closed: 2014-04-24 21:34:41 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Timothy Williams 2013-09-27 23:41:44 UTC
Description of problem:
Currently, haproxy, when scaled to 3 or more gears, will shutdown the application cartridge (i.e. ruby, python, php, etc) in the gear that also houses haproxy so that haproxy has access to the entire gear's resources. It is requested that the number of gears required to shutdown the application cartridge be adjustable.

The goal of this is to allow the application creator to have one haproxy gear and just one application gear or , if load permits, have 3 total gears and still have the application cartridge running on the haproxy gear.

Additional info:

Current upstream/1.2/2.0 code:

cartridges/openshift-origin-cartridge-haproxy/hooks/set-gear-endpoints

122 # Disable the local endpoint if one of the remote gears is available and it
123 # isn't already disabled
124 if [ $(grep -E "server\s*gear" $HAPROXY_CONFIG | wc -l) -ge 2 ]; then
125     if grep "local-gear" $HAPROXY_CONFIG | grep "weight 0" &>/dev/null; then
126         echo "Local gear already disabled in config. "
127     else
128         echo "Disabling local gear in the config. "
129         nohup $OPENSHIFT_HAPROXY_DIR/usr/bin/fix_local.sh &
130     fi
131 fi

If we change "2" to an adjustable environment variable in line 124, this should achieve the goal. I am unsure if this is the method development would like to take.

Comment 1 Ben Parees 2014-04-09 15:11:50 UTC
Adding a new OPENSHIFT_HAPROXY_GEAR_RATIO env var that can be used to override the default of "3".  This will need to be documented.

Comment 3 Meng Bo 2014-04-11 11:48:45 UTC
Checked on devenv_4547, issue has been fixed.

The new env has been introduced. And works well.

After set the OPENSHIFT_HAPROXY_GEAR_RATIO to 4, the head gear will not DOWN when there are 3 gears. And will DOWN when there are 4 gears.

Move bug to verified.


Note You need to log in before you can comment on or make changes to this bug.