Skip to content

Changing the Ports Your App Serves Traffic On

Navraj Chohan edited this page Sep 11, 2013 · 4 revisions

Introduction

AppScale automatically hosts one or more Google App Engine apps for you on virtualized clusters or cloud infrastructures. Since we don't assume that you have DNS specifically for AppScale, we use different ports to run each App Engine app. AppScale 1.11.0 and greater have the ability to dynamically change what ports your app runs on, once it has been deployed. This post walks through common use cases of this feature and how to serve them.

Relocating Applications

The main use case we've seen for this feature is to serve people who need their App Engine app to serve HTTP traffic on port 80 and HTTPS traffic on port 443. Begin by starting AppScale up as usual and deploying your application:

appscale up
appscale deploy ~/myapp

Navigate to the URL that appscale deploy returns and confirm that your application is indeed running. Then, run appscale relocate appid http-port https-port to move the app to port 80 for HTTP and 443 for HTTPS:

appscale relocate myapp 80 443

You then should see output like the following:

$ appscale relocate myapp 80 443
Successfully issued request to move myapp to ports 80 and 443.
Your app serves unencrypted traffic at: http://192.168.10.2:80
Your app serves encrypted traffic at: https://192.168.10.2:443

You then can navigate to the links provided to access your app via HTTP or HTTPS. Note that if you do appscale down to take down your AppScale cloud, then appscale up to bring it back up, AppScale will automatically redeploy all applications previously deployed, to the same ports.

Limitations and Future Work

This feature is brand new in AppScale, and thus there are some rough edges on it at the moment. For now, we don't dynamically update our firewall (appscale/firewall.conf) with what ports we allow inbound access on, so when relocating apps, be sure to use ports that the firewall exposes (80 and 8080-8100 for HTTP, 443 and 4380-4400 for HTTPS). You can always change that firewall file to open up more ports as you like. Also, we're seeing issues where Java Task Queue tasks fail after a Java app has been relocated, but an appscale down then appscale up after the relocation will fix that until we get a full fix in there. Of course, we welcome your help if you're interested in fixing these with us, so feel free to join us in #appscale on freenode.net and let us know what you think!

Clone this wiki locally