Home Database Mysql Tutorial 腾讯TDW:大型Hadoop集群应用

腾讯TDW:大型Hadoop集群应用

Jun 07, 2016 pm 04:38 PM
hadoop Large application Tencent cluster

PS:TDW是腾讯最大的离线数据处理平台。本文主要从需求、挑战、方案和未来计划等方面,介绍了TDW在建设单个大规模集群中采取的JobTracker分散化和NameNode高可用两个优化方案。 TDW(Tencent distributed Data Warehouse,腾讯分布式数据仓库)基于开源软件H

PS:TDW是腾讯最大的离线数据处理平台。本文主要从需求、挑战、方案和未来计划等方面,介绍了TDW在建设单个大规模集群中采取的JobTracker分散化和NameNode高可用两个优化方案。 TDW(Tencent distributed Data Warehouse,腾讯分布式数据仓库)基于开源软件Hadoop和Hive进行构建,打破了传统数据仓库不能线性扩展、可控性差的局限,并且根据腾讯数据量大、计算复杂等特定情况进行了大量优化和改造。 TDW服务覆盖了腾讯绝大部分业务产品,单集群规模达到4400台,CPU总核数达到10万左右,存储容量达到100PB;每日作业数100多万,每日计算量4PB,作业并发数2000左右;实际存储数据量80PB,文件数和块数达到6亿多;存储利用率83%左右,CPU利用率85%左右。经过四年多的持续投入和建设,TDW已经成为腾讯最大的离线数据处理平台。 TDW的功能模块主要包括:Hive、MapReduce、HDFS、TDBank、Lhotse等,如图1所示。TDW Core主要包括存储引擎HDFS、计算引擎MapReduce、查询引擎Hive,分别提供底层的存储、计算、查询服务,并且根据公司业务产品的应用情况进行了很多深度订制。TDBank负责数据采集,旨在统一数据接入入口,提供多样的数据接入方式。Lhotse任务调度系统是整个数据仓库的总管,提供一站式任务调度与管理。 图1 TDW的功能模块 建设单个大规模集群的原因 随着业务的快速增长,TDW的节点数也在增加,对单个大规模Hadoop集群的需求也越来越强烈。TDW需要做单个大规模集群,主要是从数据共享、计算资源共享、减轻运营负担和成本等三个方面考虑。 1. 数据共享。TDW之前在多个IDC部署数十个集群,主要是根据业务分别部署,这样当一个业务需要其他业务的数据,或者需要公共数据时,就需要跨集群或者跨IDC访问数据,这样会占用IDC之间的网络带宽。为了减少跨IDC的数据传输,有时会将公共数据冗余分布到多个IDC的集群,这样又会带来存储空间浪费。 2. 计算资源共享。当一个集群的计算资源由于某些原因变得紧张时,例如需要数据补录时,这个集群的计算资源就捉襟见肘,而同时,另一个集群的计算资源可能空闲,但这两者之间没有做到互通有无。 3. 减轻运营负担和成本。十几个集群同时需要稳定运营,而且当一个集群的问题解决时,也需要解决其他集群已经出现的或者潜在的问题。一个Hadoop版本要在十几个集群逐一变更,监控系统也要在十几个集群上部署。这些都给运营带来了很大负担。此外,分散的多个小集群,资源利用率不高,机器成本较大。 建设单个大规模集群的方案及优化 面临的挑战 TDW从单集群400台规模建设成单集群4000台规模,面临的最大挑战是Hadoop架构的单点问题:计算引擎单点JobTracker负载重,使得调度效率低、集群扩展性不好;存储引擎单点NameNode没有容灾,使得重启耗时长、不支持灰度变更、具有丢失数据的风险。TDW单点瓶颈导致平台的高可用性、高效性、高扩展性三方面都有所欠缺,将无法支撑4000台规模。为了解决单点瓶颈,TDW主要进行了JobTracker分散化和NameNode高可用两方面的实施。 JobTracker分散化 1.单点JobTracker的瓶颈 TDW以前的计算引擎是传统的两层架构,单点JobTracker负责整个集群的资源管理、任务调度和任务管理,TaskTracker负责任务执行。JobTracker的三个功能模块耦合在一起,而且全部由一个Master节点负责执行,当集群并发任务数较少时,这种架构可以正常运行,但当集群并发任务数达到2000、节点数达到4000时,任务调度就会出现瓶颈,节点心跳处理迟缓,集群扩展也会遇到瓶颈。 2.JobTracker分散化方案 TDW借鉴YARN和Facebook版corona设计方案,进行了计算引擎的三层架构优化(如图2所示):将资源管理、任务调度和任务管理三个功能模块解耦;JobTracker只负责任务管理功能,而且一个JobTracker只管理一个Job;将比较轻量的资源管理功能模块剥离出来交给新的称为ClusterManager的Master负责执行;任务调度也剥离出来,交给具有资源信息的ClusterManager负责执行;对性能要求较高的任务调度模块采用更加精细的调度方式。 图2 JobTracker分散化架构 新架构下三个角色分别是:ClusterManager负责整个集群的资源管理和任务调度,JobTracker负责单个Job的管理,TaskTracker负责任务的执行。 (1)两路心跳。之前的架构下,TaskTracker向JobTracker上报心跳,JobTracker串行地处理这些心跳,心跳处理中进行节点管理、任务管理、任务调度等,心跳繁重,影响任务调度和集群扩展性。新架构下,心跳被拆分成两路心跳,分别上报任务和资源信息。 JobTracker获知任务信息通过任务上报心跳的方式。任务上报心跳是通过任务所在的TaskTracker启动一个新的独立线程向对应的JobTracker上报心跳这条途径,在同一个TaskTracker上,不同Job的任务使用不同的线程向不同的JobTracker上报心跳,途径分散,提升了心跳上报效率。 TaskTracker通过上报心跳的方式将资源信息汇报给ClusterManager。ClusterManager从TaskTracker的心跳中获取节点的资源信息:CPU数量、内存空间大小、磁盘空间大小等的总值和剩余值,根据这些信息判断节点是否还能执行更多的任务。同时,ClusterManager通过TaskTracker与其之间维系的心跳来管理节点的生死存亡。 以前繁重的一路心跳被拆分成了两路轻量的心跳,心跳间隔由40s优化成1s,集群的可扩展性得到了提升。 (2)资源概念。之前架构只有slot概念,一般根据核数来设置slot数量,对内存、磁盘空间等没有控制。新架构弱化了slot概念,加强了资源的概念。 每个资源请求包括具体的物理资源需求描述,包括内存、磁盘和CPU等。向ClusterManager进行资源申请的有三种来源类型:Map、Reduce、JobTracker,每种来源需要的具体资源量不同。在CPU资源上,调度器仍然保留slot概念,并且针对三种来源保证各自固定的资源帽。 例如,对于24核的节点,配置13个核给Map用、6个核给Reduce用、1个核给JobTracker用,则认为该节点上有1个JobTracker slot、13个Map slot、6个Reduce slot。某个Map请求的资源需要2个核,则认为需要两个Map slot,当一个节点的Map slot用完之后,即使有剩余的CPU,也不会继续分配Map予其执行了。内存空间、磁盘空间等资源没有slot概念,剩余空间大小满足需求即认为可以分配。在查找满足资源请求的节点时,会比较节点的这些剩余资源是否满足请求,而且还会优先选择负载低于集群平均值的节点。 (3)独立并发式的下推调度。之前架构下,调度器采用的是基于心跳模型的拉取调度:任务调度依赖于心跳,Map、Reduce的调度耦合在一起,而且对请求优先级采取全排序方式,时间复杂度为nlog(n),任务调度效率低下。 新架构采用独立并发式的下推调度。Map、Reduce、JobTracker三种资源请求使用三个线程进行独立调度,对请求优先级采取堆排序的方式,时间复杂度为log(n)。当有资源满足请求时,ClusterManager直接将资源下推到请求者,而不再被动地等待TaskTracker通过心跳的方式获取分配的资源。 例如,一个Job有10个Map,每个Map需要1个核、2GB内存空间、10GB磁盘空间,如果有足够的资源,Map调度线程查找到了满足这10个Map的节点列表,ClusterManager会把节点列表下推到JobTracker;如果Map调度线程第一次只查找到了满足5个Map的节点列表,ClusterManager会把这个列表下推到JobTracker,随后Map调度线程查找到了剩下5个Map的节点列表,ClusterManager再把这个列表下推到JobTracker。 以前基于心跳模型的拉取调度被优化成独立并发式的下推调度之后,平均调度处理时间由80ms优化至1ms,集群的调度效率得到了提升。 3. Job提交过程 新架构下,一次Job提交过程,需要Client和ClusterManager、TaskTracker均进行交互(如图3所示):JobClient先向ClusterManager申请启动JobTracker所需要的资源;申请到之后,JobClient在指定的TaskTracker上启动JobTracker进程,将Job提交给JobTracker;JobTracker再向ClusterManager申请Map和Reduce资源;申请到之后,JobTracker将任务启动命令提交给指定的TaskTracker。 图3 Job提交过程 4. 存在的问题及应对措施 JobTracker分散化方案给计算引擎带来高效性和高扩展性,但没有带来高可用性,单一故障点的问题在此方案中仍然存在,此时的单一故障点问题有别于以前,如下所述。 (1)ClusterManager如果发生故障,不会造成Job状态丢失而且在短时间内即可恢复。它只存储资源情况,不存储状态,ClusterManager在很短的时间内可以重启完成。重启之后,TaskTracker重新向ClusterManager汇报资源,ClusterManager从重启至完全获得集群的资源情况整个阶段可以在10秒内完成。 (2)JobTracker如果发生故障,只会影响单个Job,对其他Job不会造成影响。 [...]
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Big model app Tencent Yuanbao is online! Hunyuan is upgraded to create an all-round AI assistant that can be carried anywhere Big model app Tencent Yuanbao is online! Hunyuan is upgraded to create an all-round AI assistant that can be carried anywhere Jun 09, 2024 pm 10:38 PM

