Cloud Hosting Suggestions for OTP

504 views
Skip to first unread message

Trinity Metro

unread,
Aug 18, 2020, 2:30:11 PM8/18/20
to OpenTripPlanner Users
We are mainly a PHP shop so all of our current hosting providers are more web tech specific and cannot handle Java applications. 

Any suggestions on reasonable cloud hosting for spinning up a server, that already come ready to handle a Java Application Open Trip Planner.

We only need to use this on a temporary basis for a project. 

I was looking into Heroku but I do not think you can get access to the actual server folders? It pulls your project from a Git repo. We will be building 3 different Trip Planners, each with its own set of GTFS data and will always need to be updating this data on a frequent basis during the project.

I was looking into AWS but looks like to have to build your server yourself. 

Looking to be able to ssh into server box, or SFTP into server and place the OTP files and then have access to update our GTFS data regularly.

Thanks! 


ju...@glaive.pro

unread,
Aug 18, 2020, 3:36:21 PM8/18/20
to OpenTripPlanner Users
Have you tried the tool already? I am also a PHP developer and it was pretty easy to get this running.

My route would be to set up a ubuntu VPS on Vultr or DigitalOcean, create a systemd service that starts and restarts the app and there you have. I left Java serving on the default ports and hid them behind firewall (ufw), I am using NGINX to proxy it to public.

I've also set up a nightly procedure that shuts down OTP, downloads fresh GTFS, OSM and restarts the service, that is also just a single script launched from cron.d. I'd say in total that's a day of work to get your setup as you want it to if you have any webserver experience.

Andrew Byrd

unread,
Aug 19, 2020, 12:45:04 AM8/19/20
to Trinity Metro, OpenTripPlanner Users
Hello,

