5

我在使用 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
4

1 回答 1

0

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

通过将 Web 浏览器指向hmaster_machine:60010来访问HBase webui ,并查看您的 RegionServers 是否在此处列出。如果 RegionServer 日志没有运行,请尝试挖掘它们。

于 2013-07-30T07:49:25.473 回答