【问题标题】:BigtableConnection API failure;Error getting access token from metadata server atBigtableConnection API 失败;从元数据服务器获取访问令牌时出错
【发布时间】: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


【解决方案1】:

您可以按照以下问题的概述在系统级别设置环境变量,以便 eclipse 获取环境变量;

Set environment variables on Mac OS X Lion

【讨论】:

    猜你喜欢
    • 2021-10-05
    • 2021-12-02
    • 1970-01-01
    • 2011-07-28
    • 2014-09-08
    • 1970-01-01
    • 2020-01-09
    • 1970-01-01
    • 2020-12-01
    相关资源
    最近更新 更多