Creating TCP Route

This tutorial describes how to create a TCP route for a job.

Note that to create a TCP route, your cluster will need to have the TCP Router installed.

Instructions

To deploy an app using the tcp router.

1) Create an app using APC and disable route generation.

apc app create <appname> -dr

Disabling routes (-dr) ensures that a default HTTP route is not auto-created.

2) Add the port your application is listening to.

apc app update <appname> --port-add <portnum>

If the application is listening on the $PORT env variable, use port 0 and the port is randomly selected.

3) Add the TCP route.

a. If you use auto, Apcera will figure out the public ip for you and assign you a random public port.

apc route add tcp://auto -a <appname> -p <portnum>

b. If you need to specify a particular IP and port, provide the public IP of the TCP router:

apc route add tcp://10.101.12.131:<public_port> -a <appname> -p <portnum>

4) Start the application.

apc app start <appname>

5) You should now be able to connect to your application at the route printed by APC.

For example:

Autoprovisioned TCP route "tcp://10.101.12.131:38976"