Addressing 1st gear in scaling applications

The OpenShift forums have been retired.
You can still read and search them, but for help, please post a question on Stack Overflow.

Hi,

I don't know if I'm being dumb and I have looked quite extensively for an answer. When an app scales it is possible to bypass HAProxy and address a new instance gear directly by finding the OPENSHIFT_GEAR_DNS for that gear or by using the gear name given by HAProxy. However it does not seem to work for the local gear.

I have tried using a combo of OPENSHIFT_GEAR_UUID & OPENSHIFT_APP_DNS for the local gear (as this is how the OPENSHIFT_GEAR_DNS is made up for new scaled gears), but this does not work.

The issue is that the local gear only seems to be accessible via the OPENSHIFT_APP_DNS (which is the same as the OPENSHIFT_GEAR_DNS for this gear). This is fine for a non-scaled app but once an app scales and is under load there seems to be no guaranteed way to bypass HAProxy and access the first gear. Is this an oversight or is there some way to do it I have missed?

Thanks,

Dan Kitchen

Hi Dan,

Do you want to get to your primary gear directly from another (secondary) gear or from outside world?

From the outside if possible. Similar in the way you can use: OPENSHIFT_GEAR_DNS or OPENSHIFT_GEAR_UUID-domain_name.rhcloud.com to bypass HAProxy and directly access the application instance scaled gear.

The only way to do that is to ssh onto the head gear and run "curl $OPENSHIFT__IP:$OPENSHIFT_PORT". So for example, I'm running a php-5.3 scalable app, i would run:

rhc ssh scalableApp
env | grep IP
curl $OPENSHIFT_PHP_IP:$OPENSHIFT_PHP_PORT