直接部署存放空間Deploy Storage Spaces Direct

適用於:Windows Server 2016Applies to: Windows Server 2016

本主題提供逐步指示以部署直接儲存空格This topic provides step-by-step instructions to deploy Storage Spaces Direct.

提示

尋找以取得 Hyper-Converged 基礎結構吗?Looking to acquire Hyper-Converged Infrastructure? Microsoft 建議我們協力廠商從這些Windows 伺服器軟體定義的解決方案。Microsoft recommends these Windows Server Software-Defined solutions from our partners. 他們是設計、 組合,並驗證對我們參考架構,以確保相容性及可靠性,讓您取得和快速地執行。They are designed, assembled, and validated against our reference architecture to ensure compatibility and reliability, so you get up and running quickly.

提示

您可以使用 HYPER-V 虛擬機器,包括 Microsoft Azure 中用來評估儲存空格直接不含硬體You can use Hyper-V virtual machines, including in Microsoft Azure, to evaluate Storage Spaces Direct without hardware. 您也可能會想要檢閱方便使用Windows Server 快速實驗室部署指令碼,讓我們用訓練用途。You may also want to review the handy Windows Server rapid lab deployment scripts, which we use for training purposes.

開始之前Before you start

檢閱直接儲存空格的硬體需求並瀏覽至熟悉的整體方法與某些步驟相關聯的重要注意事項此文件。Review the Storage Spaces Direct hardware requirements and skim this document to familiarize yourself with the overall approach and important notes associated with some steps.

請收集下列資訊:Gather the following information:

  • 部署選項。Deployment option. 儲存空格直接支援兩個部署選項: 超收斂和收斂、 也稱為 disaggregated。Storage Spaces Direct supports two deployment options: hyper-converged and converged, also known as disaggregated. 熟悉的各個判斷其適合您的優點。Familiarize yourself with the advantages of each to decide which is right for you. 步驟 1-3 下套用至這兩個部署選項。Steps 1-3 below apply to both deployment options. 步驟 4 只需要交集的部署。Step 4 is only needed for converged deployment.

  • 伺服器名稱。Server names. 熟悉的電腦、 檔案、 路徑、 及其他資源的組織的命名原則。Get familiar with your organization's naming policies for computers, files, paths, and other resources. 您將需要提供數個伺服器,每個唯一的名稱。You'll need to provision several servers, each with unique names.

  • 網域名稱。Domain name. 熟悉的網域命名並加入網域的組織的原則。Get familiar with your organization's policies for domain naming and domain joining. 您將可將伺服器加入您的網域,並需要指定網域名稱。You'll be joining the servers to your domain, and you'll need to specify the domain name.

  • RDMA 網路。RDMA networking. There are two types of RDMA protocols: iWarp and RoCE.There are two types of RDMA protocols: iWarp and RoCE. Note which one your network adapters use, and if RoCE, also note the version (v1 or v2).Note which one your network adapters use, and if RoCE, also note the version (v1 or v2). For RoCE, also note the model of your top-of-rack switch.For RoCE, also note the model of your top-of-rack switch.

  • VLAN ID。VLAN ID. 如果有任何,注意 VLAN ID 是用於在伺服器上的 [管理 OS 網路介面卡。Note the VLAN ID to be used for management OS network adapters on the servers, if any. 您應該能夠從您的網路管理員取得。You should be able to obtain this from your network administrator.

步驟 1︰部署 Windows ServerStep 1: Deploy Windows Server

步驟 1.1: 安裝作業系統Step 1.1: Install the operating system

第一個步驟是將叢集中的每台伺服器上安裝 Windows Server。The first step is to install Windows Server on every server that will be in the cluster. 儲存空格直接需要 Windows Server 2016 Datacenter Edition。Storage Spaces Direct requires Windows Server 2016 Datacenter Edition. 您可以使用的伺服器核心安裝選項或伺服器與桌面體驗。You can use the Server Core installation option, or Server with Desktop Experience.

當您安裝 Windows Server 使用安裝精靈時,您可以選擇 (參照伺服器核心) 的Windows ServerWindows Server (與桌面體驗的伺服器),這是相當於 [完整] 安裝選項適用於 Windows Server 2012 R2]。When you install Windows Server using the Setup wizard, you can choose between Windows Server (referring to Server Core) and Windows Server (Server with Desktop Experience), which is the equivalent of the Full installation option available in Windows Server 2012 R2. 如果您未選擇,您會得到的伺服器核心安裝選項。If you don't choose, you'll get the Server Core installation option. 如需詳細資訊,請參閱安裝 Windows Server 2016 選項For more information, see Installation Options for Windows Server 2016.

步驟 1.2: 連線至伺服器Step 1.2: Connect to the servers

