简体   繁体   English

带有RDS的AWS EB上的Spring Boot应用程序部署

[英]Deployment of a spring boot application on AWS EB with RDS

New to AWS EB and RDS. AWS EB和RDS的新功能。

My spring boot app is currently having one profile of datasource to connect to the local mysql. 我的spring boot应用程序当前具有一个数据源配置文件以连接到本地mysql。 I have initialised the RDS and configured RDS endpoint in my local profile before packaging. 打包之前,我已经在本地配置文件中初始化了RDS并配置了RDS端点。 Maven packaging fails because it runs test with the production datasource in local. Maven打包失败,因为它使用本地的生产数据源运行测试。

I could see below solutions to the issue, but not tried. 我可以在下面看到该问题的解决方案,但没有尝试过。

  1. Should I skip the test phase in maven packaging phase? 我应该在Maven打包阶段跳过测试阶段吗?
  2. Should I build the package with local datasource, and will define db configuration in AWS environment? 我是否应该使用本地数据源构建软件包,并在AWS环境中定义数据库配置? (Do AWS EB environment variables override spring datasource variables?) (AWS EB环境变量会覆盖spring数据源变量吗?)
  3. Should I define two profiles for datasource (ex. dev, prod) and on AWS EB environment set the "prod" profile active? 我是否应该为数据源(例如dev,prod)定义两个配置文件,并在AWS EB环境中将“ prod”配置文件设置为活动状态?

Please advice me with the right approach. 请以正确的方法建议我。

  1. Should I skip the test phase in packaging? 我应该跳过包装中的测试阶段吗?

My preferences goes toward making your test phase environment independent, so it does not make a different to build for Dev, Test or Prod. 我的偏好是使您的测试阶段环境独立,因此为Dev,Test或Prod进行构建不会有什么不同。

  1. Should I build the package with local datasource, and will define db configuration in AWS environment? 我是否应该使用本地数据源构建软件包,并在AWS环境中定义数据库配置? (Do AWS EB environment variables override spring datasource variables?) (AWS EB环境变量会覆盖spring数据源变量吗?)
  2. Should I define two profiles for datasource (ex. dev, prod) and on AWS EB environment set the "prod" profile active? 我是否应该为数据源(例如dev,prod)定义两个配置文件,并在AWS EB环境中将“ prod”配置文件设置为活动状态?

2 + 3 My preference goes to have packages that are not bound to an environment, and use a tool like Puppet to inject the environment specific configuration during deployment. 2 + 3我更喜欢不绑定到环境的软件包,并使用Puppet之类的工具在部署过程中注入特定于环境的配置。

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

相关问题 在AWS Elastic BeanStalk上运行的Spring Boot应用程序中配置AWS RDS - Configuring AWS RDS in a Spring Boot Application running on AWS Elastic BeanStalk 在部署到AWS EB之后,Spring @ControllerAdvise停止工作了一段时间 - Spring @ControllerAdvise stopped working some time after deployment to AWS EB 在使用 RDS 的 AWS (Elastic Beanstalk) 上部署 Spring 引导应用程序 - 应用程序未启动 - Deploy Spring Boot application on AWS (Elastic Beanstalk) that uses RDS - Application does not start 如何使用Tomcat托管的Spring Boot应用程序从Docker Container通过JDBC访问Oracle AWS RDS - How to access Oracle AWS RDS through JDBC from Docker Container with Spring boot application hosted on Tomcat 如何配置 Spring Boot HikariPool 以与 AWS 的 RDS 代理一起使用? - How to configure Spring Boot HikariPool for use with AWS' RDS Proxy? 无法从本地Spring Boot连接AWS RDS - Can't connect AWS RDS from local Spring boot jboss eap 7上的spring boot应用程序部署失败 - spring boot application deployment failed on jboss eap 7 在远程服务器上部署Spring Boot Application - Spring Boot Application deployment on remote server 适用于AWS的视图出现404错误,但使用Spring Boot进行本地部署时不存在 - 404 error for views for AWS but not on local deployment with Spring Boot extShutdownHook Spring 启动 JAR 文件 AWS EC2 部署错误 - extShutdownHook Spring boot JAR file AWS EC2 deployment error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM