未找到压缩编解码器com.hadoop.compression.lzo.LzoCodec

问题描述 投票:0回答:1

尝试通过压缩运行mapreduce作业

hadoop jar \
  /usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar \
  randomtextwriter \
  -Ddfs.replication=1 -Dmapreduce.output.fileoutputformat.compress=true -Dmapreduce.output.fileoutputformat.compress.codec=com.hadoop.compression.lzo.LzoCodec \
  /tmp/randomtextwriter 

使用将lzo分发到群集中所有节点的宗地。即使这样,我还是出现以下错误

Getting below error 
Error: java.lang.IllegalArgumentException: Compression codec com.hadoop.compression.lzo.LzoCodec was not found.
        at org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.getOutputCompressorClass(FileOutputFormat.java:140)
        at org.apache.hadoop.mapreduce.lib.output.SequenceFileOutputFormat.getSequenceWriter(SequenceFileOutputFormat.java:56)
        at org.apache.hadoop.mapreduce.lib.output.SequenceFileOutputFormat.getRecordWriter(SequenceFileOutputFormat.java:75)
        at org.apache.hadoop.mapred.MapTask$NewDirectOutputCollector.<init>(MapTask.java:659)
        at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:779)
        at org.apache.hadoop.mapred.MapTask.run(MapTask.java:347)
        at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:174)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:422)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1731)
        at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:168)
Caused by: java.lang.ClassNotFoundException: Class com.hadoop.compression.lzo.LzoCodec not found
        at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2409)
        at org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.getOutputCompressorClass(FileOutputFormat.java:138)
        ... 10 more
hadoop mapreduce hadoop-lzo
1个回答
0
投票

作为临时解决方案,您可以在hadoop类路径中手动添加hadoop-lzo jar。

© www.soinside.com 2019 - 2024. All rights reserved.