简体   繁体   English

Spring 引导 Lambda Mongo 配置问题

[英]Spring Boot Lambda Mongo Configuration Issue

I have deployed a Spring boot lambda function and got the following error upon API invocation.我已经部署了 Spring 启动 lambda function 并在 API 调用时出现以下错误。 But it works on the local machine.但它适用于本地机器。 I'm wondering about the missing AWS configuration我想知道缺少的 AWS 配置

Please refer to the error.请参考错误。

2022-12-31T01:42:59.669-06:00   07:42:59.669 INFO 8 --- [ main] org.mongodb.driver.cluster : No server chosen by com.mongodb.client.internal.MongoClientDelegate$1@515fff35 from cluster description ClusterDescription{type=REPLICA_SET, connectionMode=MULTIPLE, serverDescriptions=[ServerDescription{address=cluster0-shard-00-02.gu1ji.mongodb.net:27017, type=UNKNOWN, state=CONNECTING}, ServerDescription{address=cluster0-shard-00-01.gu1ji.mongodb.net:27017, type=UNKNOWN, state=CONNECTING}, ServerDescription{address=cluster0-shard-00-00.gu1ji.mongodb.net:27017, type=UNKNOWN, state=CONNECTING}]}. Waiting for 30000 ms before timing out

2022-12-31T01:43:07.405-06:00   07:43:07.405 INFO 8 --- [.net:27017] org.mongodb.driver.cluster : Exception in monitor thread while connecting to server cluster0-shard-00-02.gu1ji.mongodb.net:27017

2022-12-31T01:43:07.405-06:00   com.mongodb.MongoSocketOpenException: Exception opening socket

2022-12-31T01:43:07.405-06:00   at com.mongodb.internal.connection.SocketStream.open(SocketStream.java:70)

2022-12-31T01:43:07.405-06:00   at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:180)

2022-12-31T01:43:07.405-06:00   at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.lookupServerDescription(DefaultServerMonitor.java:193)

2022-12-31T01:43:07.405-06:00   at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:157)

2022-12-31T01:43:07.405-06:00   at java.base/java.lang.Thread.run(Unknown Source)

2022-12-31T01:43:07.405-06:00   Caused by: java.net.SocketTimeoutException: connect timed out

2022-12-31T01:43:07.405-06:00   at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)

2022-12-31T01:43:07.405-06:00   at java.base/java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)

2022-12-31T01:43:07.405-06:00   at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)

2022-12-31T01:43:07.405-06:00   at java.base/java.net.AbstractPlainSocketImpl.connect(Unknown Source)

2022-12-31T01:43:07.405-06:00   at java.base/java.net.SocksSocketImpl.connect(Unknown Source)

2022-12-31T01:43:07.405-06:00   at java.base/java.net.Socket.connect(Unknown Source)

2022-12-31T01:43:07.405-06:00   at java.base/sun.security.ssl.SSLSocketImpl.connect(Unknown Source)

2022-12-31T01:43:07.405-06:00   at com.mongodb.internal.connection.SocketStreamHelper.initialize(SocketStreamHelper.java:107)

2022-12-31T01:43:07.405-06:00   at com.mongodb.internal.connection.SocketStream.initializeSocket(SocketStream.java:79)

2022-12-31T01:43:07.405-06:00   at com.mongodb.internal.connection.SocketStream.open(SocketStream.java:65)

2022-12-31T01:43:07.405-06:00   ... 4 common frames omitted

2022-12-31T01:43:07.405-06:00

Copy
07:43:07.405  INFO 8 --- [.net:27017] org.mongodb.driver.cluster               : Exception in monitor thread while connecting to server cluster0-shard-00-01.gu1ji.mongodb.net:27017
07:43:07.405 INFO 8 --- [.net:27017] org.mongodb.driver.cluster : Exception in monitor thread while connecting to server cluster0-shard-00-01.gu1ji.mongodb.net:27017

2022-12-31T01:43:07.405-06:00   com.mongodb.MongoSocketOpenException: Exception opening socket

I have deployed my lambda within the VPC without proper configurations.我在没有正确配置的情况下在 VPC 中部署了我的 lambda。 VPC configurations are not mandatory for the cloud function, hence I removed them. VPC 配置对于云 function 不是强制性的,因此我删除了它们。

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

相关问题 Spring Boot 和 Mongo DB 冷启动问题 - Spring Boot and Mongo DB cold start issue Spring Boot 应用程序的 AWS Lambda 超时问题 - AWS Lambda timeout issue with spring boot application 主机 spring 启动 api 使用 aws lambda - Host spring boot api using aws lambda Spring 的 AWS MSK 配置问题 - AWS MSK configuration issue with Spring 获取 swagger 以使用 Azure AD + spring 启动配置进行身份验证 - Get swagger to authenticate with Azure AD + spring boot configuration Spring 引导应用程序 (JHipster) 和 Keycloak 通过 HTTPS 之间的通信问题 - Communication issue between Spring Boot application (JHipster) and Keycloak through HTTPS Java Lambda spring-cloud 版本到 3.2.3/3.1.7 org/springframework/boot/ApplicationContextFactory: java.lang.NoClassDefFoundError - Java Lambda for spring-cloud version to 3.2.3/3.1.7 org/springframework/boot/ApplicationContextFactory: java.lang.NoClassDefFoundError 如何从 Spring 引导获取具有特定 label 的 Azure 应用程序配置功能标志的值? - How to get the value of Azure App Configuration Feature Flag with specific label from Spring boot? 如何在 Tomcat AWS Elastic beanstalk (Spring Boot Application) 中修改或添加新的 Nginx 配置 - How to modify or add new Nginx configuration in Tomcat AWS Elastic beanstalk (Spring Boot Application) Lambda 连接问题 - Lambda issue connecting
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM