0

试图获得有关 hadoop 项目及其所有模块的技能,我正在尝试这样做(使用 cloudera):

-创建一个填充有 12k 行之类的 ​​mysql 表 -使用 sqoop 将其导入 hbase -找到一种使用这些数据进行分析的方法(我认为创建一个外部配置单元表指向会是一个好主意)

所以我坚持最后一点。我可以使用以下代码在 hive 中创建 hbase 的外部表:

CREATE EXTERNAL TABLE ViewSimulation (
  id int,
  eol int,
  sensor int,
  value1 float,
  value2 float,
  value3 float,
  value4 float,
  value5 float,
  value6 float)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES (
  "hbase.columns.mapping" =
  ":key,data:eol,data:sensor,data:value1,data:value2,data:value3,data:value4,data:value5,data:value6"
)
TBLPROPERTIES("hbase.table.name" = "Simulation");

我在控制台中这样做是因为我的色调有问题。没有明显的原因,它无法连接到zookeeper,我有这个错误一次又一次地循环(加上它后面的所有常见错误)。

13/12/09 06:52:25 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
13/12/09 06:52:25 INFO util.RetryCounter: Sleeping 2000ms before retry #1...
13/12/09 06:52:27 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
13/12/09 06:52:27 INFO util.RetryCounter: Sleeping 4000ms before retry #2...
13/12/09 06:52:32 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
13/12/09 06:52:32 INFO util.RetryCounter: Sleeping 8000ms before retry #3...
13/12/09 06:52:40 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
13/12/09 06:52:40 ERROR zookeeper.RecoverableZooKeeper: ZooKeeper exists failed after 3 retries
13/12/09 06:52:40 WARN zookeeper.ZKUtil: hconnection Unable to set watcher on znode (/hbase/hbaseid)
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
    .............

响应只是“好的”,所以我认为这里一切正常。但是当我做一个简单的“从视图模拟中选择 *”时,我收到以下错误消息:

OK
Failed with exception java.io.IOException:java.lang.NullPointerException
Time taken: 0.735 seconds

或者,取决于我查询的机器,当我终止进程时会出现大冻结和此错误消息:

OK
Interrupting... Be patient, this might take some time.
Press Ctrl+C again to kill JVM
Failed with exception java.io.IOException:java.io.IOException: Giving up trying to location region in meta: thread is interrupted.

重新配置 zoo.cfg(cloudera 因未知原因错过了所有“server.id = host:port:port”行......)使我能够在控制台上创建外部表(对于某些机器,不是全部......)但不是色调,我仍然无法查询它。我不知道我的 cloudera 的配置有什么问题或其他任何问题。

4

1 回答 1

0

Hue 作为创建存储在 HBase 中的 Hive 表的教程。您是否检查了列出的依赖项?

于 2013-12-10T21:54:36.993 回答