无法连接公有云PostgreSQL实例到公有云数据融合实例



我正在尝试连接公共云SQL和数据融合实例,但最终收到403错误。

Failed to create connection to database via connection string: jdbc:postgresql:///analytics?cloudSqlInstance=chatbot-dev-356403:europe-central2:chatbot&socketFactory=com.google.cloud.sql.postgres.SocketFactory and arguments: {user=chatbot-dev}. Error: GoogleJsonResponseException: 403 Forbidden { "code" : 403, "errors" : [ { "domain" : "global", "message" : "The client is not authorized to make this request.", "reason" : "notAuthorized" } ], "message" : "The client is not authorized to make this request." }. Make sure you specify the correct connection properties.

我不确定这是否是一个权限问题。我在创建数据融合实例时添加的服务帐户中具有以下权限:

roles/storage.admin
roles/datafusion.admin
roles/datafusion.runner
roles/datafusion.serviceAgent
roles/dataproc.worker
roles/cloudsql.admin
roles/cloudsql.client

我也可以在实例中看到另一个服务帐户,但不确定我是否必须为这个帐户添加权限?

您是否遵循了此处的说明:https://cloud.google.com/data-fusion/docs/how-to/reading-from-postgresql ?

我遇到了同样的问题,因为我正在寻找在Data Fusion实例中定义的服务帐户和Dataproc服务帐户,但这些不是需要权限的服务帐户。

I had to:

  1. 进入IAM
  2. 选择Grant Access操作。
  3. 找到service-PROJECT_NUMBER@gcp-sa-datafusion.iam.gserviceaccount.com服务帐户并在我发送的链接中按步骤#13授予角色。

完成这些动作后,一切都很好。

请告知你方是否可行。

最新更新