我尝试连接公共云 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
我还可以在实例中看到另一个服务帐户,但不确定是否也必须向该帐户添加权限?
您是否按照此处的说明进行操作:https://cloud.google.com/data-fusion/docs/how-to/reading-from-postgresql?
我遇到了同样的问题,因为我正在查找数据融合实例中定义的服务帐户和 Dataproc 服务帐户,但这些不是需要权限的服务帐户。
我必须:
执行这些操作后,一切正常。
请告诉我们这是否适合您。