获取NoServerForRegionException:尝试从MySQL导入HBase时无法找到区域

时间:2013-07-30 05:49:20

标签: hbase sqoop

我在使用Sqoop将表从MySQL导入HBase时遇到问题。 我在一个有3个节点的集群中工作(1个主节点,2个从节点)。

当我尝试运行此命令时:

    sqoop import --hbase-create-table --hbase-table (any_tablename)

   --column-family (any_cf) --hbase-row-key (any_rowkey) --connect 
   jdbc:mysql://(mysqlserver_machine_IP)/(any_db) --username root -P --table (any_table) 

-m 1

我收到以下错误:

...13/07/30 12:13:36 INFO zookeeper.ZooKeeper: Session: 0x1402df83cc5000a closed
13/07/30 12:13:36 INFO zookeeper.ClientCnxn: EventThread shut down
13/07/30 12:13:42 INFO mapred.JobClient: Running job: job_201307301159_0001
13/07/30 12:13:43 INFO mapred.JobClient:  map 0% reduce 0%
13/07/30 12:28:12 INFO mapred.JobClient: Task Id : attempt_201307301159_0001_m_000000_0, Status : FAILED
java.lang.RuntimeException: Could not access HBase table mypop
    at org.apache.sqoop.hbase.HBasePutProcessor.setConf(HBasePutProcessor.java:121)
    at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:62)
    at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:117)
    at org.apache.sqoop.mapreduce.DelegatingOutputFormat$DelegatingRecordWriter.<init>(DelegatingOutputFormat.java:107)
    at org.apache.sqoop.mapreduce.DelegatingOutputFormat.getRecordWriter(DelegatingOutputFormat.java:82)
    at org.apache.hadoop.mapred.MapTask$NewDirectOutputCollector.<init>(MapTask.java:628)
    at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:753)
    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:370)
    at org.apache.hadoop.mapred.Child$4.run(Child.java:255)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:415)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121)
    at org.apache.hadoop.mapred.Child.main(Child.java:249)
Caused by: org.apache.hadoop.hbase.client.NoServerForRegionException: Unable to find region for mypop,,99999999999999 after 10 tries.
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegionInMeta(HConnectionManager.java:991)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:896)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegionInMeta(HConnectionManager.java:998)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:900)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:857)
    at org.apache.hadoop.hbase.client.HTable.finishSetup(HTable.java:233)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:173)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:132)
    at org.apache.sqoop.hbase.HBasePutProcessor.setConf(HBasePutProcessor.java:119)
    ... 12 more

1 个答案:

答案 0 :(得分:0)

看起来您的Sqoop无法联系包含此表区域的RegionServer。请确保RegionServers运行正常,并且没有与网络相关的问题。将hbase - * .jar添加到SQOOP_HOME / lib文件夹中。

通过将您的网络浏览器指向 hmaster_machine:60010 ,访问 HBase webui ,看看您的RegionServers是否列在那里。如果它们没有运行,请尝试挖掘RegionServer日志。