无法将公有云 PostgreSQL 实例连接到公有云 Data Fusion 实例

问题描述 投票:0回答:2

我尝试连接公共云 SQL 和 Data Fusion 实例,但最终收到 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

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

google-cloud-platform google-cloud-sql google-cloud-data-fusion
2个回答
2
投票

您是否按照此处的说明进行操作:https://cloud.google.com/data-fusion/docs/how-to/reading-from-postgresql

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

我必须:

  1. 进入IAM
  2. 选择授予访问权限操作。
  3. 找到 [电子邮件受保护] 服务帐户并在我发送的链接中的步骤 #13 中授予角色。

执行这些操作后,一切正常。

请告诉我们这是否适合您。


0
投票
  1. 进入IAM
  2. 勾选右上角的“包括Google提供的角色授予”,否则你将看不到service-xxxxxxxx帐户
© www.soinside.com 2019 - 2024. All rights reserved.