当前位置:网站首页>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
边栏推荐
- [backtracking] full arrangement II leetcode47
- 【回溯】全排列 II leetcode47
- Jupyter notebook/lab switch CONDA environment
- Analyse des risques liés aux liaisons de microservices
- Usbcan analyzer's supporting can and canfd comprehensive test software lkmaster software solves engineers' can bus test problems
- Starting from pg15 xid64 ticket skipping again
- Uniapp rich text editor
- 興奮神經遞質——穀氨酸與大腦健康
- 【回溯】全排列 leetcode46
- The Jenkins download Plug-in can't be downloaded. Solution
猜你喜欢

《安富莱嵌入式周报》第270期:2022.06.13--2022.06.19

从PG15 XID64再次跳票说起

Nacos部署及使用

Development techniques - import files using easyexcel (simple example)

How to use data sets in machine learning?

Bloom filter

Is Wu Enda's machine learning suitable for entry?

Error filesystemexception: /data/nodes/0/indices/gttxk-hntgkhacm-8n60jw/1/index/ es_ temp_ File: structure needs cleaning

Study summary of dynamic routing between capsules

jupyterbook 清空控制台输出
随机推荐
Deployment and use of Nacos
【回溯】全排列 II leetcode47
《安富莱嵌入式周报》第271期:2022.06.20--2022.06.26
1-3 使用SQL管理数据库
PostgreSQL存储结构浅析
WinDbg debugging tool introduction
Stimulate new kinetic energy to develop digital economy in multiple places
The programmer's girlfriend gave me a fatigue driving test
SQL server extracts pure numbers from strings
USBCAN分析仪的配套CAN和CANFD综合测试软件LKMaster软件解决工程师CAN总线测试难题
根据肠道微生物组重新思考健康饮食
微服务链路风险分析
1-18 创建最基本的express服务器&创建路由的API模块
jupyterbook 清空控制台输出
用yml文件进行conda迁移环境时的报错小结
Zhoushaojian, rare
1-2 install and configure MySQL related software
谈谈数字化转型的几个关键问题
1-20 pre inspection request
Jupyterbook clear console output