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

在 SMB 共享上禁用 BranchCache

贡献者 netapp-aherbin netapp-aaron-holt netapp-ahibbard

如果您不希望在某些 SMB 共享上提供 BranchCache 缓存服务,但稍后可能希望在这些共享上提供缓存服务,则可以在共享基础上禁用 BranchCache 。如果已将 BranchCache 配置为在所有共享上提供缓存,但您希望暂时禁用所有缓存服务,则可以修改 BranchCache 配置以停止对所有共享的自动缓存。

如果 SMB 共享上的 BranchCache 在首次启用后随后被禁用,则 ONTAP 将停止向请求客户端发送元数据。需要数据的客户端直接从内容服务器( Storage Virtual Machine ( SVM )上的 CIFS 服务器)检索数据。

在单个 ONTAP SMB 共享上禁用 BranchCache

如果您不希望在先前提供缓存内容的某些共享上提供缓存服务,则可以在现有 SMB 共享上禁用 BranchCache 。

步骤
  1. 输入以下命令:

    vserver cifs share properties remove -vserver <SVM_name> -share-name <share_name> -share-properties branchcache

    此时将删除 BranchCache 共享属性。其他应用的共享属性仍有效。

示例

以下命令会在名为 data2 的现有 SMB 共享上禁用 BranchCache :

cluster1::> vserver cifs share show -vserver vs1 -share-name data2

                      Vserver: vs1
                        Share: data2
     CIFS Server NetBIOS Name: VS1
                         Path: /data2
             Share Properties: oplocks
                               browsable
                               changenotify
                               attributecache
                               branchcache
           Symlink Properties: -
      File Mode Creation Mask: -
 Directory Mode Creation Mask: -
                Share Comment: -
                    Share ACL: Everyone / Full Control
File Attribute Cache Lifetime: 10s
                  Volume Name: -
                Offline Files: manual
Vscan File-Operations Profile: standard

cluster1::> vserver cifs share properties remove -vserver vs1 -share-name data2 -share-properties branchcache

cluster1::> vserver cifs share show -vserver vs1 -share-name data2

                      Vserver: vs1
                        Share: data2
     CIFS Server NetBIOS Name: VS1
                         Path: /data2
             Share Properties: oplocks
                               browsable
                               changenotify
                               attributecache
           Symlink Properties: -
      File Mode Creation Mask: -
 Directory Mode Creation Mask: -
                Share Comment: -
                    Share ACL: Everyone / Full Control
File Attribute Cache Lifetime: 10s
                  Volume Name: -
                Offline Files: manual
Vscan File-Operations Profile: standard

停止所有 ONTAP SMB 共享上的自动缓存

如果 BranchCache 配置自动对每个 Storage Virtual Machine ( SVM )上的所有 SMB 共享启用缓存,则可以修改 BranchCache 配置以停止自动缓存所有 SMB 共享的内容。

关于此任务

要停止所有 SMB 共享上的自动缓存,请将 BranchCache 操作模式更改为每共享缓存。

步骤
  1. 配置 BranchCache 以停止对所有 SMB 共享的自动缓存:

    vserver cifs branchcache modify -vserver <SVM_name> -operating-mode per-share
  2. 验证 BranchCache 配置是否正确:

    vserver cifs branchcache show -vserver <SVM_name>
示例

以下命令将更改 Storage Virtual Machine ( SVM ,以前称为 Vserver ) vs1 上的 BranchCache 配置,以停止对所有 SMB 共享的自动缓存:

cluster1::> vserver cifs branchcache modify -vserver vs1 -operating-mode per-share

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