本文主要是介绍HDFS centralized cache management,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Hadoop 2.3.0解决了如下几个问题:
- 可以指定自己的热点数据常存内存;
- NameNode manage centralized cache;
- without DataNode OS buffer cache to saving resoureces;
- speed up HDFS client read .when the block cache in memory ,directly using zero-copy read from cache pass thougth hard I/O、checksum.
下面内容是参考
cache directive: 表示要被cache到内存的文件或者目录。
cache pool: 用于管理一系列的cache directive,类似于命名空间
具体操作:
[root@HDP01 ~]#
[root@HDP01 ~]# hdfs cacheadmin -addPool financial
AccessControlException: Access denied for user root. Superuser privilege is required
[root@HDP01 ~]#
[root@HDP01 ~]# su hdfds
su: user hdfds does not exist
[root@HDP01 ~]# su hdfs
[hdfs@HDP01 root]$ hdfs cacheadmin -addPool financial
Successfully added cache pool financial.
[hdfs@HDP01 root]$ exit
exit
[root@HDP01 ~]# hdfs cacheadmin -addDirective -path /test/install.log -pool financial -replication 1
AccessControlException: Permission denied while accessing pool financial: user root does not have WRITE permissions.
[root@HDP01 ~]#
[root@HDP01 ~]# su hdfs
[hdfs@HDP01 root]$ hdfs cacheadmin -addDirective -path /test/install.log -pool financial -replication 1
Added cache directive 1
[hdfs@HDP01 root]$
[hdfs@HDP01 root]$ hdfs cacheadmin -listPools
Found 1 result.
NAME OWNER GROUP MODE LIMIT MAXTTL
financial hdfs hadoop rwxr-xr-x unlimited never
[hdfs@HDP01 root]$
[hdfs@HDP01 root]$ hdfs cacheadmin -listPools
Found 1 result.
NAME OWNER GROUP MODE LIMIT MAXTTL
financial hdfs hadoop rwxr-xr-x unlimited never
[hdfs@HDP01 root]$
[hdfs@HDP01 root]$ hdfs cacheadmin -listDirectives
Found 1 entryID POOL REPL EXPIRY PATH 1 financial 1 never /test/install.log
[hdfs@HDP01 root]$
centralized cache和distributed cache的区别:
- distributed cache:disk locality,
- centralized cache:memory locality。
这篇关于HDFS centralized cache management的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!