【发布时间】:2015-07-02 20:57:08
【问题描述】:
试图让simple-cli example 在我的本地机器上运行。它编译得很好,但是即使在 hbase-site.xml 上看起来一切都正确,它也会引发以下错误;
2015-07-02 13:46:19,184 ERROR [main] hbase1_1.BigtableConnection: Error loading BigtableOptions from Configuration.
java.io.IOException: Error getting access token from metadata server at: http://metadata/computeMetadata/v1/instance/service-accounts/default/token
at com.google.cloud.bigtable.config.CredentialFactory.getCredentialFromMetadataServiceAccount(CredentialFactory.java:100)
........
Caused by: java.io.IOException: ComputeEngineCredentials cannot find the metadata server. This is likely because code is not running on Google Compute Engine.
at com.google.auth.oauth2.ComputeEngineCredentials.refreshAccessToken(ComputeEngineCredentials.java:63)
这意味着我们无法从本地访问hbase?
【问题讨论】:
-
看起来下面的代码没有从 bach_profile
String serviceAccountJson = System.getenv().get(SERVICE_ACCOUNT_JSON_ENV_VARIABLE);返回 json 文件 loc -
env应该显示您是否正确定义了 GOOGLE_APPLICATION_CREDENTIALS - 请参阅 developers.google.com/identity/protocols/… 了解更多信息。 -
在mac os上,没有bashrc文件,bash_profile中的那些env变量只对终端可用,不能用于eclipse。
标签: bigtable google-cloud-bigtable