当前位置:网站首页>HDFS集中式缓存管理(Centralized Cache Management)
HDFS集中式缓存管理(Centralized Cache Management)
2022-06-30 21:56:00 【星哥玩云】
Hadoop从2.3.0版本开始支持HDFS缓存机制,HDFS允许用户将一部分目录或文件缓存在HDFS当中,NameNode会通知拥有对应块的DataNodes将其缓存在DataNode的内存当中
集中式缓存管理有着许多显著的优势:
- 防止那些被频繁使用的数据从内存中清除
- 因为DataNode的缓存由NameNode来管理,applications在做任务安排时可以查询这个缓存的列表,使用一个被缓存的块副本能够提高读性能
- 当块被DataNode缓存之后,客户端可以使用一个新的、高效的、zero-copy的读API,因为缓存中的数据已经被计算过checksum,当使用新API时,客户端基本上是零开销的
- 可以提高集群的内存利用率。当使用操作系统的缓存时,对一个块的重复读会导致所有的副本都会被放到缓冲区当中,当使用集中式缓存时,用户可以指定n个副本中的m个才会被缓存,可以节约n-m的内存
用法
集中式缓存对那些频繁访问的的文件是非常有用的,例如hive中经常被使用的fact表就非常适合缓存;另一方面,缓存一年的查询结果可能没那么有用了,因为这个结果可能只会被查看一次
也有助于提高混合类型作业的SLA性能,把高优先级的数据缓存起来可以确保它不会与低优先级的数据竞争磁盘IO
使用:
[[email protected] hadoop]$ hdfs cacheadmin -addPool admin 【添加一个pool】
Successfully added cache pool admin.
[[email protected] hadoop]$ hdfs cacheadmin -listPools 【查看pool列表】
Found 1 result.
NAME OWNER GROUP MODE LIMIT MAXTTL
admin hadoop hadoop rwxr-xr-x unlimited never
[[email protected] hadoop]$ hdfs cacheadmin -addDirective -path /input -pool admin 【将一个目录加入pool】
Added cache directive 1
[[email protected] hadoop]$ hdfs cacheadmin -listDirectives 【查看已缓存的数据】
Found 2 entries
ID POOL REPL EXPIRY PATH
1 admin 1 never /input
2 test 1 never /output/0
[[email protected] hadoop]$ hdfs cacheadmin -removeDirective 1 【按id清除缓存】
Removed cached directive 1
[[email protected] hadoop]$ hdfs cacheadmin -listDirectives
Found 1 entry
ID POOL REPL EXPIRY PATH
2 test 1 never /output/0
[[email protected] hadoop]$ hdfs cacheadmin -removeDirectives -path /output/0 【按path清除缓存】
Removed cache directive 2
Removed every cache directive with path /output/0
[[email protected] hadoop]$ hdfs cacheadmin -listDirectives
Found 0 entries
边栏推荐
- 牛逼|珍藏多年的工具让我实现了带薪摸鱼自由
- Pytorch quantitative practice (2)
- 【回溯】全排列 II leetcode47
- Bloom filter
- Anfulai embedded weekly report no. 271: June 20, 2022 to June 26, 2022
- ML&DL:機器學習和深度學習中超參數優化的簡介、評估指標、過擬合現象、常用的調參優化方法之詳細攻略
- USBCAN分析仪的配套CAN和CANFD综合测试软件LKMaster软件解决工程师CAN总线测试难题
- 1-7 Path路径模块
- 1-14 express managed static resources
- 5G 在智慧医疗中的需求
猜你喜欢

Windbg调试工具介绍

Multi table operation - foreign key constraint

WinDbg debugging tool introduction

Niubi | the tools I have treasured for many years have made me free to fish with pay

5g demand in smart medicine

吴恩达的机器学习适合入门吗?

Akk bacteria - the next generation of beneficial bacteria

周少剑,很少见

Introduce an online platform for multi omics integration and network visual analysis

Zhoushaojian, rare
随机推荐
牛逼|珍藏多年的工具让我实现了带薪摸鱼自由
1-13 express监听GET和POST请求&处理请求
1-14 express托管静态资源
jupyterbook 清空控制台输出
Uniapp life cycle / route jump
Niubi | the tools I have treasured for many years have made me free to fish with pay
[BSP video tutorial] BSP video tutorial issue 19: AES encryption practice of single chip bootloader, including all open source codes of upper and lower computers (June 26, 2022)
程序员女友给我做了一个疲劳驾驶检测
模板方法模式介绍与示例
Do a scrollbar thinking
Qsort function and Simulation Implementation of qsort function
Five years after graduation, I wondered if I would still be so anxious if I hadn't taken the test
Open the jupyter notebook/lab and FAQ & settings on the remote server with the local browser
jupyter notebook/lab 切换conda环境
1-2 install and configure MySQL related software
Graduation project
NCAT detailed introduction (Reprint)
全面认识痛风:症状、风险因素、发病机理及管理
Notes [introduction to JUC package and future]
The Jenkins download Plug-in can't be downloaded. Solution