本指南重點的伺服器核心安裝選項和個別管理系統,必須具有從遠端部署/管理:This guide focuses the Server Core installation option and deploying/managing remotely from a separate management system, which must have:

  • Windows Server 2016 當成伺服器相同的更新管理Windows Server 2016 with the same updates as the servers it's managing
  • 為管理伺服器的網路連線Network connectivity to the servers it's managing
  • 加入至相同的網域] 或 [完全信任的網域Joined to the same domain or a fully trusted domain
  • 適用於 Hyper-V 和容錯移轉叢集的遠端伺服器管理工具 (RSAT) 和 PowerShell 模組。Remote Server Administration Tools (RSAT) and PowerShell modules for Hyper-V and Failover Clustering. RSAT 工具和 PowerShell 模組可在 Windows Server,可以安裝而不需安裝其他功能。RSAT tools and PowerShell modules are available on Windows Server and can be installed without installing other features. 您也可以在 Windows 10 管理電腦上安裝遠端伺服器管理工具You can also install the Remote Server Administration Tools on a Windows 10 management PC.

在管理系統上,安裝容錯移轉叢集與 Hyper-V 管理工具。On the Management system install the Failover Cluster and Hyper-V management tools. 這可以透過伺服器管理員使用 「新增角色及功能」 精靈完成。This can be done through Server Manager using the Add Roles and Features wizard. [功能] 頁面上,選取 [遠端伺服器管理工具],然後選取要安裝的工具。On the Features page, select Remote Server Administration Tools, and then select the tools to install.

進入 PS 工作階段,並使用伺服器名稱,或是您要連線之節點的 IP 位址。Enter the PS session and use either the server name or the IP address of the node you want to connect to. 您必須在您執行此命令之後提示輸入密碼,輸入您指定當設定 Windows 的系統管理員密碼。You'll be prompted for a password after you execute this command, enter the administrator password you specified when setting up Windows.

Enter-PSSession -ComputerName <myComputerName> -Credential LocalHost\Administrator

以下是範例所做的是更多有用的指令碼,您需要一次以上執行這項作業的方式相同的事:Here's an example of doing the same thing in a way that is more useful in scripts, in case you need to do this more than once:

$myServer1 = "myServer-1"
$user = "$myServer1\Administrator"

Enter-PSSession -ComputerName $myServer1 -Credential $user

提示

如果您正在管理系統從遠端部署,您可能會收到類似的錯誤WinRM 無法處理要求。If you're deploying remotely from a management system, you might get an error like WinRM cannot process the request. 若要修正此問題,使用 Windows PowerShell 將每一部伺服器新增至管理電腦上的 [信任的主機] 清單:To fix this, use Windows PowerShell to add each server to the Trusted Hosts list on your management computer:

Set-Item WSMAN:\Localhost\Client\TrustedHosts -Value Server01 -Force

請注意: 信任的主機清單支援萬用字元,如Server*Note: the trusted hosts list supports wildcards, like Server*.

若要檢視您信任的主機的清單,請輸入Get-Item WSMAN:\Localhost\Client\TrustedHostsTo view your Trusted Hosts list, type Get-Item WSMAN:\Localhost\Client\TrustedHosts.

若要清空清單,請輸入Clear-Item WSMAN:\Localhost\Client\TrustedHostTo empty the list, type Clear-Item WSMAN:\Localhost\Client\TrustedHost.

步驟 1.3: 加入網域並新增網域帳戶Step 1.3: Join the domain and add domain accounts

到目前為止已個別的伺服器設定本機系統管理員帳戶後, <ComputerName>\AdministratorSo far you've configured the individual servers with the local administrator account, <ComputerName>\Administrator.

若要管理直接儲存空間,您需要伺服器加入網域並使用是在每一部伺服器上的管理員群組中的 Active Directory 網域服務網域帳戶。To manage Storage Spaces Direct, you'll need to join the servers to a domain and use an Active Directory Domain Services domain account that is in the Administrators group on every server.

管理系統管理員權限開啟 PowerShell 主控台。From the management system, open a PowerShell console with Administrator privileges. 使用Enter-PSSession連線到每一部伺服器並執行下列 cmdlet,worked 您自己的電腦名稱、 網域名稱及網域認證:Use Enter-PSSession to connect to each server and run the following cmdlet, substituting your own computer name, domain name, and domain credentials:

Add-Computer -NewName "Server01" -DomainName "contoso.com" -Credential "CONTOSO\User" -Restart -Force  

如果您儲存系統管理員帳戶不是以 Domain Admins 群組的成員,將您的儲存系統管理員帳戶新增至每個節點集的本機管理員群組或更妥善地尚未新增您用於儲存系統管理員群組。If your storage administrator account isn't a member of the Domain Admins group, add your storage administrator account to the local Administrators group on each node - or better yet, add the group you use for storage administrators. 您可以使用下列命令 (或寫入達成-請參閱使用 PowerShell 來新增至本機群組的網域使用者的詳細資訊的 Windows PowerShell 函數):You can use the following command (or write a Windows PowerShell function to do so - see Use PowerShell to Add Domain Users to a Local Group for more info):

Net localgroup Administrators <Domain\Account> /add

步驟 1.4 g b: 安裝角色和功能Step 1.4: Install roles and features

下一個步驟是在每一部伺服器上的 [安裝某些伺服器角色及功能The next step is to install some server roles and features on every server:

  • 容錯移轉叢集Failover Clustering
  • Hyper-VHyper-V
  • 檔案伺服器 (如果您想要裝載任何檔案共用、 等交集的部署)File Server (if you want to host any file shares, such as for a converged deployment)
  • Data-Center-Bridging (if you're using RoCEv2 instead of iWARP network adapters)Data-Center-Bridging (if you're using RoCEv2 instead of iWARP network adapters)
  • RSAT-Clustering-PowerShellRSAT-Clustering-PowerShell
  • Hyper-V-PowerShellHyper-V-PowerShell

使用Install-WindowsFeature指令程式所示,worked 伺服器名稱:Use the Install-WindowsFeature cmdlet as shown, substituting your server names:

# Fill in these variables with your values
$ServerList = "Server01", "Server02", "Server03", "Server04"
$FeatureList = "Hyper-V", "Failover-Clustering", "Data-Center-Bridging", "RSAT-Clustering-PowerShell", "Hyper-V-PowerShell", "FS-FileServer"

Invoke-Command ($ServerList) {
    Install-WindowsFeature $FeatureList
}

步驟 2:設定網路Step 2: Configure the network

如果您正在部署儲存空格直接內的虛擬機器時,略過這一節。If you're deploying Storage Spaces Direct inside virtual machines, skip this section.

儲存空格直接需要高頻寬、 低延遲叢集中的伺服器之間網路。Storage Spaces Direct requires high-bandwidth, low-latency networking between servers in the cluster. 至少 10 GbE 網路為必要和建議遠端直接記憶體存取 (RDMA)。At least 10 GbE networking is required and remote direct memory access (RDMA) is recommended. You can use either iWARP or RoCE as long as it has the Windows Server 2016 logo, but iWARP is usually easier to set up.You can use either iWARP or RoCE as long as it has the Windows Server 2016 logo, but iWARP is usually easier to set up.

重要

Depending on your networking equipment, and especially with RoCE v2, some configuration of the top-of-rack switch may be required.Depending on your networking equipment, and especially with RoCE v2, some configuration of the top-of-rack switch may be required. 正確的交換器設定請務必確定可靠性和效能的儲存空間直接。Correct switch configuration is important to ensure reliability and performance of Storage Spaces Direct.

Windows Server 2016 介紹交換器內嵌聯合團隊 (設定) 內 HYPER-V 虛擬交換器。Windows Server 2016 introduces switch-embedded teaming (SET) within the Hyper-V virtual switch. 這可讓同一個實體 NIC 連接埠使用 RDMA、 減少所需的實體 NIC 連接埠數目時要使用的所有網路流量。This allows the same physical NIC ports to be used for all network traffic while using RDMA, reducing the number of physical NIC ports required. 切換內嵌速度建議直接儲存空格。Switch-embedded teaming is recommended for Storage Spaces Direct.

若要設定的儲存空間直接,請參閱網路指示請參閱Windows Server 2016 收斂 NIC 與來賓 RDMA 部署指南 》For instructions to set up networking for Storage Spaces Direct, see see Windows Server 2016 Converged NIC and Guest RDMA Deployment Guide.

步驟 3:設定儲存空間直接存取Step 3: Configure Storage Spaces Direct

下列步驟要在管理系統 (與要設定的伺服器相同版本) 上完成。The following steps are done on a management system that is the same version as the servers being configured. 執行使用遠端 PowerShell 工作階段不到但應該改以管理權限管理系統上執行本機 PowerShell 工作階段中的下列步驟。The following steps should NOT be run remotely using a PowerShell session, but instead run in a local PowerShell session on the management system, with administrative permissions.

步驟 3.1: 全新的磁碟機Step 3.1: Clean drives

啟用直接儲存空間之前,請確定您的磁碟機都是空: 任何舊的分割區或其他資料。Before you enable Storage Spaces Direct, ensure your drives are empty: no old partitions or other data. 執行下列指令碼 worked 您的電腦名稱、 移除所有任何舊的分割區或其他資料。Run the following script, substituting your computer names, to remove all any old partitions or other data.

警告

此指令碼將會永久移除任何作業系統開機磁碟機以外的磁碟機上的任何資料 !This script will permanently remove any data on any drives other than the operating system boot drive!

# Fill in these variables with your values
$ServerList = "Server01", "Server02", "Server03", "Server04"

Invoke-Command ($ServerList) {
    Update-StorageProviderCache
    Get-StoragePool | ? IsPrimordial -eq $false | Set-StoragePool -IsReadOnly:$false -ErrorAction SilentlyContinue
    Get-StoragePool | ? IsPrimordial -eq $false | Get-VirtualDisk | Remove-VirtualDisk -Confirm:$false -ErrorAction SilentlyContinue
    Get-StoragePool | ? IsPrimordial -eq $false | Remove-StoragePool -Confirm:$false -ErrorAction SilentlyContinue
    Get-PhysicalDisk | Reset-PhysicalDisk -ErrorAction SilentlyContinue
    Get-Disk | ? Number -ne $null | ? IsBoot -ne $true | ? IsSystem -ne $true | ? PartitionStyle -ne RAW | % {
        $_ | Set-Disk -isoffline:$false
        $_ | Set-Disk -isreadonly:$false
        $_ | Clear-Disk -RemoveData -RemoveOEM -Confirm:$false
        $_ | Set-Disk -isreadonly:$true
        $_ | Set-Disk -isoffline:$true
    }
    Get-Disk | Where Number -Ne $Null | Where IsBoot -Ne $True | Where IsSystem -Ne $True | Where PartitionStyle -Eq RAW | Group -NoElement -Property FriendlyName
} | Sort -Property PsComputerName, Count

輸出看起來像這樣、計數所在的每個模型中的每一部伺服器的磁碟機數目:The output will look like this, where Count is the number of drives of each model in each server:

Count Name                          PSComputerName
----- ----                          --------------
4     ATA SSDSC2BA800G4n            Server01
10    ATA ST4000NM0033              Server01
4     ATA SSDSC2BA800G4n            Server02
10    ATA ST4000NM0033              Server02
4     ATA SSDSC2BA800G4n            Server03
10    ATA ST4000NM0033              Server03
4     ATA SSDSC2BA800G4n            Server04
10    ATA ST4000NM0033              Server04

步驟 3.2: 驗證叢集Step 3.2: Validate the cluster

在此步驟中,您將執行叢集驗證工具,以確保伺服器節點已正確設定以建立使用直接儲存空格的叢集。In this step, you'll run the cluster validation tool to ensure that the server nodes are configured correctly to create a cluster using Storage Spaces Direct. 當叢集驗證 (Test-Cluster) 是執行建立叢集之前,請執行測試,確認組態出現合適順利運作都如容錯移轉叢集。When cluster validation (Test-Cluster) is run before the cluster is created, it runs the tests that verify that the configuration appears suitable to successfully function as a failover cluster. 向下使用範例-Include指定參數,然後按一下 [測試的特定類別。The example directly below uses the -Include parameter, and then the specific categories of tests are specified. 這可確保驗證中包含與儲存空間直接存取相關的測試。This ensures that the Storage Spaces Direct specific tests are included in the validation.

您可以使用下列 PowerShell 命令驗證一組用來做為儲存空間直接存取叢集的伺服器。Use the following PowerShell command to validate a set of servers for use as a Storage Spaces Direct cluster.

Test-Cluster –Node <MachineName1, MachineName2, MachineName3, MachineName4> –Include "Storage Spaces Direct", "Inventory", "Network", "System Configuration"

步驟 3.3: 建立叢集Step 3.3: Create the cluster

在此步驟中,您將建立叢集與已驗證對叢集建立上述步驟中使用下列 PowerShell cmdlet 的節點。In this step, you'll create a cluster with the nodes that you have validated for cluster creation in the preceding step using the following PowerShell cmdlet.

建立叢集,您將收到一則警告訊息表示-"發生問題時所建立的叢集的角色可能會防止其啟動。When creating the cluster, you'll get a warning that states - "There were issues while creating the clustered role that may prevent it from starting. 如需詳細資訊,請檢視下面的報表檔案。」For more information, view the report file below." 您可以放心忽略這個警告。You can safely ignore this warning. 這是因為沒有磁碟可供叢集仲裁使用。It's due to no disks being available for the cluster quorum. 建議您在建立叢集之後設定檔案共用見證或雲端見證。Its recommended that a file share witness or cloud witness is configured after creating the cluster.

注意

如果伺服器使用靜態 IP 位址,請修改下列命令,新增下列參數並指定 IP 位址:-StaticAddress <X.X.X.X> 以反映靜態 IP 位址。If the servers are using static IP addresses, modify the following command to reflect the static IP address by adding the following parameter and specifying the IP address:–StaticAddress <X.X.X.X>. 在下列命令中,ClusterName 預留位置應取代為唯一的 netbios 名稱 (15 個以下的字元)。In the following command the ClusterName placeholder should be replaced with a netbios name that is unique and 15 characters or less.

New-Cluster –Name <ClusterName> –Node <MachineName1,MachineName2,MachineName3,MachineName4> –NoStorage

叢集建立之後,叢集名稱的 DNS 項目需要一些時間才會被複寫。After the cluster is created, it can take time for DNS entry for the cluster name to be replicated. 時間則取決於環境和 DNS 複寫組態。The time is dependent on the environment and DNS replication configuration. 如果解析叢集不成功,在大多數情況下,使用節點 (屬於叢集的作用中成員) 的電腦名稱而不是叢集名稱可能會成功。If resolving the cluster isn't successful, in most cases you can be successful with using the machine name of a node that is an active member of the cluster may be used instead of the cluster name.

步驟 3.4: 設定叢集見證Step 3.4: Configure a cluster witness

建議您設定的見證叢集,這樣的三個或多個節點系統可以忍受兩個節點失敗或正在離線。It is recommended that you configure a witness for the cluster, so that a three or more node system can withstand two nodes failing or being offline. 兩個節點部署需要的叢集見證,否則不必離線任一節點會導致變成無法使用,以及其他。A two-node deployment requires a cluster witness, otherwise either node going offline will cause the other to become unavailable as well. 您可以使用檔案共用作為見證,或使用雲端見證來搭配這些系統。With these systems, you can use a file share as a witness, or use cloud witness. 如需詳細資訊,請參閱部署容錯移轉叢集的雲端見證For more info, see Deploy a Cloud Witness for a Failover Cluster.

如需設定檔案共用見證的詳細資訊,請參閱 Configuring a File Share Witness on a Scale-Out File Server (在向外延展檔案伺服器上設定檔案共用見證)。For more information about configuring a file share witness, see Configuring a File Share Witness on a Scale-Out File Server.

步驟 3.5:啟用儲存空間直接存取Step 3.5: Enable Storage Spaces Direct

虛擬機器後建立叢集,請使用Enable-ClusterStorageSpacesDirectPowerShell 指令程式,它會放入儲存空格直接模式的儲存系統並執行下列動作自動:After creating the cluster, use the Enable-ClusterStorageSpacesDirect PowerShell cmdlet, which will put the storage system into the Storage Spaces Direct mode and do the following automatically:

  • 建立集區︰建立有類似 "S2D on Cluster1" 名稱的單一大型集區。Create a pool: Creates a single large pool that has a name like "S2D on Cluster1".

  • 設定儲存空間直接存取快取︰如果有多個媒體 (磁碟機) 類型可供儲存空間直接存取使用,則允許以最快速的快取裝置來執行 (在大部分情況下可讀取和寫入)Configures the Storage Spaces Direct caches: If there is more than one media (drive) type available for Storage Spaces Direct use, it enables the fastest as cache devices (read and write in most cases)

  • 層: 建立兩層為預設層。Tiers: Creates two tiers as default tiers. 一個稱為「容量」,另一個稱為「效能」。One is called "Capacity" and the other called "Performance". 此 Cmdlet 會分析裝置,並使用混合的裝置類型和復原功能來設定每一層。The cmdlet analyzes the devices and configures each tier with the mix of device types and resiliency.

從管理系統以系統管理員權限開啟的 PowerShell 命令視窗中,起始下列命令。From the management system, in a PowerShell command windows opened with Administrator privileges, initiate the following command. 叢集名稱是您在先前步驟中建立的叢集名稱。The cluster name is the name of the cluster that you created in the previous steps. 如果此命令在其中一個本機節點上執行,則不需要 -CimSession 參數。If this command is run locally on one of the nodes, the -CimSession parameter is not necessary.

Enable-ClusterStorageSpacesDirect –CimSession <ClusterName>

若要使用上面的命令啟用儲存空間直接存取,您也可以使用節點名稱而不是叢集名稱。To enable Storage Spaces Direct using the above command, you can also use the node name instead of the cluster name. 使用節點名稱可能更可靠,因為新建立的叢集名稱可能會發生 DNS 複寫延遲。Using the node name may be more reliable due to DNS replication delays that may occur with the newly created cluster name.

此命令完成可能需要幾分鐘的時間,完成之後,系統就可以建立磁碟區。When this command is finished, which may take several minutes, the system will be ready for volumes to be created.

步驟 3.6:建立磁碟區Step 3.6: Create volumes

我們建議使用New-Volume指令程式時提供的最快和最簡單的經驗。We recommend using the New-Volume cmdlet as it provides the fastest and most straightforward experience. 這個單一 cmdlet 會自動建立虛擬磁碟、磁碟分割以及格式化,以相符名稱建立磁碟區,並將其加入至叢集共用磁碟區 – 全在一個簡易步驟中。This single cmdlet automatically creates the virtual disk, partitions and formats it, creates the volume with matching name, and adds it to cluster shared volumes – all in one easy step.

如需詳細資訊,請查看建立儲存空間直接存取中的磁碟區For more information, check out Creating volumes in Storage Spaces Direct.

步驟 3.7: (選用) 啟用 CSV 快取Step 3.7: Optionally enable the CSV cache

您可以選擇啟用共用的叢集磁碟區 (CSV) 快取系統記憶體 (RAM) 作為寫入到區塊層級快取已未由 Windows 快取管理員快取的讀取作業。You can optionally enable the cluster shared volume (CSV) cache to use system memory (RAM) as a write-through block-level cache of read operations that aren't already cached by the Windows cache manager. 這可以改善 HYPER-V 等應用程式的效能。This can improve performance for applications such as Hyper-V. CSV 快取可以提升效能的讀取要求,也適用於向外延展檔案伺服器案例。The CSV cache can boost the performance of read requests and is also useful for Scale-Out File Server scenarios.

啟用 CSV 快取減少可對執行 Vm 超收斂叢集,因此您必須以平衡儲存效能與記憶體 Vhd 可用的記憶體數量。Enabling the CSV cache reduces the amount of memory available to run VMs on a hyper-converged cluster, so you'll have to balance storage performance with memory available to VHDs.

若要設定 CSV 快取的大小,開啟 PowerShell 工作階段管理系統上的對儲存叢集中的管理員權限的帳戶然後再使用此指令碼變更$ClusterName$CSVCacheSize視變數 (本範例會設定2 GB CSV 快取每部伺服器):To set the size of the CSV cache, open a PowerShell session on the management system with an account that has administrator permissions on the storage cluster, and then use this script, changing the $ClusterName and $CSVCacheSize variables as appropriate (this example sets a 2 GB CSV cache per server):

$ClusterName = "StorageSpacesDirect1"
$CSVCacheSize = 2048 #Size in MB

Write-Output "Setting the CSV cache..."
(Get-Cluster $ClusterName).BlockCacheSize = $CSVCacheSize

$CSVCurrentCacheSize = (Get-Cluster $ClusterName).BlockCacheSize
Write-Output "$ClusterName CSV cache size: $CSVCurrentCacheSize MB"

如需詳細資訊,請參閱使用 CSV 在記憶體中讀取快取For more info, see Using the CSV in-memory read cache.

步驟 3.8: 部署超收斂部署的虛擬機器Step 3.8: Deploy virtual machines for hyper-converged deployments

如果您正在部署超收斂叢集,最後一個步驟是佈建虛擬機器儲存空間直接叢集上。If you're deploying a hyper-converged cluster, the last step is to provision virtual machines on the Storage Spaces Direct cluster.

虛擬機器的檔案應該儲存在系統的 CSV 命名空間 (範例︰c:\ClusterStorage\Volume1),就像叢集容錯移轉叢集上的叢集 VM。The virtual machine's files should be stored on the systems CSV namespace (example: c:\ClusterStorage\Volume1) just like clustered VMs on failover clusters.

您可以使用 [回工具或其他工具來管理儲存空間和虛擬機器,例如 System Center 虛擬機器 Manager。You can use in-box tools or other tools to manage the storage and virtual machines, such as System Center Virtual Machine Manager.

步驟 4: 交集的解決方案部署向外延展檔案伺服器Step 4: Deploy Scale-Out File Server for converged solutions

如果您正在部署交集的解決方案下, 一步是建立向外延展檔案伺服器執行個體和安裝某些檔案共用。If you're deploying a converged solution, the next step is to create a Scale-Out File Server instance and setup some file shares. 如果您正在部署超收斂叢集-您完成作業後,所以不需要這一節。If you're deploying a hyper-converged cluster - you're finished and don't need this section.

步驟 4.1: 建立向外延展檔案伺服器角色Step 4.1: Create the Scale-Out File Server role

設定您的檔案伺服器的叢集服務的下一個步驟建立叢集的檔案伺服器角色,這是當您建立在其主辦持續可用的檔案共用的向外延展檔案伺服器執行個體。The next step in setting up the cluster services for your file server is creating the clustered file server role, which is when you create the Scale-Out File Server instance on which your continuously available file shares are hosted.

使用 [伺服器管理員建立一個向外延展檔案伺服器角色To create a Scale-Out File Server role by using Server Manager

  1. 在容錯移轉叢集管理員中,選取 [叢集、 移至 [角色] 和 [設定角色...In Failover Cluster Manager, select the cluster, go to Roles, and then click Configure Role….
    高可用性精靈] 隨即顯示。The High Availability Wizard appears.
  2. 在 [選取角色] 頁面上按一下 [檔案伺服器On the Select Role page, click File Server.
  3. 在 [檔案伺服器類型] 頁面上按一下 [應用程式資料的向外延展檔案伺服器On the File Server Type page, click Scale-Out File Server for application data.
  4. 在 [用戶端存取點] 頁面上,輸入向外延展檔案伺服器的名稱。On the Client Access Point page, type a name for the Scale-Out File Server.
  5. 確認角色已成功設定移至角色並確認 [狀態] 欄顯示執行旁的叢集的檔案伺服器角色所建立,如圖 2 所示。Verify that the role was successfully set up by going to Roles and confirming that the Status column shows Running next to the clustered file server role you created, as shown in Figure 2.

    容錯移轉叢集管理員顯示比例為 #45 ; 取出檔案伺服器Failover Cluster Manager showing the Scale-Out File Server

    圖 2容錯移轉叢集管理員顯示向外延展檔案伺服器與執行狀態Figure 2 Failover Cluster Manager showing the Scale-Out File Server with the Running status

注意

建立叢集的角色之後, 可能會有一些網路無法防止建立檔案共用上的幾分鐘,或可能會較長的傳播延遲。After creating the clustered role, there might be some network propagation delays that could prevent you from creating file shares on it for a few minutes, or potentially longer.

若要使用 Windows PowerShell 建立向外延展檔案伺服器角色To create a Scale-Out File Server role by using Windows PowerShell

在連接至 [檔案伺服器叢集的 Windows PowerShell 工作階段中輸入下列命令向外延展檔案伺服器角色、 變更FSCLUSTER以符合您叢集的名稱及SOFS以符合名稱以建立您想要授與向外延展檔案伺服器角色:In a Windows PowerShell session that's connected to the file server cluster, enter the following commands to create the Scale-Out File Server role, changing FSCLUSTER to match the name of your cluster, and SOFS to match the name you want to give the Scale-Out File Server role:

Add-ClusterScaleOutFileServerRole -Name SOFS -Cluster FSCLUSTER

注意

建立叢集的角色之後, 可能會有一些網路無法防止建立檔案共用上的幾分鐘,或可能會較長的傳播延遲。After creating the clustered role, there might be some network propagation delays that could prevent you from creating file shares on it for a few minutes, or potentially longer. 如果 SOFS 角色立即失敗且不會在開始,則可能是因為叢集的電腦物件都不會有建立 SOFS 角色的電腦帳戶的權限。If the SOFS role fails immediately and won't start, it might be because the cluster's computer object doesn't have permission to create a computer account for the SOFS role. 為協助該,請參閱此部落格文章:向外延展檔案伺服器角色失敗 To Start With 事件識別碼 1205、 1069 及 1194年For help with that, see this blog post: Scale-Out File Server Role Fails To Start With Event IDs 1205, 1069, and 1194.

步驟 4.2: 建立檔案共用Step 4.2: Create file shares

您已建立您的虛擬磁碟並加入 CSVs 之後,它會是建立時間檔案共用上加以-每 CSV 每部虛擬磁碟的一個檔案共用。After you've created your virtual disks and added them to CSVs, it's time to create file shares on them - one file share per CSV per virtual disk. System Center 虛擬機器 Manager (VMM) 可能是因為它會處理權限,但如果您沒有其環境中,您可以使用 Windows PowerShell 部分自動化部署執行這項作業的 handiest 方式。System Center Virtual Machine Manager (VMM) is probably the handiest way to do this because it handles permissions for you, but if you don't have it in your environment, you can use Windows PowerShell to partially automate the deployment.

使用包含在HYPER-V 工作負載的 SMB 共用設定指令碼部分自動化程序建立群組與共用的指令碼。Use the scripts included in the SMB Share Configuration for Hyper-V Workloads script, which partially automates the process of creating groups and shares. 此處所列的 HYPER-V 工作量,因此如果您正在部署其他工作負載,您可能必須修改設定或後建立共用執行額外的步驟。It's written for Hyper-V workloads, so if you're deploying other workloads, you might have to modify the settings or perform additional steps after you create the shares. 例如,如果您使用 Microsoft SQL Server、 SQL Server 服務帳戶必須授與共用和檔案系統完全控制權限。For example, if you're using Microsoft SQL Server, the SQL Server service account must be granted full control on the share and the file system.

注意

您必須更新除非您使用 System Center 虛擬機器管理員建立您共用新增叢集節點時的群組成員資格。You'll have to update the group membership when you add cluster nodes unless you use System Center Virtual Machine Manager to create your shares.

若要使用 PowerShell 指令碼建立檔案共用,執行下列動作:To create file shares by using PowerShell scripts, do the following:

  1. 下載指令碼包含在HYPER-V 工作負載的 SMB 共用設定為其中一個檔案伺服器叢集的節點。Download the scripts included in SMB Share Configuration for Hyper-V Workloads to one of the nodes of the file server cluster.
  2. 開啟 Windows PowerShell 工作階段使用網域系統管理員認證管理系統上,然後使用下列指令碼來建立 Active Directory 群組 HYPER-V 電腦物件,變更為適用於變數的值在環境:Open a Windows PowerShell session with Domain Administrator credentials on the management system, and then use the following script to create an Active Directory group for the Hyper-V computer objects, changing the values for the variables as appropriate for your environment:

    # Replace the values of these variables
    $HyperVClusterName = "Compute01"
    $HyperVObjectADGroupSamName = "Hyper-VServerComputerAccounts" <#No spaces#>
    $ScriptFolder = "C:\Scripts\SetupSMBSharesWithHyperV"
    
    # Start of script itself
    CD $ScriptFolder
    .\ADGroupSetup.ps1 -HyperVObjectADGroupSamName $HyperVObjectADGroupSamName -HyperVClusterName $HyperVClusterName
    
  3. 開啟 Windows PowerShell 工作階段與在其中儲存節點上的系統管理員認證,然後使用下列指令碼來建立共用的每一個 CSV 和系統管理共用權限授與 Domain Admins 群組和電腦叢集。Open a Windows PowerShell session with Administrator credentials on one of the storage nodes, and then use the following script to create shares for each CSV and grant administrative permissions for the shares to the Domain Admins group and the compute cluster.

    # Replace the values of these variables
    $StorageClusterName = "StorageSpacesDirect1"
    $HyperVObjectADGroupSamName = "Hyper-VServerComputerAccounts" <#No spaces#>
    $SOFSName = "SOFS"
    $SharePrefix = "Share"
    $ScriptFolder = "C:\Scripts\SetupSMBSharesWithHyperV"
    
    # Start of the script itself
    CD $ScriptFolder
    Get-ClusterSharedVolume -Cluster $StorageClusterName | ForEach-Object
    {
        $ShareName = $SharePrefix + $_.SharedVolumeInfo.friendlyvolumename.trimstart("C:\ClusterStorage\Volume")
        Write-host "Creating share $ShareName on "$_.name "on Volume: " $_.SharedVolumeInfo.friendlyvolumename
        .\FileShareSetup.ps1 -HyperVClusterName $StorageClusterName -CSVVolumeNumber $_.SharedVolumeInfo.friendlyvolumename.trimstart("C:\ClusterStorage\Volume") -ScaleOutFSName $SOFSName -ShareName $ShareName -HyperVObjectADGroupSamName $HyperVObjectADGroupSamName
    }
    

步驟 4.3 啟用 Kerberos 限制委派Step 4.3 Enable Kerberos constrained delegation

若要設定 Kerberos 限制的委派的遠端案例管理和增加 Live 移轉安全性,從儲存叢集節點,其中會使用包含在HYPER-V 工作負載的 SMB 共用設定KCDSetup.ps1 指令碼。To setup Kerberos constrained delegation for remote scenario management and increased Live Migration security, from one of the storage cluster nodes, use the KCDSetup.ps1 script included in SMB Share Configuration for Hyper-V Workloads. 以下是一點的包裝函式指令碼:Here's a little wrapper for the script:

$HyperVClusterName = "Compute01"
$ScaleOutFSName = "SOFS"
$ScriptFolder = "C:\Scripts\SetupSMBSharesWithHyperV"

CD $ScriptFolder
.\KCDSetup.ps1 -HyperVClusterName $HyperVClusterName -ScaleOutFSName $ScaleOutFSName -EnableLM

後續步驟Next steps

部署叢集的檔案 server 之後,建議您先測試您的解決方案使用之前將引進向上任何真實的工作量的綜合工作負載的效能。After deploying your clustered file server, we recommend testing the performance of your solution using synthetic workloads prior to bringing up any real workloads. 這可讓您確認解決方案正常執行,而且運作出所有延遲的問題之前新增工作負載的複雜性。This lets you confirm that the solution is performing properly and work out any lingering issues before adding the complexity of workloads. 如需詳細資訊,請參閱測試儲存空格效能使用綜合工作負載For more info, see Test Storage Spaces Performance Using Synthetic Workloads.

請參閱See also