运行HBase Java Client时出错

时间:2014-11-06 19:10:58

标签: hadoop hbase

我有一个使用HBase Java API连接到HBase的远程Java客户端。我的Java客户端在Wondows上运行,并尝试连接到我的DEV Hadoop集群。 我从DEV Hadoop集群的hbase / conf添加了hbase-site.xml。我得到了以下的重复:

ERROR zookeeper.ZKConfig: no valid quorum servers found in zoo.cfg
Exception in thread "main" org.apache.hadoop.hbase.ZooKeeperConnectionException: An error is 
preventing HBase from connecting to ZooKeeper**

以下是DEV服务器的zoo.cfg文件:

dataDir=/var/ibm/biginsights/zookeeper/data
clientPort=2181
tickTime=2000
maxClientCnxns=300
autopurge.snapRetainCount=3
autopurge.purgeInterval=1
syncLimit=2
initLimit=5
server.1=qabcdbddn03.local:2888:3888
server.2=qabcdbddn02.local:2888:3888
server.3=qabcdbddn01.local:2888:**

下面是我使用的hbase-site.xml:

<property>
  <name>hbase.rootdir</name>
  <value>hdfs://HNA-BI-QA/hbase</value>
</property>
<property>
  <name>hbase.zookeeper.quorum</name>
  <value>qabcdbddn03.local,qabcdbddn02.local,qabcdbddn01.local</value>
 </property>
 <property>
  <name>hbase.zookeeper.property.clientPort</name>
  <value>2181</value>
 </property>

Java客户端:

public class HbaseConnection
{
 public static void main(String[] args) throws IOException
 {

  HTableDescriptor ht = new HTableDescriptor("User"); 

  ht.addFamily( new HColumnDescriptor("Id"));

  ht.addFamily( new HColumnDescriptor("Name"));

  HBaseAdmin hba = new HBaseAdmin( config );

  hba.createTable( ht );

 }
} 

zoo.cfg:

dataDir=/var/ibm/biginsights/zookeeper/data
clientPort=2181
tickTime=2000
maxClientCnxns=300
autopurge.snapRetainCount=3
autopurge.purgeInterval=1
syncLimit=2
initLimit=5
server.1=qabcdbddn03.local:2888:3888
server.2=qabcdbddn02.local:2888:3888
server.3=qabcdbddn01.local:2888:3888

请告诉我如何解决此问题。

由于

0 个答案:

没有答案