3

As was explained in the answer to this question: https://stackoverflow.com/questions/11730590/what-are-some-of-the-tricks-to-using-openshift it should be possible to ssh into some of the other gears when using a scaled app with openshift.

Unfortunately the link mentioned there (https://openshift.redhat.com/community/faq/can-i-access-my-applications-gear) seems to be gone.

Via [my app url]/haproxy-status/ I can see the names of the other gears. They are long names like gear-[long number]-[app name]. Using that name I can no longer ssh into them when I'm ssh'ed into the main gear. ssh there just immediately returns without any error.

If I do ssh blala the same thing happened, so it looks like ssh had been replaced by a noop command on the primary gear?

When I examine the haproxy conf file, I see entries like;

server gear-[long number]-[app name] ex-std-node[number].prod.rhcloud.com:[number] check fall 2 ...

I tried ssh'ing into this ext-std-node... address as well, both from the main/primary application gear as well as from my desktop, but it didn't work in both cases.

How can I get shell access to my other gears?

Community
  • 1
  • 1
dexter meyers
  • 2,798
  • 2
  • 18
  • 22

1 Answers1

11

This command shows how to access individual gears:

rhc app show <appname> --gears

The last column of output is the ssh URL. It is of the form $UUID@$UUID-$NAMESPACE.rhcloud.com . You can ssh into them directly, and they are also accessible via ssh from the "head" gear; they have to be, since git pushes are synchronized from the head gear to the others via ssh.

Andy Grimm
  • 406
  • 4
  • 6
  • Is there any way to do it inside a gear? – chicout Aug 06 '14 at 10:54
  • It is possible to query the openshift broker from inside a gear, but I do not think there is a CLI. You can make a call to https:///broker/rest/domains/$OPENSHIFT_NAMESPACE/applications/$OPENSHIFT_APP_NAME/gear_groups.json (using the auth token in ~/.auth/) and parse the result. Using existing modules, this works: `oo-ruby -r openshift-origin-node/model/application_container -e "::OpenShift::Runtime::ApplicationContainer.from_uuid(ENV['OPENSHIFT_GEAR_UUID']).get_gear_groups(ENV)['data'].each { |gg| gg['gears'].each { |g| puts g['ssh_url'] } }"` – Andy Grimm Oct 08 '14 at 14:20