Add-SPDistributedCacheServiceInstance

將分散式快取服務的執行個體新增至本機伺服器。

Syntax

Add-SPDistributedCacheServiceInstance
   [-AssignmentCollection <SPAssignmentCollection>]
   [<CommonParameters>]
Add-SPDistributedCacheServiceInstance
   [-AssignmentCollection <SPAssignmentCollection>]
   [-CacheSizeInMB <Int32>]
   [<CommonParameters>]
Add-SPDistributedCacheServiceInstance
   [-AssignmentCollection <SPAssignmentCollection>]
   [-Role <SPServerRole>]
   [<CommonParameters>]

Description

此 Cmdlet 包含一個以上的參數集。 您可能只使用一個參數集中的參數,但不可以結合不同參數集的參數。 如需如何使用參數集的詳細資訊,請參閱 Cmdlet 參數集

使用 Add-SPDistributedCacheServiceInstance Cmdlet 可將分散式快取服務的執行個體新增至本機伺服器。 必須執行這個動作才能啟動 AppFabric 服務。

範例

範例 1

Add-SPDistributedCacheServiceInstance

此範例會將分散式快取服務的執行個體新增至本機伺服器。

參數

-AssignmentCollection

管理物件以適當處置它們。 使用 SPWeb 或 SPSite 等物件可能會耗用大量的記憶體,因此在 Windows PowerShell 指令碼中使用這些物件時,必須適當地管理記憶體。 您可以使用 SPAssignment 物件將物件指派給變數,並在不需要時處置這些物件,以釋放記憶體。 使用 SPWeb、SPSite 或 SPSiteAdministration 物件時,若未使用指派集合或 Global 參數,將會自動處置這些物件。

附註:使用 Global 參數時,所有物件會包含在全域儲存區內。 若未立即使用物件,或未使用 Stop-SPAssignment 命令處置物件,將會發生記憶體不足的狀況。

Type:SPAssignmentCollection
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-CacheSizeInMB

指定要配置給分散式快取服務執行個體的 RAM 數量。

若未指定此參數,則會使用預設值。

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2016, SharePoint Server 2019

-Role

指定伺服器角色類型,分散式快取服務執行個體應針對此類型進行設定。

在您要將伺服器角色轉換至指定的伺服器角色時,通常會使用這個參數。

有效的值為:

  • SingleServerFarm
  • DistributedCache
  • WebFrontEndWithDistributedCache
Type:SPServerRole
Accepted values:DistributedCache, SingleServerFarm, WebFrontEndWithDistributedCache
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2016, SharePoint Server 2019

輸入

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

輸出

System.Object