簡體   English   中英

應用程序默認憑據不可用

[英]Application Default Credentials not available

我在容器引擎集群中的Google Compute Engine實例上運行了一些Java應用程序。 我將群集升級到最新版本(1.7.8),並將節點映像從容器優化的操作系統更改為Ubuntu。 現在,當嘗試使用此錯誤消息連接到雲SQL數據庫時,我的豆莢崩潰了:

The Application Default Credentials are not available. They are available if running in Google Compute Engine.
Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials.
See https://developers.google.com/accounts/docs/application-default-credentials for more information.

該服務帳戶與升級之前的帳戶相同,范圍為https://www.googleapis.com/auth/sqlservice.admin

有誰知道為什么我現在會收到此錯誤? 最好的解決方案是創建環境變量嗎?

理想情況下,您應該使用GOOGLE_APPLICATION_CREDENTIALS環境變量。 否則,您將使用虛擬機的“ Compute Engine默認服務帳戶”。

有關最佳做法,請參見本教程: https : //cloud.google.com/kubernetes-engine/docs/tutorials/authenticating-to-cloud-platform

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM