【发布时间】:2021-09-29 23:36:32
【问题描述】:
我有一个 AWS EC2 Linux 实例运行我的 Spring Boot 项目中的一个 jar。我创建了一个 AWS RDS Postgres 实例,并尝试从我的 EC2 实例中运行的服务中调用它。我主要遇到配置问题。下面,我尝试在我的 spring application.properties 文件中进行以下配置:
cloud.aws.rds.capstoneinstance
cloud.aws.rds.capstoneinstance.password = mypassword
cloud.aws.rds.capstoneinstance.username = myusername
cloud.aws.rds.capstoneinstance.readReplicaSupport = true
cloud.aws.rds.capstoneinstance.databaseName = mydbname
这是我的 Gradle 导入:
implementation("org.springframework.cloud:spring-cloud-aws-jdbc:2.1.2.RELEASE")
我的程序甚至不会运行,但我相信那只是因为 spring 正在寻找“spring.datasource.url”等。
这是输出:
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
【问题讨论】:
标签: spring amazon-web-services spring-boot amazon-ec2 amazon-rds