预先计算指定路径上的 BranchCache 哈希
可配置 BranchCache 服务预先计算一个文件、目录,或目录结构中所有文件的哈希。如果要计算支持 BranchCache 的共享数据在非高峰时间的哈希,这将很有帮助。
关于本任务
如果希望在显示哈希统计信息前收集数据样本,则必须使用 statistics start 和可选 statistics stop 命令。有关这些命令的更多信息,请参阅《性能监控功能指南》。
必须指定存储虚拟机(SVM)和要预先计算哈希的路径。
此外,必须指定是否要递归计算哈希。
如果要递归计算哈希,BranchCache 服务将遍历指定路径下的整个目录树,并为每个合格的对象计算哈希。
- 根据需要预先计算哈希:
如果要在以下位置预先计算哈希... 请输入命令... 单个文件或目录 vserver cifs branchcache hash-create -vserver vserver_name -path path -recurse false 在目录结构中的所有文件中递归 vserver cifs branchcache hash-create -vserver vserver_name -path absolute_path -recurse true - 使用 statistics 命令验证该哈希是否正在计算:
- 在需要的 SVM 上显示 hashd 对象的统计信息示例:statistics show -object hashd -instance vserver_name
- 通过重复此命令验证创建的哈希数量是否正在增加。
示例
以下示例在路径 /data 和 SVM vs1 上所有包含的文件和子目录中创建了哈希:
cluster1::> vserver cifs branchcache hash-create -vserver vs1
-path /data -recurse true
cluster1::> statistics show -object hashd -instance vs1
Object: hashd
Instance: vs1
Start-time: 9/6/2012 19:09:54
End-time: 9/6/2012 19:11:15
Cluster: cluster1
Counter Value
-------------------------------- --------------------------------
branchcache_hash_created 85
branchcache_hash_files_replaced 0
branchcache_hash_rejected 0
branchcache_hash_store_bytes 0
branchcache_hash_store_size 0
instance_name vs1
node_name node1
node_uuid
11111111-1111-1111-1111-111111111111
process_name -
cluster1::> statistics show -object hashd -instance vs1
Object: hashd
Instance: vs1
Start-time: 9/6/2012 19:09:54
End-time: 9/6/2012 19:11:15
Cluster: cluster1
Counter Value
-------------------------------- --------------------------------
branchcache_hash_created 92
branchcache_hash_files_replaced 0
branchcache_hash_rejected 0
branchcache_hash_store_bytes 0
branchcache_hash_store_size 0
instance_name vs1
node_name node1
node_uuid
11111111-1111-1111-1111-111111111111
process_name -