简体   繁体   中英

Issue connecting to google cloud sql for postgres from cloud data fusion pipeline

Background: We have working pipelines in a datafusion instance(version 6.4.1 and runs on a dataproc cluster) which connects to the postgres cloudsql. Everything is working in this instance.

Issue: We created a new datafusion instance(version 6.7.1) on a newly created dataproc cluster. We installed the necessary artifacts (CloudSQL PostgreSQL JDBC Driver, CloudSQL PostgreSQL Plugins), and added the database connection in the namespace admin page(CDF GUI) and successfully tested the connection(so, we can connect to the cloudsql instance?). But when deployed a pipeline(with the same credentials as that used in the connection) and run it, we encounter the following error:

Exception while trying to validate schema of database table "<table_name>" for connection jdbc:postgresql:///<db_name>?cloudSqlInstance=<cloud-sql-instance-name>&socketFactory=com.google.cloud.sql.postgres.SocketFactory.

This is the error from the raw logs:

PSQLException : “Connection to :5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.”

Both the older(6.4.1) and the new(6.7.1) DF instances are almost identical(use the same service account, dataproc service account, point to the same cloud sql instance)

Any suggestion is appreciated

It maybe worth checking a few things

  1. Check if a custom port has been configured to access CloudSql Postgres ie maybe it is not 5432 which is the default
  2. Looks like you are using a static dataproc cluster. It maybe worth testing the new 6.7.1 instance with the earlier dataproc cluster. Create a compute profile that points to the earlier static dataproc cluster. If it works, then clearly the problem is with configuration of the new dataproc cluster.

For the setup of the new cluster, please make sure this has been followed https://datafusion.atlassian.net/wiki/spaces/KB/pages/32276578/Configurations+for+a+static+Dataproc+cluster

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM