1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
2
Thank you all for taking your time to reply, I solved the issue by following Dacort's comment and setting up my Serverless application inside a VPC whose security groups have access to the database. This is my code snippet
sample_data = spark.read.format("jdbc").options(
url='jdbc:postgresql://<sample-name>.<region-name>.rds.amazonaws.com/dev',
dbtable='public."<sample-name>"',
user='<sample-user>',
password='<sample-pass>',
driver='org.postgresql.Driver').load()
I was getting this error :
Caused by: java.net.SocketTimeoutException: connect timed out : org.postgresql.util.PSQLException: The connection attempt failed.
répondu il y a un an
Contenus pertinents
- demandé il y a un an
- demandé il y a 2 mois
- demandé il y a 7 mois
- AWS OFFICIELA mis à jour il y a un an
- AWS OFFICIELA mis à jour il y a un an
- AWS OFFICIELA mis à jour il y a 2 ans
More details are needed including what the error message is when the job fails. That said, if you are connecting to postgres, make sure your Serverless application is created in a VPC and that the security groups have access to the database. Reachability analyzer can be used to debug network connectivity issues.
Hi Muthu,
Can you please share what error you are getting and snippet of your code if possible to see how you are trying to connect?