BigtableConnection API失败;从元数据服务器获取访问令牌时出错

时间:2015-07-02 20:57:09

标签: bigtable google-cloud-bigtable

尝试在本地计算机上运行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?

1 个答案:

答案 0 :(得分:0)

您可以在系统级别设置环境变量,如下面的问题所述,以便eclipse获取env变量;

Set environment variables on Mac OS X Lion