当前位置:网站首页>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
边栏推荐
- Go Web 编程入门: 一探优秀测试库 GoConvey
- Prediction and regression of stacking integrated model
- Do machine learning jobs require graduate students?
- ML&DL:機器學習和深度學習中超參數優化的簡介、評估指標、過擬合現象、常用的調參優化方法之詳細攻略
- 【BSP视频教程】BSP视频教程第19期:单片机BootLoader的AES加密实战,含上位机和下位机代码全开源(2022-06-26)
- 1-19 using CORS to solve interface cross domain problems
- 吴恩达的机器学习适合入门吗?
- Develop technology - get time 10 minutes ago
- 1-12 preliminary understanding of Express
- I want to know who I need to know to open a stock account? In addition, is it safe to open a mobile account?
猜你喜欢

PyTorch量化实践(1)

USBCAN分析仪的配套CAN和CANFD综合测试软件LKMaster软件解决工程师CAN总线测试难题

Which direction should college students choose to find jobs after graduation?

Stinky tofu made by Grandma

Is machine learning suitable for girls?

【BSP视频教程】BSP视频教程第19期:单片机BootLoader的AES加密实战,含上位机和下位机代码全开源(2022-06-26)

Introduction and example of template method mode

Bloom filter

WinDbg debugging tool introduction

5G 在智慧医疗中的需求
随机推荐
1-11 create online file service
Sqlserver string type converted to decimal or integer type
请问,启牛证券开户,可以开户吗?安全吗?你想要的答案全在这里
模板方法模式介绍与示例
Is it safe to open an account for stock trading on mobile phones?
国产数据库乱象
Flip the linked list ii[three ways to flip the linked list +dummyhead/ head insertion / tail insertion]
Nacos部署及使用
Look at the top 10 capabilities of alicloud cipu
興奮神經遞質——穀氨酸與大腦健康
VIM common shortcut keys
程序员女友给我做了一个疲劳驾驶检测
PyTorch量化实践(2)
Turn: win others' follow with practical actions
Uniapp routing uni simple router
1-14 express managed static resources
SQL server extracts pure numbers from strings
Which direction should college students choose to find jobs after graduation?
Arcmap|assign values to different categories of IDS with the field calculator
京东与腾讯续签三年战略合作协议;起薪涨至26万元,韩国三星SK争相加薪留住半导体人才;Firefox 102 发布|极客头条