无法连接到在Docker上本地运行的GCP Airflow。

huangapple go评论64阅读模式
英文:

unable to connect to GCP running Airflow locally on docker

问题

我正在本地在Docker上运行Airflow,尝试通过Admin> Connections连接到Google Cloud。当我尝试测试连接时,我看到以下错误:“keyfile_dict”,“key_path”和“key_secret_name”字段是互斥的。请仅提供一个值。不确定缺少什么。任何帮助都将不胜感激。

英文:

I am running Airflow locally on docker, trying to connect to google cloud via Admin>Connections. when I try and test connection , i see the below error
"The keyfile_dict, key_path, and key_secret_name fields are all mutually exclusive. Please provide only one value." Unsure on what is missing. Any help is appreciated

无法连接到在Docker上本地运行的GCP Airflow。

答案1

得分: 1

尝试以下操作:

  • 使用“google_cloud_default”连接ID创建连接。
  • 连接类型:Google Cloud。
  • 创建一个具有BigQuery权限的服务账号(如果还没有的话)。
  • 下载JSON服务账号。
  • 复制JSON内容并粘贴到KeyFileJSON字段。

另一种解决方案:

  • 在您的Docker文件(或docker-compose文件)中创建一个名为GOOGLE_APPLICATION_CREDENTIALS的环境变量,指向服务账号的JSON文件(您必须挂载一个卷,指向服务账号JSON文件所在的文件夹)。
  • 使用“google_cloud_default”连接ID和Google Cloud连接类型创建连接。

希望能对您有所帮助。

英文:

Try the following:

  • Create a connection with "google_cloud_default" connection id
  • Connection Type: Google Cloud
  • Create a service account with bigquery permissions (if you don't have yet)
  • Download the JSON service account.
  • Copy the JSON content and paste in KeyFileJSON field.

Another solution:

  • Create an environment variable in your docker file (or docker-compose) called GOOGLE_APPLICATION_CREDENTIALS that point to the service account json (You have to mount a volume pointing to the folder where the service account json is located).
  • Create a connection with "google_cloud_default" connection id and Google Cloud connection type.

Hope it helps.

huangapple
  • 本文由 发表于 2023年6月29日 23:33:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/76582550.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定