On May 30, Tencent announced a comprehensive upgrade of its Hunyuan model. The App "Tencent Yuanbao" based on the Hunyuan model was officially launched and can be downloaded from Apple and Android app stores. Compared with the Hunyuan applet version in the previous testing stage, Tencent Yuanbao provides core capabilities such as AI search, AI summary, and AI writing for work efficiency scenarios; for daily life scenarios, Yuanbao's gameplay is also richer and provides multiple features. AI application, and new gameplay methods such as creating personal agents are added. "Tencent does not strive to be the first to make large models." Liu Yuhong, vice president of Tencent Cloud and head of Tencent Hunyuan large model, said: "In the past year, we continued to promote the capabilities of Tencent Hunyuan large model. In the rich and massive Polish technology in business scenarios while gaining insights into users’ real needs

How to Undo Delete from Home Screen in iPhone How to Undo Delete from Home Screen in iPhone Apr 17, 2024 pm 07:37 PM

Deleted something important from your home screen and trying to get it back? You can put app icons back on the screen in a variety of ways. We have discussed all the methods you can follow and put the app icon back on the home screen. How to Undo Remove from Home Screen in iPhone As we mentioned before, there are several ways to restore this change on iPhone. Method 1 – Replace App Icon in App Library You can place an app icon on your home screen directly from the App Library. Step 1 – Swipe sideways to find all apps in the app library. Step 2 – Find the app icon you deleted earlier. Step 3 – Simply drag the app icon from the main library to the correct location on the home screen. This is the application diagram

