您可以将 BranchCache 配置为根据每个共享提供 BranchCache 服务。或者,您可以将 BranchCache 配置为自动为所有 SMB 共享启用缓存。
可以在 SVM 上配置 BranchCache。
配置 BranchCache 时,必须指定以下参数:
必需参数 | 说明 |
---|---|
SVM 名称 | 在每个 SVM 上配置 BranchCache。您必须指定要在哪个已启用 CIFS 上的 SVM 配置 BranchCache 服务。 |
哈希存储路径 | BranchCache 哈希存储在 SVM 卷上的常规文件中。您必须指定希望 ONTAP 存储哈希数据的现有目录的路径。 BranchCache 哈希路径必须可读写。不允许使用只读路径,如 Snapshot 目录。您可以将哈希数据存储在包含其他数据的卷中,也可以创建单独的卷来存储哈希数据。 如果 SVM 是 SVM 的灾难恢复源,则哈希路径不能位于根卷上。这是因为根卷未复制到灾难恢复目标。 哈希路径可以包含空格和任何有效的文件名字符。 |
您可以选择指定以下参数:
可选参数 | 说明 |
---|---|
支持的版本 | ONTAP 支持 BranchCache 1 和 2。您可以启用版本 1、版本 2 或两个版本。默认情况下将启用两个版本。 |
哈希存储的最大大小 | 您可以指定用于哈希数据存储的大小。如果哈希数据超过此值,则 ONTAP 将删除较旧的哈希,以便为较新的哈希留出空间。哈希存储的默认大小为 1 GB。 如果不以过于积极的方式丢弃哈希,则 BranchCache 会更有效地执行。如果由于哈希存储已满而确定经常丢弃哈希,则可以通过修改 BranchCache 配置来增加哈希存储大小。 |
服务器密钥 | 您可以指定 BranchCache 服务使用的服务器密钥,以防止客户端模拟 BranchCache 服务器。如果未指定服务器密钥,则在创建 BranchCache 配置时会随机生成一个密钥。 可以将此服务器密钥指定为一个特定值,这样,如果多台服务器为相同的文件提供 BranchCache 数据,则客户端便可使用共享这一服务器密钥的任一服务器中的哈希。如果此服务器密钥包含空格,则必须使用引号将服务器密钥引起来。 |
运行模式 | 默认情况下是在每个共享上启用 BranchCache。
|
以下命令验证是否已启用 SMB 2.1 和 3.0,并将 BranchCache 配置为在 SVM vs1 上的所有 SMB 共享上自动启用缓存:
cluster1::> set -privilege advanced Warning: These advanced commands are potentially dangerous; use them only when directed to do so by technical support personnel. Do you wish to continue? (y or n): y cluster1::*> vserver cifs options show -vserver vs1 -fields smb2-enabled,smb3-enabled vserver smb2-enabled smb3-enabled ------- ------------ ------------ vs1 true true cluster1::*> set -privilege admin cluster1::> vserver cifs branchcache create -vserver vs1 -hash-store-path /hash_data -hash-store-max-size 20GB -versions enable-all -server-key "my server key" -operating-mode all-shares cluster1::> vserver cifs branchcache show -vserver vs1 Vserver: vs1 Supported BranchCache Versions: enable_all Path to Hash Store: /hash_data Maximum Size of the Hash Store: 20GB Encryption Key Used to Secure the Hashes: - CIFS BranchCache Operating Modes: all_shares
以下命令验证是否已启用 SMB 2.1 和 3.0,将 BranchCache 配置为在 SVM vs1 上的每个共享启用高速缓存,并验证 BranchCache 配置:
cluster1::> set -privilege advanced Warning: These advanced commands are potentially dangerous; use them only when directed to do so by technical support personnel. Do you wish to continue? (y or n): y cluster1::*> vserver cifs options show -vserver vs1 -fields smb2-enabled,smb3-enabled vserver smb2-enabled smb3-enabled ------- ------------ ------------ vs1 true true cluster1::*> set -privilege admin cluster1::> vserver cifs branchcache create -vserver vs1 -hash-store-path /hash_data -hash-store-max-size 20GB -versions enable-all -server-key "my server key" cluster1::> vserver cifs branchcache show -vserver vs1 Vserver: vs1 Supported BranchCache Versions: enable_all Path to Hash Store: /hash_data Maximum Size of the Hash Store: 20GB Encryption Key Used to Secure the Hashes: - CIFS BranchCache Operating Modes: per_share