Skip to main content
简体中文版经机器翻译而成,仅供参考。如与英语版出现任何冲突,应以英语版为准。

在 ONTAP SVM 上禁用或启用 BranchCache

贡献者 netapp-aherbin netapp-aaron-holt

如果您之前已配置 BranchCache 但不希望分支机构客户端使用缓存内容,则可以在 CIFS 服务器上禁用缓存。您必须了解禁用 BranchCache 时会发生什么。您可以通过将 BranchCache 操作模式更改为禁用来在存储虚拟机上禁用 BranchCache。您可以随时通过将操作模式更改为按共享提供 BranchCache 服务或自动为所有共享提供服务来启用 BranchCache。

禁用 BranchCache 后, ONTAP 将不再计算哈希或将元数据发送到发出请求的客户端。但是,文件访问不会中断。此后,当启用了 BranchCache 的客户端请求要访问的内容的元数据信息时, ONTAP 会做出响应,并显示 Microsoft 定义的错误,这会导致客户端发送第二个请求,请求实际内容。在响应内容请求时, CIFS 服务器会发送存储在 Storage Virtual Machine ( SVM )上的实际内容。

在 CIFS 服务器上禁用 BranchCache 后, SMB 共享不会公布 BranchCache 功能。要访问新 SMB 连接上的数据,客户端会发出正常的读取 SMB 请求。

您可以随时在 CIFS 服务器上重新启用 BranchCache 。

  • 由于禁用 BranchCache 时不会删除哈希存储,因此,如果请求的哈希仍然有效,则在重新启用 BranchCache 后, ONTAP 可以使用存储的哈希响应哈希请求。

  • 如果随后重新启用了 BranchCache ,则在禁用 BranchCache 期间与已启用 BranchCache 的共享建立 SMB 连接的任何客户端都不会获得 BranchCache 支持。

    这是因为在设置 SMB 会话时, ONTAP 会公布对共享的 BranchCache 支持。在禁用 BranchCache 期间与已启用 BranchCache 的共享建立会话的客户端需要断开连接并重新连接,才能使用此共享的缓存内容。

备注

如果在 CIFS 服务器上禁用 BranchCache 后不想保存哈希存储,则可以手动将其删除。如果重新启用 BranchCache ,则必须确保哈希存储目录存在。重新启用 BranchCache 后,启用了 BranchCache 的共享会公布 BranchCache 功能。启用了 BranchCache 的客户端发出新请求时, ONTAP 会创建新哈希。

步骤
  1. 运行相应的命令:

    如果您要 …​ 然后输入以下内容 …​

    禁用 BranchCache

    vserver cifs branchcache modify -vserver vserver_name -operating-mode disable

    为每个共享启用 BranchCache

    vserver cifs branchcache modify -vserver vserver_name -operating-mode per-share

    为所有共享启用 BranchCache

    vserver cifs branchcache modify -vserver vserver_name -operating-mode all-shares

  2. 验证是否已使用所需设置配置了anchCache运行模式: vserver cifs branchcache show -vserver vserver_name

示例

以下示例将在 SVM vs1 上禁用 BranchCache :

cluster1::> vserver cifs branchcache modify -vserver vs1 -operating-mode disable

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: disable