sql審計-tez

抄自:https://www.qubole.com/blog/scaling-tez-application-using-application-timeline-server-v1-5/

通過這篇文章可以明白 ats 1.0的弊端, 在hadoop 2.*的環(huán)境下建議使用ats 1.5.

Introduction

In an earlier blog post, we presented a secure, multi-tenant, reliable, and scalable service that provides access to logs and history for MRv2 applications. In this article, we will cover the challenges faced in scaling the aforementioned service for Tez applications and some approaches to overcoming those challenges.

Application Timeline Server

Application Timeline Server (ATS) was introduced in Apache Hadoop as a single generic service in YARN to store, manage, and serve per-framework application timeline data for both running and finished applications. ATS provides a REST client library that the Application Master (AM) can use to publish Application Timeline data.

The Tez framework is integrated with ATS and provides a UI which displays views of the Tez Application(s). Using ATS as the backend, the Tez UI displays diagnostics information about the applications, directed acyclic graphs (DAG), vertices, and tasks. This information includes container logs, counters, configuration, start/stop time and other data.

Ephemeral Clusters And ATS

Qubole Data Service (QDS) allows users to configure their clusters to autoscale based on the workload, and shut down automatically when there is a period of inactivity. This results in substantial cost savings. ATS and the Tez UI server running on cluster master are responsible for storing and serving timeline data for applications running on that cluster. For debugging an application that had been running on a scaled-down cluster, users need to access its log, configuration, counters, etc. through the Tez UI. As ATS stores this data in the local file system, cluster termination results in data loss and makes it challenging to access Timeline Data once the cluster is terminated.

To remedy this, Qubole has provisioned a multi-tenant version of ATS and the Tez-UI server in the QDS Control Plane (henceforth called as Offline ATS and Offline Tez UI respectively). The online Tez UI is used only when the cluster is running. Otherwise, the Offline Tez UI serves the request. Both these services let users access application logs and other data through a standard workflow, irrespective of the current state of the cluster.

Architecture With ATS V1

The first iteration of ATS, v1, uses LevelDB on top of the local file system to store Timeline Data. The architecture for Offline Tez UI with ATS v1 is similar to the Job History Server (JHS) described in the previous blog.

The diagram above illustrates the process. When a Tez application is running, the Application Master sends Timeline Data to ATS (U1). This Timeline Data is stored in the LevelDB Timeline Store that is shared across all applications running in the cluster. Once the application is finished, the AM sends a FINISH event to the Resource Manager (RM) (U2), and the RM fetches data from ATS for this application through the ATS REST APIs (U3). Once the data is fetched, RM creates a local LevelDB Timeline Store on this data, and the generated LevelDB files are then backed up to a Persistent Cloud Storage (U4).

Application Timeline data in the form of the LevelDB store can now be accessed even if the cluster is down. When Offline Tez UI is requested to view an Application (D1), Offline ATS consumes LevelDB files stored in the cloud (D3).

Shortcomings Of ATS V1

Being a single point of contact for all Timeline Data related requests, ATS often suffers from performance, reliability and scalability issues:

  • Bottleneck as cluster scales: ATS uses the LeveldbTimelineStore by default. LeveldbTimelineStore does not scale well, as significant time is spent deleting old data. This becomes a bottleneck when a large number of concurrent applications are running on the cluster. The improved RollingLeveldbTimelineStore solves scalability issues to some extent, but that application also slows down when Timeline Data is on the order of 10GBs. This results in decreased throughput and increased latency for ATS’s web services.
  • Delay in Tez AM termination: As the AM sends pending timeline data to ATS during shutdown, the time required for the AM to close becomes proportional to the pending events queue size thereby introducing additional delay. This delay can be on the order of hours for large queries, as it is proportional to the number of DAGs served by an AM which in turn is proportional to the number of tasks in a DAG.
  • P****otential loss of data: The AM and ATS are tightly coupled, as the AM writes events directly to ATS. If the ATS server is down, the events sent thereafter are lost and cannot be recovered. This leads to missing or inconsistent information in Tez UI.
  • Single point of failure: As only one instance of ATS runs on the master node, if ATS goes down, Tez UI becomes unavailable.

Apache Hadoop introduced ATS v1.5 to overcome the aforementioned shortcomings.

ATS V1.5 Architecture

As mentioned, the LevelDB-based storage solution was unable to scale ATS, which caused delay and degraded performance. To overcome this, ATS v1.5 introduced a distributed architecture wherein the AM stores timeline data on a highly distributed and reliable Hadoop File System (HDFS). In ATSv1.5, the AM and ATS are decoupled. The AM writes data directly into HDFS, and ATS lazily reads data from HDFS on-demand. This ensures the AM is no longer a bottleneck when writing Timeline Events and allows better scaling.

Timeline Data is stored in two parts:

  • Summary Data contains metadata about the Tez Application and DAGs. For every application, summary data is loaded from HDFS into the Summary LevelDB Timeline Store of ATS. This allows All DAGs and the Application pages to load faster by using summary data without contacting HDFS.
  • Entity Data contains events about vertices and tasks of the DAGs. All these events are published in HDFS and read by ATS only when requested by Tez UI. This lazy loading keeps the data handled by ATS to a minimum so that it does not face scalability issues.

