简体   繁体   English

如何在基于带有mysql数据库的tomcat服务器的AWS上部署Java Spring Restful Service?

[英]How to deploy java spring restful service on AWS based on tomcat server with mysql database?

I have restful spring web service running on tomcat server and have mysql database on backend. 我在tomcat服务器上运行了宁静的spring Web服务,并在后端使用了mysql数据库。 I deployed war file of my service using aws elastic beanstalk free account yet but I am unable to setup mysql database. 我使用aws弹性beantalk免费帐户部署了服务的war文件,但无法设置mysql数据库。 Can anyone guide me on this matter ? 有人可以指导我吗? Secondly, our application has android side code which will call my REST API so is there any other way to do this instead of setting up amazon web services for testing purposes ? 其次,我们的应用程序具有将调用我的REST API的android辅助代码,因此还有其他方法可以代替设置用于测试目的的亚马逊网络服务吗?

You are going the right way; 你走对了路; Android should call REST APIs. Android应该调用REST API。 These APIs can be implemented in following ways: 可以通过以下方式实现这些API:

  1. As you suggested; 如您所建议; use spring on tomcat to expose such apis. 在tomcat上使用spring来暴露此类api。

  2. Use API Gateway exposed by AWS. 使用AWS公开的API网关。 This api gateway can even call lambda expressions in backend which can be written in Java/Python etc. 这个api网关甚至可以在后端调用lambda表达式,这些表达式可以用Java / Python等编写。

I will suggest you to go ahead with 1 as u are already aware of spring/tomcat etc. and MOST companies use this only. 我建议您继续使用1,因为您已经知道spring / tomcat等,而MOST公司仅使用此方法。

For MySQL database you have following options: 对于MySQL数据库,您有以下选择:

  1. Install MySQL on your local EC2 server ( where you have tomcat running ); 在您的本地EC2服务器(要运行Tomcat的服务器)上安装MySQL; or on another EC2 server. 或在另一台EC2服务器上。

  2. You can use MySQL as a service which is RDS. 您可以将MySQL用作RDS服务。 It is expensive but easy to configure. 它很昂贵,但易于配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在tomcat服务器上部署带有mysql数据库的java web应用程序 - how to deploy java web application with mysql database on tomcat server 如何将基于Spring的RESTful服务作为Servlet添加到Tomcat - How to add a Spring based RESTful service as Servlet to Tomcat 将Java Restful Web服务部署到实时服务器 - Deploy Java restful web service to live server 我的基于Spring的Restful Web服务在部署到独立的tomcat而不是Eclipse的Tomcat时给出404 - My Spring based Restful webservice gives 404 when deploy to standalone tomcat instead of Eclipse's Tomcat 资源URI在tomcat 8服务器上的Java RESTful Web服务中不起作用 - Resource URIs not working in Java RESTful web service on tomcat 8 server 如何将JAVA Spring框架部署到Tomcat - How deploy JAVA Spring Framework to Tomcat Spring RESTful服务作为WAR而不是Tomcat中的JAR - Spring RESTful Service as a WAR instead of JAR in Tomcat 如何在Apache tomcat服务器中在自己的系统上部署Java / Spring应用程序? - How to deploy Java/Spring application on my own system in Apache tomcat server.? Java / Tomcat多线程(?)中的RESTful服务问题 - RESTful service in Java / Tomcat multithread (?) problems 使用TOMCAT将大JSON数据转换为Java RESTful服务 - Big JSON data to java RESTful service with TOMCAT
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM