我们正在通过dbaas将我们的微服务连接到aws关键空间(Cassandra)。
Getting error
cloud.dbaas.client.exceptions.CreateDbException: MicroserviceRestClientResponseException{message=404 Not Found: "No physical database known of type cassandra甚至从dbaas吊舱日志中得到相同的错误。我已经配置了以下参数
spring.data.cassandra.ssl
spring.data.cassandra.contact-points
spring.data.cassandra.local-datacenter
spring.data.cassandra.port
spring.data.cassandra.password
spring.data.cassandra.username发布于 2022-06-30 14:12:17
您将希望引用外部配置。请参阅下面的Amazon示例。
https://github.com/aws-samples/amazon-keyspaces-spring-app-example/
@Configuration
public class AppConfig {
private final String username = System.getenv("AWS_MCS_SPRING_APP_USERNAME");
private final String password = System.getenv("AWS_MCS_SPRING_APP_PASSWORD");
File driverConfig = new File(System.getProperty("user.dir")+"/application.conf");
@Primary
public @Bean
CqlSession session() throws NoSuchAlgorithmException {
return CqlSession.builder().
withConfigLoader(DriverConfigLoader.fromFile(driverConfig)).
withAuthCredentials(username, password).
withSslContext(SSLContext.getDefault()).
withKeyspace("keyspace_name").
build();
}
}https://stackoverflow.com/questions/72625800
复制相似问题