尝试获得有关hadoop项目及其所有模块的技能,我正在尝试这样做(使用cloudera):
- 创建一个充满12k行的mysql表 - 使用sqoop在hbase中导入它 - 找到一种方法来使用这些数据进行分析(我认为创建一个外部的hive表指向本来是一个好主意)
所以我坚持最后一点。我可以使用以下代码在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”所以我认为这里的一切都很顺利。 但是当我做一个简单的“select * from viewsimulation”时,我收到以下错误信息:
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的配置有什么问题,或者其他什么。