For what it’s worth, we use AWS EC2 heavily for hosting OTP and other transit information software and it has been a good experience. I suppose you could say you have to “build the server yourself” but that just means selecting an existing machine image already containing a complete operating system and launching it. You may have to add a JVM but that is a one-liner. We’ve been using Amazon Linux and the Amazon Corretto patched JVM which is readily available for installation on EC2 servers. (https://docs.aws.amazon.com/corretto/latest/corretto-11-ug/amazon-linux-install.html)

Working with OTP you way want to SSH in, SCP files over and move things around in the filesystem. EC2 instances are good for this.

Hope this helps,
Andrew

--
You received this message because you are subscribed to the Google Groups "OpenTripPlanner Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/opentripplanner-users/86be9e6a-4e88-4e64-933c-131de5fa5b8an%40googlegroups.com.

Trinity Metro

unread,
Aug 19, 2020, 1:48:18 PM8/19/20
to OpenTripPlanner Users
Thanks everyone for their suggestions.   

I will check out both suggestions but I think might be leaning toward AWS.  

Andy,  since you have AWS experience,  since this project is for only 3 months and we need 3 separate Trip Planners:
1. If we went with EC2 intances, would we need 3 different ones, or could we run all 3 from one machine? 
2. Would you think we could use the Lightsail product? Cheaper product especially if we need separate instances?

Thanks,

Darren

Mauro Lenzi

unread,
Aug 27, 2020, 8:05:39 AM8/27/20
to OpenTripPlanner Users
Hi Darren,

we are an Italian software house; we we work for italian public transport company and international system integrators (https://www.e-soft.it)

We also have some experiences in installing OTP on Amazon EC2: can you help you?

Best, Mauro

Andrew Byrd

unread,
Aug 27, 2020, 9:17:01 AM8/27/20
to Trinity Metro, OpenTripPlanner Users
Hi Darren,

It it entirely possible to run multiple instances of OTP on one cloud instance, or multiple “routers” (different transportation network graphs) within a single OTP instance. It will depend on the size and complexity of your network, as well as the request load and variability, how much memory or CPU you need, and whether it’s more economical to use one or several instances.

I have never used Lightsail so I can’t offer any opinions there. We usually just spin up standard EC2 instances with a bare Linux OS, install Java, download a JAR and run it.

-Andrew

Trinity Metro

unread,
Aug 27, 2020, 10:34:32 AM8/27/20
to OpenTripPlanner Users
Thanks Mario and Andrew for all of the info.  

So far we have created our AWS Lightsail instance with the Amazon Linux version.  We have installed Java and then we had to upgrade it to 1.8 for the OPT. We have move over out OTP files but that is where we are running into trouble.  We run the commands for the OTP to run, then I get my public IP address of our server instance and of course I am not seeing anything.  

Normally on our local you just open up web browser and go to localhost:8080 and then you will see the OTP running.  

So how do I get OTP to run and show up when I visit my instance IP address?  Once we get that running, I will then create a static IP and then map one of our domains to it. 

But first, just seeing the OTP run on that public IP address is our next hurdle.   Again I am a PHP developer and do not have the Java experience. I did read that OTP comes with a built in web server, So I assume I do not need any web server software installed on the instance. 

Any suggestions on the next steps getting our OTP instance to run and be visible using our IP address on our AWS instance? 

BTW, when I created the Lightsail instance, it is also Bare Bones Amazon Linux.  I did not create it with any other technology stack such as LAMP, etc.. 

Thanks again for all of the help! 

Darren

Andrew Byrd

unread,
Aug 27, 2020, 10:44:39 AM8/27/20
to Trinity Metro, OpenTripPlanner Users


On 27 Aug 2020, at 22:34, Trinity Metro <ridetrin...@gmail.com> wrote:
So how do I get OTP to run and show up when I visit my instance IP address?  Once we get that running, I will then create a static IP and then map one of our domains to it. 

Ah, you’ll need to open up the port 8080 on that instance for access from outside. The EC2 documentation should have examples on how to do that.

I think this is the page:

-Andrew

Mauro Lenzi

unread,
Aug 27, 2020, 10:52:51 AM8/27/20
to OpenTripPlanner Users
Sorry, but we don't use Lightsail and we usually directly instantiate EC2 servers.

OTP uses NGIX web server. As suggested by Andrew, I think you could verify using Amazon console the security group associated to your Amazon: you should open HTTP or HTTPS port.

Note: I suggest you to permit the connection to ssh port only from your IP (for security reasons)

Best, Mauro

Andrew Byrd

unread,
Aug 27, 2020, 11:23:24 AM8/27/20
to Mauro Lenzi, OpenTripPlanner Users


On 27 Aug 2020, at 22:52, Mauro Lenzi <m.l...@e-soft.it> wrote:
OTP uses NGIX web server. As suggested by Andrew, I think you could verify using Amazon console the security group associated to your Amazon: you should open HTTP or HTTPS port.

OTP itself does not use the Nginx web server. It has an embedded Grizzly server (the HTTP component used by the Glassfish application server).

By default OTP binds to a high, non-privileged port number. People sometimes run Nginx as a reverse proxy to expose the OTP API along with other APIs or files on the same machine, at the standard privileged port number 80.

-Andrew

Trinity Metro

unread,
Aug 31, 2020, 9:25:57 AM8/31/20
to OpenTripPlanner Users
Thanks Mauro and Andrew for the help.

Lightsail comes with out of the box with two firewall rules.  SSH TCP to port 22 and HTTP  TCP to port 80.  I could not adjust the HTTP TCP to port 80. So I had to create a custom rule TCP to port 8080 and then remove the default HTTP TCP to port 80 and we now have it running. 

Now we have a Lighsail instance running a Open Trip Planner with our custom GTFS data at            http://lightsailipaddress:8080.  

Once we get the others two OTP running I will then map some custom domains to each OTP instance.

Now the next big question: If Possible.  How can we run two other OTP instances on the same server?  

Thanks again for everyones help! 

Darren

Trinity Metro

unread,
Sep 4, 2020, 12:26:20 PM9/4/20
to OpenTripPlanner Users
Have one big question that we are running into.  

I can SSH into the server and start up the OTP, works perfectly. Go to the IP address works great!

But every time I close the SSH console, the OTP stops working.

How can we keep the OTP instance working all the time!

Thanks,

Darren
Reply all
Reply to author
Forward
0 new messages