【问题标题】:Trying to load data into hbase using pig script facing issue尝试使用猪脚本将数据加载到 hbase 中
【发布时间】:2014-12-26 05:22:29
【问题描述】:

我写了一个猪脚本如下:

REGISTER /home/hduser/hbase/lib/zookeeper-*.jar
REGISTER /home/hduser/hbase/lib/hbase-*.jar
REGISTER /home/hduser/hbase/lib/hadoop*.jar
REGISTER /home/hduser/pig/lib/hbase-0.94.1.jar
REGISTER /home/hduser/pig/lib/zookeeper-3.4.5.jar
REGISTER /home/hduser/pig/lib/piggybank.jar


STOCK_2008 = LOAD 'hdfs:/user/file.txt' using PigStorage(',') AS (no:int, name:chararray, digit:int);
DUMP STOCK_2008 ;
STORE STOCK_2008 INTO 'hbase:/hi' USING org.apache.pig.backend.hadoop.hbase.HBaseStorage('hi_data:name, hi_data:digit');

我有 pig 版本 0.13.0hbase 版本 0.98.8hadoop 2.5.1。

我遇到了问题:

2014-12-25 15:54:54,028 [main] INFO  org.apache.pig.newplan.logical.optimizer.LogicalPlanOptimizer - {RULES_ENABLED=[AddForEach, ColumnMapKeyPrune, GroupByConstParallelSetter, LimitOptimizer, LoadTypeCastInserter, MergeFilter, MergeForEach, PartitionFilterOptimizer, PushDownForEachFlatten, PushUpFilter, SplitFilter, StreamTypeCastInserter], RULES_DISABLED=[FilterLogicExpressionSimplifier]}
2014-12-25 15:54:56,637 [main] INFO  org.apache.pig.data.SchemaTupleBackend - Key [pig.schematuple] was not set... will not generate code.
2014-12-25 15:54:56,744 [main] INFO  org.apache.hadoop.conf.Configuration.deprecation - fs.default.name is deprecated. Instead, use fs.defaultFS
2014-12-25 15:54:56,753 [main] INFO  org.apache.hadoop.mapreduce.lib.input.FileInputFormat - Total input paths to process : 1
2014-12-25 15:54:56,757 [main] INFO  org.apache.pig.backend.hadoop.executionengine.util.MapRedUtil - Total input paths to process : 1
2014-12-25 15:54:57,585 [main] INFO  org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter - Saved output of task 'attempt__0001_m_000001_1' to hdfs://masternode/tmp/temp-1402587382/tmp-1688408384/_temporary/0/task__0001_m_000001
2014-12-25 15:54:57,720 [main] INFO  org.apache.hadoop.conf.Configuration.deprecation - fs.default.name is deprecated. Instead, use fs.defaultFS
2014-12-25 15:54:57,725 [main] WARN  org.apache.pig.data.SchemaTupleBackend - SchemaTupleBackend has already been initialized
2014-12-25 15:54:57,731 [main] INFO  org.apache.hadoop.mapreduce.lib.input.FileInputFormat - Total input paths to process : 1
2014-12-25 15:54:57,731 [main] INFO  org.apache.pig.backend.hadoop.executionengine.util.MapRedUtil - Total input paths to process : 1
(1,one,1)
(2,two,2)
(3,three,3)
2014-12-25 15:54:57,802 [main] INFO  org.apache.hadoop.conf.Configuration.deprecation - fs.default.name is deprecated. Instead, use fs.defaultFS

2014-12-25 15:54:57,902 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 2998: Unhandled internal error. org.apache.hadoop.hbase.util.Bytes.equals([BLjava/nio/ByteBuffer;)Z

Details at logfile: /home/hduser/pig_1419503089087.log

【问题讨论】:

    标签: hadoop hbase apache-pig


    【解决方案1】:

    删除所有注册语句并使用 'hbase://hi' 而不是 'hbase:/hi'

    因为您使用的是 hbase 0.98.8 并且您正在导入 hbase-0.94.1.jar

    【讨论】:

    • 我仍然面临同样的问题。是因为一些类路径变量问题吗?
    • 只注册你正​​在使用的特定版本的hbase和zookeeper jar。
    • 我现在使用的是 pig 14,现在我没有遇到这个问题,而是遇到了另一个问题 2014-12-31 11:59:18,838 [main] INFO org.apache.hadoop.hbase.zookeeper。 RecoverableZooKeeper - 进程标识符 = hconnection-0x53c4ecfd 连接到 ZooKeeper 集合 = localhost:2181 2014-12-31 11:59:18,842 [main-SendThread(localhost:2181)] INFO org.apache.zookeeper.ClientCnxn - 打开到服务器的套接字连接本地主机/127.0.0.1:2181。不会尝试使用 SASL 进行身份验证(未知错误)
    • 能否请您发给我 hbase-site.xml 或检查 hbase 中 hbase.zookeeper.quorum 属性中的值。 Zookeeper 在哪里运行。您必须在 hbase.zookeeper.quorum 属性中提及 zookeeper 服务器主机。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-28
    • 1970-01-01
    • 2012-12-31
    • 1970-01-01
    相关资源
    最近更新 更多