博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
HDFS Scribe Integration 【转】
阅读量:6904 次
发布时间:2019-06-27

本文共 3257 字,大约阅读时间需要 10 分钟。

It is finally here: you can configure the open source log-aggregator, scribe, to log data directly into the Hadoop distributed file system.

Many Web 2.0 companies have to deploy a bunch of costly filers to capture weblogs being generated by their application. Currently, there is no option other than a costly filer because the write-rate for this stream is huge. The Hadoop-Scribe integration allows this write-load to be distributed among a bunch of commodity machines, thus reducing the total cost of this infrastructure.

The challenge was to make HDFS be real-timeish in behaviour. Scribe uses libhdfs which is the C-interface to the HDFs client. There were various bugs in libhdfs that needed to be solved first. Then came the FileSystem API. One of the major issues was that the FileSystem API caches FileSystem handles and always returned the same FileSystem handle when called from multiple threads. There was no reference counting of the handle. This caused problems with scribe, because Scribe is highly multi-threaded. A new API FileSystem.newInstance() was introduced to support Scribe.

Making the HDFS write code path more real-time was painful. There are various timeouts/settings in HDFS that were hardcoded and needed to be changed to allow the application to fail fast. At the bottom of this blog-post, I am attaching the settings that we have currently configured to make the HDFS-write very real-timeish. The last of the JIRAS, HADOOP-2757 is in the pipeline to be committed to Hadoop trunk very soon.

What about Namenode being the single point of failure? This is acceptable in a warehouse type of application but cannot be tolerated by a realtime application. Scribe typically aggregates click-logs from a bunch of webservers, and losing *all* click log data of a website for a 10 minutes or so (minimum time for a namenode restart) cannot be tolerated. The solution is to configure two overlapping clusters on the same hardware. Run two separate namenodes N1 and N2 on two different machines. Run one set of datanode software on all slave machines that report to N1 and the other set of datanode software on the same set of slave machines that report to N2. The two datanode instances on a single slave machine share the same data directories. This configuration allows HDFS to be highly available for writes!

The highly-available-for-writes-HDFS configuration is also required for software upgrades on the cluster. We can shutdown one of the overlapping HDFS clusters, upgrade it to new hadoop software, and then put it back online before starting the same process for the second HDFS cluster.

What are the main changes to scribe that were needed? Scribe already had the feature that it buffers data when it is unable to write to the configured storage. The default scribe behaviour is to replay this buffer back to the storage when the storage is back online. Scribe is configured to support no-buffer-replay when the primary storage is back online. Scribe-hdfs is configured to write data to a cluster N1 and if N1 fails then it writes data to cluster N2. Scribe treats N1 and N2 as two equivalent primary stores.

转自:http://hadoopblog.blogspot.hk/2009/06/hdfs-scribe-integration.html

转载于:https://www.cnblogs.com/linyx/p/3897997.html

你可能感兴趣的文章
HTML_后台框架全屏界面_fixed形式布局
查看>>
为什么使用 SLF4J 而不是 Log4J 来做 Java 日志
查看>>
顺丰快递接口
查看>>
淘宝技术发展(个人网站)
查看>>
处理 emoji 表情
查看>>
Dev-No.02 HTTP Status状态汇总
查看>>
linux svn命令
查看>>
Android中获取CPU负载和进程cpu时间
查看>>
docker容器启动后添加端口映射
查看>>
Android新姿势:3D翻转效果原理
查看>>
Xtrabackup系列之:二进制安装
查看>>
Context []startup failed due to previous errors 错误
查看>>
RPM(RedHat Package Manager)
查看>>
iOS开源项目周报0302
查看>>
linux入门介绍
查看>>
JCaptcha报异常
查看>>
oracle dataguard 之nologing
查看>>
asp.net如何正确判断上传文件格式
查看>>
使用cocoaPods遇到Updating local specs repositories时的解决
查看>>
介绍几个常见的Git代码托管平台
查看>>