Offline Tez UI With ATS V1.5

The AM publishes timeline events by appending data to files stored in HDFS. Therefore, using a File System that supports the append operation is recommended for better performance. Due to this limitation, however, the AM cannot be configured to store data in a cloud-based Persistent FileSystem like Amazon S3.

The architecture for Offline Tez UI with ATS v1.5 (shown above) is similar to ATS v1 (shown earlier) with the following differences:

  • Timeline Data is published into HDFS by AM (U1).
  • The AM uploads Timeline Data from HDFS to Persistent Cloud Storage when a DAG is finished (U2).

This change in storage architecture helped in making Offline Tez UI more efficient and reliable by limiting the amount of data fetched from ATS. For example, when the Application page is opened, only Summary Data(D3)is downloaded, whereas when a DAG specific page is opened, Tez UI fetches only the DAG’s Timeline Data from ATS (D4).

Advantages Of ATS V1.5

Using ATS v1.5 provides the following advantages:

  • Scalability: Unlike ATSv1, the AM writes data to HDFS which removes the dependency on ATS and helps it scale, even for large queries.
  • Fault-tolerant: In the event of a failure within ATS, the AM is not affected and will continue to write data to HDFS.
  • Reduced AM termination time: In ATS v1.5, due to its improved performance, the backlog to be processed during AM termination tends to be negligible. This improves the AM termination time.

Offline TezUI: ATSv1 Vs ATSv1.5

By consuming ATS v1.5 as the backend service for Tez UI, several improvements were achieved over ATS v1.

image

ATS v1.5 is available for our customers using Hadoop cluster with Hive 2.1 and 2.3. No action required on the customer’s side as this is enabled by default. ATSv1.5 will be supported in Hive 3.1 in a future release.

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末侣监,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子葬毫,更是在濱河造成了極大的恐慌拱镐,老刑警劉巖,帶你破解...
    沈念sama閱讀 218,858評論 6 508
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件胖替,死亡現(xiàn)場離奇詭異霍殴,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)缴挖,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,372評論 3 395
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來焚辅,“玉大人映屋,你說我怎么就攤上這事⊥撸” “怎么了棚点?”我有些...
    開封第一講書人閱讀 165,282評論 0 356
  • 文/不壞的土叔 我叫張陵,是天一觀的道長湾蔓。 經(jīng)常有香客問我瘫析,道長,這世上最難降的妖魔是什么默责? 我笑而不...
    開封第一講書人閱讀 58,842評論 1 295
  • 正文 為了忘掉前任贬循,我火速辦了婚禮,結(jié)果婚禮上桃序,老公的妹妹穿的比我還像新娘杖虾。我一直安慰自己,他們只是感情好媒熊,可當(dāng)我...
    茶點故事閱讀 67,857評論 6 392
  • 文/花漫 我一把揭開白布奇适。 她就那樣靜靜地躺著,像睡著了一般芦鳍。 火紅的嫁衣襯著肌膚如雪嚷往。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,679評論 1 305
  • 那天柠衅,我揣著相機(jī)與錄音皮仁,去河邊找鬼。 笑死菲宴,一個胖子當(dāng)著我的面吹牛魂贬,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播裙顽,決...
    沈念sama閱讀 40,406評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼付燥,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了愈犹?” 一聲冷哼從身側(cè)響起键科,我...
    開封第一講書人閱讀 39,311評論 0 276
  • 序言:老撾萬榮一對情侶失蹤闻丑,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后勋颖,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體嗦嗡,經(jīng)...
    沈念sama閱讀 45,767評論 1 315
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,945評論 3 336
  • 正文 我和宋清朗相戀三年饭玲,在試婚紗的時候發(fā)現(xiàn)自己被綠了侥祭。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 40,090評論 1 350
  • 序言:一個原本活蹦亂跳的男人離奇死亡茄厘,死狀恐怖矮冬,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情次哈,我是刑警寧澤胎署,帶...
    沈念sama閱讀 35,785評論 5 346
  • 正文 年R本政府宣布,位于F島的核電站窑滞,受9級特大地震影響琼牧,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜哀卫,卻給世界環(huán)境...
    茶點故事閱讀 41,420評論 3 331
  • 文/蒙蒙 一巨坊、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧此改,春花似錦趾撵、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,988評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽捶朵。三九已至苔货,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間敢靡,已是汗流浹背挂滓。 一陣腳步聲響...
    開封第一講書人閱讀 33,101評論 1 271
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機(jī)就差點兒被人妖公主榨干…… 1. 我叫王不留啸胧,地道東北人赶站。 一個月前我還...
    沈念sama閱讀 48,298評論 3 372
  • 正文 我出身青樓,卻偏偏與公主長得像纺念,于是被迫代替她去往敵國和親贝椿。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 45,033評論 2 355