The role and practical application of arrow symbols in PHP The role and practical application of arrow symbols in PHP Mar 22, 2024 am 11:30 AM

The role and practical application of arrow symbols in PHP In PHP, the arrow symbol (->) is usually used to access the properties and methods of objects. Objects are one of the basic concepts of object-oriented programming (OOP) in PHP. In actual development, arrow symbols play an important role in operating objects. This article will introduce the role and practical application of arrow symbols, and provide specific code examples to help readers better understand. 1. The role of the arrow symbol to access the properties of an object. The arrow symbol can be used to access the properties of an object. When we instantiate a pair

From beginner to proficient: Explore various application scenarios of Linux tee command From beginner to proficient: Explore various application scenarios of Linux tee command Mar 20, 2024 am 10:00 AM

The Linuxtee command is a very useful command line tool that can write output to a file or send output to another command without affecting existing output. In this article, we will explore in depth the various application scenarios of the Linuxtee command, from entry to proficiency. 1. Basic usage First, let’s take a look at the basic usage of the tee command. The syntax of tee command is as follows: tee[OPTION]...[FILE]...This command will read data from standard input and save the data to

Up owners have already started to play tricks. Tencent opens up 'AniPortrait' to let photos sing and speak. Up owners have already started to play tricks. Tencent opens up 'AniPortrait' to let photos sing and speak. Apr 07, 2024 am 09:01 AM

