这篇文章主要介绍“怎么在Hadoop+HBase上安装snappy ”,在日常操作中,相信很多人在怎么在Hadoop+HBase上安装snappy 问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”怎么在Hadoop+HBase上安装snappy ”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!1、检查snappy压缩包是否安装命令为:bin/hbase org.apache.hadoop.hbase.util.CompressionTest file:///tmp/test.txt snappy如果显示信息为:12/12/03 10:30:02 WARN metrics.SchemaConfigured: Could not determine table and column family of the HFile path file:/tmp/test.txt. Expecting at least 5 path components.
12/12/03 10:30:02 WARN snappy.LoadSnappy: Snappy native library not loaded
Exception in thread “main” java.lang.RuntimeException: native snappy library not available
at org.apache.hadoop.io.compress.SnappyCodec.getCompressorType(SnappyCodec.java:123)
at org.apache.hadoop.io.compress.CodecPool.getCompressor(CodecPool.java:100)
at org.apache.hadoop.io.compress.CodecPool.getCompressor(CodecPool.java:112)
at org.apache.hadoop.hbase.io.hfile.Compression$Algorithm.getCompressor(Compression.java:264)
at org.apache.hadoop.hbase.io.hfile.HFileBlock$Writer.
at org.apache.hadoop.hbase.io.hfile.HFileWriterV2.finishInit(HFileWriterV2.java:127)
at org.apache.hadoop.hbase.io.hfile.HFileWriterV2.
at org.apache.hadoop.hbase.io.hfile.HFileWriterV2$WriterFactoryV2.createWriter(HFileWriterV2.java:101)
at org.apache.hadoop.hbase.io.hfile.HFile$WriterFactory.create(HFile.java:394)
at org.apache.hadoop.hbase.util.CompressionTest.doSmokeTest(CompressionTest.java:108)12/12/03 10:34:35 INFO util.ChecksumType: Checksum can use java.util.zip.CRC32
12/12/03 10:34:35 INFO util.ChecksumType: org.apache.hadoop.util.PureJavaCrc32C not available.
12/12/03 10:34:35 DEBUG util.FSUtils: Creating file:file:/tmp/test.txtwith permission:rwxrwxrwx
12/12/03 10:34:35 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
12/12/03 10:34:35 WARN metrics.SchemaConfigured: Could not determine table and column family of the HFile path file:/tmp/test.txt. Expecting at least 5 path components.
12/12/03 10:34:35 WARN snappy.LoadSnappy: Snappy native library is available
12/12/03 10:34:35 WARN snappy.LoadSnappy: Snappy native library not loaded
Exception in thread "main" java.lang.RuntimeException: native snappy library not available
at org.apache.hadoop.io.compress.SnappyCodec.getCompressorType(SnappyCodec.java:123)
at org.apache.hadoop.io.compress.CodecPool.getCompressor(CodecPool.java:100)
at org.apache.hadoop.io.compress.CodecPool.getCompressor(CodecPool.java:112)
at org.apache.hadoop.hbase.io.hfile.Compression$Algorithm.getCompressor(Compression.java:264)
at org.apache.hadoop.hbase.io.hfile.HFileBlock$Writer.
at org.apache.hadoop.hbase.io.hfile.HFile开发云主机域名WriterV2.finishInit(HFileWriterV2.java:127)
at org.apache.hadoop.hbase.io.hfile.HFileWriterV2.
at org.apache.hadoop.hbase.io.hfile.HFileWriterV2$WriterFactoryV2.createWriter(HFileWriterV2.java:101)
at org.apache.hadoop.hbase.io.hfile.HFile$WriterFactory.create(HFile.java:394)
at org.apache.hadoop.hbase.util.CompressionTest.doSmokeTest(CompressionTest.java:108)
at org.apache.hadoop.hbase.util.CompressionTest.main(CompressionTest.java:138)
8、可以看到,snappy已经可以找到了,但是还没有加载(not loaded)。想加载的话,还需要拷贝hadoop的本地库到与libsnappy.so同一个路径下,hadoop的本地库路径为: hadoop-1.2.1/lib/native/Linux-ARCH/libhadoop.so; 如果这个路径下没有,可以根据所使用的hadoop版本到https://archive.apache.org/dist/hadoop/core/下载相应的tar.gz包,解压之后就能找到所需要的文件了;9、再次运行测试命令(第1步中的命令),可以得到:12/12/03 10:37:48 INFO util.ChecksumType: org.apache.hadoop.util.PureJavaCrc32 not available.
12/12/03 10:37:48 INFO util.ChecksumType: Checksum can use java.util.zip.CRC32
12/12/03 10:37:48 INFO util.ChecksumType: org.apache.hadoop.util.PureJavaCrc32C not available.
12/12/03 10:37:48 DEBUG util.FSUtils: Creating file:file:/tmp/test.txtwith permission:rwxrwxrwx
12/12/03 10:37:48 INFO util.NativeCodeLoader: Loaded the native-hadoop library
12/12/03 10:37:48 WARN metrics.SchemaConfigured: Could not determine table and column family of the HFile path file:/tmp/test.txt. Expecting at least 5 path components.
12/12/03 10:37:48 WARN snappy.LoadSnappy: Snappy native library is available
12/12/03 10:37:48 INFO snappy.LoadSnappy: Snappy native library loaded
12/12/03 10:37:48 INFO compress.CodecPool: Got brand-new compressor
12/12/03 10:37:48 DEBUG hfile.HFileWriterV2: Initialized with CacheConfig:disabled
12/12/03 10:37:49 WARN metrics.SchemaConfigured: Could not determine table and column family of the HFile path file:/tmp/test.txt. Expecting at least 5 path components.
12/12/03 10:37:49 INFO compress.CodecPool: Got brand-new decompressor
SUCCESS 看到SUCCESS,说明安装成功,snappy压缩包可以使用,搞定。到此,关于“怎么在Hadoop+HBase上安装snappy ”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注开发云网站,小编会继续努力为大家带来更多实用的文章!
这篇文章主要介绍“Sidecar模式是怎么工作的”,在日常操作中,相信很多人在Sidecar模式是怎么工作的问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Sidecar模式是怎么工作的”的疑惑有所帮助!接下来,请跟着小编一起来学…
免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。