Hadoop在Linux上的数据压缩方法如下:
libsnappy-dev
)。core-site.xml
中添加压缩编解码器,如io.compression.codecs=org.apache.hadoop.io.compress.SnappyCodec
。mapred-site.xml
中设置Map/Reduce输出压缩参数,如mapreduce.map.output.compress=true
。hadoop fs -put localfile.gz /hdfs/path/
。hadoop fs -get /hdfs/path/file.gz /local/path/
,再通过系统命令解压(如gunzip
)。mapreduce.map.output.compress=true
及对应编解码器。mapreduce.output.fileoutputformat.compress=true
及压缩格式。STORED AS ORC TBLPROPERTIES ("orc.compress"="SNAPPY")
。注意:需确保集群所有节点安装对应压缩工具,且部分格式(如LZO)需建索引以支持split。