AniPortrait models are open source and can be played with freely. "A new productivity tool for Xiaopozhan Ghost Zone." Recently, a new project released by Tencent Open Source received such evaluation on Twitter. This project is AniPortrait, which generates high-quality animated portraits based on audio and a reference image. Without further ado, let’s take a look at the demo that may be warned by a lawyer’s letter: Anime images can also speak easily: The project has already received widespread praise after just a few days since it was launched: the number of GitHub Stars has exceeded 2,800. Let’s take a look at the innovations of AniPortrait. Paper title: AniPortrait:Audio-DrivenSynthesisof

Tencent 2025 campus recruitment starts: Graduation time expanded from one year to two years Tencent 2025 campus recruitment starts: Graduation time expanded from one year to two years Aug 07, 2024 pm 08:17 PM

According to news from this site on August 7, Tencent’s 2025 campus recruitment was officially launched yesterday. Following the recruitment of interns in 2024 and the “Qingyun Plan” AI large model recruitment special project, it once again issued an “enrollment expansion” signal: not only the recruitment scale is larger than the previous two years There has been a huge growth, and the graduation time range for people has also been further expanded. According to reports, Tencent’s campus recruitment in 2025 will open more than 70 positions in five major categories: technology, product, market, design, and function. There will be many changes in Tencent’s campus recruitment this year. The graduation time range for campus recruitment will be expanded from one year to two years. Students who graduate from January 2024 to December 2025 (Graduation Certificate shall prevail in Mainland China, Degree Certificate shall prevail in Hong Kong, Macao, Taiwan and overseas regions) can apply through Tencent’s official recruitment website and “Tencent

Explore the advantages and application scenarios of Go language Explore the advantages and application scenarios of Go language Mar 27, 2024 pm 03:48 PM

The Go language is an open source programming language developed by Google and first released in 2007. It is designed to be a simple, easy-to-learn, efficient, and highly concurrency language, and is favored by more and more developers. This article will explore the advantages of Go language, introduce some application scenarios suitable for Go language, and give specific code examples. Advantages: Strong concurrency: Go language has built-in support for lightweight threads-goroutine, which can easily implement concurrent programming. Goroutin can be started by using the go keyword

The Japanese server of "Ark of Destiny" is officially out of service today. Will the Chinese server represented by Tencent also become popular? The Japanese server of "Ark of Destiny" is officially out of service today. Will the Chinese server represented by Tencent also become popular? Mar 21, 2024 am 10:21 AM

The MMORPG client game "Ark of Destiny", which was launched in Japan in September 2020, officially closed its Japanese servers today after nearly three and a half years of operation. But Korean games and Japanese games have always been almost completely incompatible factions, with huge differences in taste and style (especially online games). This is why it has been difficult for Korean online games to gain a foothold in Japan. The suspension of the Japanese server of "Ark of Destiny" is expected. So the question is, what about the national server of "Ark of Destiny" represented by Tencent? The first thing that bears the brunt is the popularity issue that the majority of players are most concerned about. As of now, there are three types of people playing "Ark of Destiny": tycoons, ordinary players and brick-and-mortar gangsters. Needless to say, nouveau riche, any game is more enjoyable for rich people to play, "Ark of Destiny"

See all articles