版本:Hadoop:2.0.0-cdh4.3.1
HBase:0.94.6-cdh4.3.1
我正在运行 cloudera 快速启动 vm,这是我的小型远程 HBase Java 客户端(HbaseClient.java),它所做的只是:
public static void main(String[] args) throws IOException {
Configuration config = HBaseConfiguration.create();
HTable table = new HTable(config, "s1");
System.out.println(table.getTableName());
}
当我运行我的 java 客户端时,我得到这个错误:
log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
2013-08-25 00:01:56.684 java[39082:1703] Unable to load realm info from SCDynamicStore
Exception in thread "main" org.apache.hadoop.hbase.client.NoServerForRegionException: Unable to find region for s1,,99999999999999 after 10 tries.
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegionInMeta(HConnectionManager.java:980)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:885)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegionInMeta(HConnectionManager.java:987)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:889)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:846)
at org.apache.hadoop.hbase.client.HTable.finishSetup(HTable.java:271)
at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:211)
at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:170)
at com.***************.api.HBaseClient.main(HBaseClient.java:24)
我通过代码调试,很难找到客户端是否在资源文件夹中使用我的 hbase-site.xml。我什至在 hbase-site.xml 中输入了错误的格式内容,Java 客户端也出现了同样的错误。所以我认为它没有使用它。资源文件夹不是 CLASSPATH 的一部分吗?有什么方法可以检查 hbase-site.xml 是否被使用,如果不使用,如何让我的客户使用它。