移動及調整大小裝載快取 (Optional)Move and Resize the Hosted Cache (Optional)

適用於:Windows Server(以每年次管道)、Windows Server 2016、Windows Server 2012 R2、Windows Server 2012Applies To: Windows Server (Semi-Annual Channel), Windows Server 2016, Windows Server 2012 R2, Windows Server 2012

您可以使用此程序將裝載快取的磁碟機和您喜歡的資料夾,並在指定裝載快取伺服器可用於裝載快取的磁碟空間量。You can use this procedure to move the hosted cache to the drive and folder that you prefer, and to specify the amount of disk space that the hosted cache server can use for the hosted cache.

此程序是選擇性的。This procedure is optional. 如果預設快取位置 (%windir%\ServiceProfiles\NetworkService\AppData\Local\PeerDistPub) 和大小 – 也就是的硬碟空間總計 5%– 適用於您的部署,您不需要變更。If the default cache location (%windir%\ServiceProfiles\NetworkService\AppData\Local\PeerDistPub) and size – which is 5% of the total hard disk space – are appropriate for your deployment, you do not need to change them.

您必須是系統管理員才能執行此程序群組成員。You must be a member of the Administrators group to perform this procedure.

以移動及調整大小裝載快取To move and resize the hosted cache

  1. 打開 Windows PowerShell 以系統管理員權限。Open Windows PowerShell with Administrator privileges.

  2. 輸入下列命令,以在本機電腦上,將裝載快取移到另一個位置,然後按 ENTER 鍵。Type the following command to move the hosted cache to another location on the local computer, and then press ENTER.

    重要

    之前,請執行下列命令,請先取代參數值,例如 – 路徑和 – MoveTo,使用適用於您的部署的值。Before running the following command, replace parameter values, such as –Path and –MoveTo, with values that are appropriate for your deployment.

    Set-BCCache -Path C:\datacache –MoveTo D:\datacache
    
  3. 輸入下列命令,以調整裝載快取 – 專門 datacache -本機電腦上。Type the following command to resize the hosted cache –specifically the datacache - on the local computer. 按下 ENTER。Press ENTER.

    重要

    之前,請執行下列命令,請先取代參數值,例如 -Percentage,適用於您的部署的值。Before running the following command, replace parameter values, such as -Percentage, with values that are appropriate for your deployment.

    Set-BCCache -Percentage 20
    
  4. 若要確認裝載快取伺服器設定,輸入下列命令,然後按 ENTER。To verify the hosted cache server configuration, type the following command and press ENTER.

    Get-BCStatus
    

    命令的結果顯示所有方面 BranchCache 安裝的狀態。The results of the command display status for all aspects of your BranchCache installation. 以下是一些 BranchCache 設定和正確的值為每個項目:Following are a few of the BranchCache settings and the correct value for each item:

    • DataCache |CacheFileDirectoryPath:顯示硬碟位置符合您所提供的 – MoveTo SetBCCache 命令的參數值。DataCache | CacheFileDirectoryPath: Displays the hard disk location that matches the value you provided with the –MoveTo parameter of the SetBCCache command. 例如,如果您提供 D:\datacache 的值,該值會顯示命令的輸出中。For example, if you provided the value D:\datacache, that value is displayed in the command output.

    • DataCache |MaxCacheSizeAsPercentageOfDiskVolume:顯示符合您所提供的 SetBCCache 命令 – 百分比參數值數字。DataCache | MaxCacheSizeAsPercentageOfDiskVolume: Displays the number that matches the value you provided with the –Percentage parameter of the SetBCCache command. 例如,如果您提供 20 的值,該值會顯示命令的輸出中。For example, if you provided the value 20, that value is displayed in the command output.

若要繼續使用此快速入門,請查看Prehash 和預先載入內容裝載快取伺服器與 #40; 選用和 #41;.To continue with this guide, see Prehash and Preload Content on the Hosted Cache Server (Optional).