【HDFS联邦(2)】HDFS Router-based Federation官网解读:HDFSRouterFederation的架构、各组件基本原理

news2025/4/22 15:46:26

文章目录

    • 一. 介绍
    • 二、HDFS Router-based Federation 架构
      • 1. 示例说明
      • 2. Router
        • 2.1. Federated interface
        • 2.2. Router heartbeat
        • 2.3. NameNode heartbeat
        • 2.4. Availability and fault tolerance
        • Interfaces
      • 3. Quota management
      • 4. State Store
    • 三、部署 ing

本文主要参考官网:HDFSRouterFederation 对HDFSRouterFederation进行了解:

  1. viewfs会带来的问题,HDFSRouterFederation是如何解决的
  2. HDFSRouterFederation的架构、各组件基本原理说明

一. 介绍

NameNodes have scalability limits because of the metadata overhead comprised of inodes (files and directories) and file blocks, the number of Datanode heartbeats, and the number of HDFS RPC client requests. The common solution is to split the filesystem into smaller subclusters HDFS Federation and provide a federated view ViewFs. The problem is how to maintain the split of the subclusters (e.g., namespace partition), which forces users to connect to multiple subclusters and manage the allocation of folders/files to them.

因为元数据(文件和目录、文件块)的开销、datanode心跳管理以及HDFS RPC请求,namenode有对于datanode的拓展有限制。我们将文件系统分为几个子HDFS联邦系统,然后提供一个联邦的 ViewFs 。但会出现维护子集群的分裂(例如,namespace分区)的问题,这强制用户连接到多个子集群并管理文件夹/文件的分配。

 

二、HDFS Router-based Federation 架构

我们可以对联邦分区扩展可以添加一个管理namespace联邦的软件层。

架构特性

  • 这个额外层允许用户透明的访问任何子系统,让子集群独立地管理自己的块池,并且将支持子集群之间的数据rebalancing。
  • Router-based Federation下的子集群不需要是独立的HDFS集群,也可以是普通的federation集群(包含多个块池),或者是federation和独立集群的混合集群。
  • 为了实现这些目标,联邦层需要将块访问引导到适当的子集群,维护名称空间的状态,并提供数据再平衡机制。所以这一层必须具有可伸缩性、高可用性和容错性。

 

架构组成

This federation layer comprises multiple components. The Router component that has the same interface as a NameNode, and forwards the client requests to the correct subcluster, based on ground-truth information from a State Store. The State Store combines a remote Mount Table (in the flavor of ViewFs, but shared between clients) and utilization (load/capacity) information about the subclusters. This approach has the same architecture as YARN federation.

该联邦层由多个组件组成。

  • Router组件具有与NameNode相同的接口,并根据来自State Store的真实信息将客户端请求转发到正确的子集群。
  • State Store包含了一个远程挂载表(类似于视图,但在客户端之间共享)和关于子集群的利用率(负载/容量)信息。这种方法具有与YARN联合相同的体系结构。

在这里插入图片描述

 

1. 示例说明

The simplest configuration deploys a Router on each NameNode machine. The Router monitors the local NameNode and its state and heartbeats to the State Store. The Router monitors the local NameNode and heartbeats the state to the State Store. When a regular DFS client contacts any of the Routers to access a file in the federated filesystem, the Router checks the Mount Table in the State Store (i.e., the local cache) to find out which subcluster contains the file. Then it checks the Membership table in the State Store (i.e., the local cache) for the NameNode responsible for the subcluster. After it has identified the correct NameNode, the Router proxies the request. The client accesses Datanodes directly. ing

client通过Router方式请求文件过程

  • nn状态定期维护:Router监控本地namenode的状态、并定期(心跳)给State Store
  • 找到子集群:当一个普通的DFS客户机通过任意的Router访问 federated filesystem 中的文件时,Router检查State Store (即本地缓存)中的Mount Table,来找出哪个子集群包含该文件。
  • 找到负责的nn:然后,它检查State Store 中的Membership表,查找负责子集群的NameNode。在它识别了正确的NameNode之后,Router代理请求。客户端直接访问datanode。(参考client向namenode读写文件过程)

 

2. Router

There can be multiple Routers in the system with soft state. Each Router has two roles:

  • Federated interface: expose a single, global NameNode interface to the clients and forward the requests to the active NameNode in the correct subcluster
  • NameNode heartbeat: maintain the information about a NameNode in the State Store

系统中可以有多个(soft state的)Router,每个Router都有两个作用;

  • 联邦接口:暴露单个、全局的namenode接口给客户端,将请求转发到正确子集群的active NameNode
  • NameNode heartbeat:维护namenode的状态信息在 State Store。

 

2.1. Federated interface

The Router receives a client request, checks the State Store for the correct subcluster, and forwards the request to the active NameNode of that subcluster. The reply from the NameNode then flows in the opposite direction. The Routers are stateless and can be behind a load balancer. For health checking, you can use /isActive endpoint as a health probe (e.g. http://ROUTER_HOSTNAME:ROUTER_PORT/isActive). For performance, the Router also caches remote mount table entries and the state of the subclusters. To make sure that changes have been propagated to all Routers, each Router heartbeats its state to the State Store.

The communications between the Routers and the State Store are cached (with timed expiration for freshness). This improves the performance of the system.

Router接收到client的请求,确认正确子集群的State Store,然后将请求发送给指定子集群的namenode,然后接收namenode的response。路由器是无状态的,可以在负载均衡器后面。

  • 对于健康检查,你可以使用/isActive 作为一个健康探针。
  • 对于性能方面,Router缓存远程挂载表入口和子集群的状态。为了保证改变能同步到所有的Routers,每个Routers给State Store层汇报其心跳。

Routers和State Store之间的通信被缓存(有一个刷新时间)。这样可以提高系统的性能。

 

2.2. Router heartbeat

Router周期性的汇报心跳给State Store。

 

2.3. NameNode heartbeat

For this role, the Router periodically checks the state of a NameNode (usually on the same server) and reports their high availability (HA) state and load/space status to the State Store. Note that this is an optional role, as a Router can be independent of any subcluster. For performance with NameNode HA, the Router uses the high availability state information in the State Store to forward the request to the NameNode that is most likely to be active. Note that this service can be embedded into the NameNode itself to simplify the operation.

Router周期性的检查namenode的状态,并将高可用状态、空间、负载等汇报给State Store。

注意:此功能不是必须的,Router可以独立于任何的子集群。

考虑到NameNode HA的使用性能,Router使用State Store中的高可用性状态信息将请求转发到最有可能处于活动状态的NameNode。注意,可以将此服务嵌入到NameNode本身以简化操作。

 

2.4. Availability and fault tolerance

The Router operates with failures at multiple levels.

  • Federated interface HA: The Routers are stateless and metadata operations are atomic at the NameNodes. If a Router becomes unavailable, any Router can take over for it. The clients configure their DFS HA client (e.g., ConfiguredFailoverProvider or RequestHedgingProxyProvider) with all the Routers in the federation as endpoints.
  • Unavailable State Store: If a Router cannot contact the State Store, it will enter into a Safe Mode state which disallows it from serving requests. Clients will treat Routers in Safe Mode as it was an Standby NameNode and try another Router. There is a manual way to manage the Safe Mode for the Router.
  • Expired NameNodes: If a NameNode heartbeat has not been recorded in the State Store for a multiple of the heartbeat interval, the monitoring Router will record that the NameNode has expired and no Routers will attempt to access it. If an updated heartbeat is subsequently recorded for the NameNode, the monitoring Router will restore the NameNode from the expired state.

Router失败的几个级别

  1. 联邦接口高可用:router是无状态的,元数据操作在namenode操作时原子性的。如果一个router不可用,其他router将会接管。客户端(flink sql等)可以配置(比如ConfiguredFailoverProviderRequestHedgingProxyProvider)联邦中所有Router作为端点来实现HA客户端。
  2. State Store不可用:如果Router不能与State Store通讯,router将会进入安全模式状态,即不允许处理请求。客户端将会将处于安全模式的Routers 看成 Standby NameNode,router将会尝试其他Router。这里有手工的方式管理Router的安全模式。
  3. 过期的NameNode:如果State Store 连续几次心跳间隔后没有接收到namenode的心跳,Router的监控将会记录NameNode已经过期,将不会有 Routers 访问它。

 

Interfaces

Router暴露了几个接口,以便与用户、管理员进行交互:

  • RPC:Router RPC实现了客户端与HDFS交互最常见的接口
  • Admin:管理员可以通过RPC添加或移除挂载表。
  • Web UI :Router暴露了一个联邦状态的可视化界面。
  • WebHDFS:除了 RPC 接口之外,路由器还提供 HDFS REST 接口 (WebHDFS)。
  • JMX:通过JMX模仿namenode来暴露指标,Web UI 使用它来获取集群状态。

Router不支持以下操作,当遇见以下操作时将会抛出异常:

  • 重命名、复制文件/文件夹在两个不同的namespace
  • 写入正在重新平衡的文件/文件夹

 

3. Quota management

在挂载表级别,联邦支持全局quota(份额)的控制。考虑到性能方面,Router缓存quota的使用情况,并定时更新。当调用RouterRPCSever中的写RPC请求时,会进行quota使用情况的检查。

详细的见:See HDFS Quotas Guide for the quota detail.
 

4. State Store

State Store维护的内容:

  • 维护子集群中块加载、磁盘可用率、HA情况等状态。
  • 维护远程挂载表:子集群与文件夹/文件之间的映射。

State Store后端是可插拔的。以下是State Store主要的存储信息,以及其实现:

  • Membership: 成员信息对namenodes的状态进行了编码,包括:子集群的存储容量、node的数量等。Router定期获取一个或多个namenode的信息。鉴于多个Routers可以监控同一个Namenode。当从State Store查询信息时,Router会从数据层面来仲裁,具体的:Router将会淘汰超过某个阈值的条目(例如,10个Router的心跳周期)。
  • Mount Table: 包含了文件夹和子集群之间的映射。类似于ViewFS的映射表:指定联邦文件夹、目标子集群和该文件夹中的路径。

 

三、部署 ing

涉及到Router启动、挂载表管理、废除nameservice、Router定时刷新、客户端配置、namenode、Router配置与指标配置等。

 
参考官网:[[https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs-rbf/HDFSRouterFederation.html#Deployment]]

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1346076.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

从马尔可夫奖励过程到马尔可夫决策到强化学习【01/2】

一、说明 关于马尔可夫过程,如何将马尔可夫决策转化成决策依据,这里介绍的基本的思想路径,为读者将来设计和应用决策模型提供理论上的参考。 这是了解强化学习的一系列基础文章的后续文章。如果您有兴趣了解强化学习,请查看此处。…

秒杀系统的设计思路(应对高并发,超卖等问题的解决思路)

首先我们先看一下设计秒杀系统时,我们应该考虑的问题。 解决方案: 一.页面静态化结合CDN内容分发 前端把能提前放入cdn服务器的东西都放进去,反正把所有能提升效率的步骤都做一下,减少真正秒杀时候服务器的压力。 秒杀活动的页面…

day5--java基础编程:异常,内部类

6 异常 6.1 异常概述 出现背景: 在使用计算机语言进行项目开发的过程中,即使程序员把代码写得尽善尽美,在系统的运行过程中仍然会遇到一些问题,因为很多问题不是靠代码能够避免的,比如:客户输入数据的格式&#xff0c…

EI级 | Matlab实现TCN-BiGRU-Multihead-Attention多头注意力机制多变量时间序列预测

EI级 | Matlab实现TCN-BiGRU-Multihead-Attention多头注意力机制多变量时间序列预测 目录 EI级 | Matlab实现TCN-BiGRU-Multihead-Attention多头注意力机制多变量时间序列预测预测效果基本介绍模型描述程序设计参考资料 预测效果 基本介绍 1.【EI级】 Matlab实现TCN-BiGRU-Mult…

petalinux

基于网络参考,运行一个xilinx pcie rc的参考,选择vcu118平台(基于microblaze):该参考通过pcie rc对挂在的外部ssd进行读写测试 Zynq PCI Express Root Complex design in Vivado - FPGA Developer 1,安装…

使用YOLOv8和Grad-CAM技术生成图像热图

目录 yolov8导航 YOLOv8(附带各种任务详细说明链接) 概述 环境准备 代码解读 导入库 定义letterbox函数 调整尺寸和比例 计算填充 应用填充 yolov8_heatmap类定义和初始化 后处理函数 绘制检测结果 类的调用函数 热图生成细节 参数解释 we…

Netty(一)-NIO

一、Netty 现在的互联网环境下,分布式系统大行其道,而分布式系统的根基在于网络编程,而Netty恰恰是Java领域网络编程的王者。如果要致力于开发高性能的服务器程序,高性能的客户端程序,必须掌握Netty。 1、NIO NIO&…

鸿蒙(OpenHarmony)系统之智能语音部件(1)

本文重点参考: OpenHarmony/ai_intelligent_voice_framework 一、总体概述 1. 功能简介及架构 智能语音组件包括智能语音服务框架和智能语音驱动,主要实现了语音注册及语音唤醒相关功能。 智能语音组件架构图如下图所示: (1&a…

分库分表之Mycat应用学习四

4 分片策略详解 分片的目标是将大量数据和访问请求均匀分布在多个节点上,通过这种方式提升数 据服务的存储和负载能力。 4.1 Mycat 分片策略详解 总体上分为连续分片和离散分片,还有一种是连续分片和离散分片的结合,例如先 范围后取模。 …

弱电工程计算机网络系统基础知识

我们周围无时无刻不存在一张网,如电话网、电报网、电视网、计算机网络等;即使我们身体内部也存在许许多多的网络系统,如神经系统、消化系统等。最为典型的代表即计算机网络,它是计算机技术与通信技术两个领域的结合。 计算机网络的…

C语言函数篇——sqrt()函数

sqrt()函数介绍: sqrt()函数是C语言中用于计算一个数的平方根的数学函数。它接受一个浮点数作为参数,并返回该数的平方根。 sqrt()函数的语法: double sqrt(double x); 其中,x是要计算平方根的数。 sqrt()函数的应用案例&#x…

【中小型企业网络实战案例 五】配置可靠性和负载分担

【中小型企业网络实战案例 三】配置DHCP动态分配地址-CSDN博客 【中小型企业网络实战案例 四】配置OSPF动态路由协议 【中小型企业网络实战案例 二】配置网络互连互通-CSDN博客 【中小型企业网络实战案例 一】规划、需求和基本配置_大小企业网络配置实例-CSDN博客 配置VRRP联…

matlab导出高清图片,须经修改后放入latex(例如添加文字说明,matlab画图不易操作)

一、背景 我们在写文章时,使用matlab画图后,如果不需要对图片进行额外修改或调整,例如添加文字说明,即可直接从matlab导出eps格式图片,然后插入到latex使用。 通常latex添加图片,是需要eps格式的。 但很…

matplotlib单变量和双变量可视化

使用seaborn 库的tips数据集,其中包含了某餐厅服务员收集的顾客付小费的相关数据(评论区) 单变量可视化 直方图 直方图是观察单个变量最常用的方法。这些值是经过"装箱"(bin)处理的 直方图会将数据分组后绘…

通用定时器PWM波输出原理

1通用PWM波输出原理 总结&#xff1a;PWM波周期或频率由ARR决定&#xff0c;PWM波占空比由CCRx决定 1通用PWM模式 1.1PWM模式1 PWM模式1&#xff1a; 递增&#xff1a;CNT < CCRx&#xff0c;输出有效电平1 CNT > CCRx&#xff0c;输出无效电平0 递减&#xff1a;CNT …

蜕变,我的2023

作者&#xff1a;苍何&#xff0c;前大厂高级 Java 工程师&#xff0c;阿里云专家博主&#xff0c;CSDN 2023 年 实力新星&#xff0c;土木转码&#xff0c;现任部门技术 leader&#xff0c;专注于互联网技术分享&#xff0c;职场经验分享。 &#x1f525;热门文章推荐&#xf…

uniapp中组件库的丰富NumberBox 步进器的用法

目录 基本使用 #步长设置 #限制输入范围 #限制只能输入整数 #禁用 #固定小数位数 #异步变更 #自定义颜色和大小 #自定义 slot API #Props #Events #Slots 基本使用 通过v-model绑定value初始值&#xff0c;此值是双向绑定的&#xff0c;无需在回调中将返回的数值重…

【Linux专区】如何配置新服务器 | 添加普通用户到sudoers | 配置vim | git免账号密码pull push

&#x1f49e;&#x1f49e;欢迎来到 Claffic 的博客&#x1f49e;&#x1f49e; &#x1f449; 专栏&#xff1a;《Linux专区》&#x1f448; &#x1f4ac;前言&#xff1a; 时隔131天&#xff0c;你的好友Claffic重新发文了&#xff01;(✿◕‿◕✿) 上期已经带大家白嫖了阿…

MFC - 给系统菜单(About Dialog)发消息

文章目录 MFC - 给系统菜单(About Dialog)发消息概述笔记resource.h菜单的建立菜单项的处理MSDN上关于系统菜单项值的说法END MFC - 给系统菜单(About Dialog)发消息 概述 做了一个对话框程序, 在系统菜单(在程序上面的标题栏右击)中有"关于"的菜单. 这个是程序框架…

Git:常用命令(一)

取得项目的Git 仓库 从当前目录初始化 1 git init 初始化后&#xff0c;在当前目录下会出现一个名为.git 的目录&#xff0c;所有Git 需要的数据和资源都存放在这个目录中。不过目前&#xff0c;仅仅是按照既有的结构框架初始化好了里边所有的文件和目录&#xff0c;但我们还…