在 SharePoint Server 中管理索引元件Manage the index component in SharePoint Server

摘要:了解如何及何時使用 Windows PowerShell,藉由新增索引元件以建立其他的索引複本或索引分割區,在 SharePoint Server 中擴充搜尋索引。Summary: Learn how and when to use Windows PowerShell to scale out the search index in SharePoint Server by adding an index component to create an additional index replica or index partition.

本文中的程序和範例假設已安裝 SharePoint Server 和 Search Service 應用程式,並具有現有的搜尋拓撲,同時 SharePoint Server 搜尋索引中也有項目。如果 SharePoint Server 和 Search Service 應用程式是新安裝的,且 SharePoint Server 搜尋索引中沒有內容,請依照<變更 SharePoint Server 中的預設搜尋拓撲>中所述的程序來擴充搜尋拓撲。The procedures and the examples in this article assume that SharePoint Server and the Search service application are installed, that there is an existing search topology and that there are items in the SharePoint Server search index. If SharePoint Server and the Search service application are newly installed and there is no content in the SharePoint Server search index, follow the procedures outlined in Change the default search topology in SharePoint Server to scale out the search topology.

本文中的程序適用於索引元件。如需如何管理分析處理元件、內容處理元件、編目元件、搜尋管理元件和查詢處理元件的資訊,請參閱<在 SharePoint Server 中管理搜尋元件>。The procedures in this article apply to the index component. For information about how to manage the analytics processing component, the content processing component, the crawl component, the search administration component and the query processing component, see Manage search components in SharePoint Server.

使用索引元件 PowerShell Cmdlet (New-SPEnterpriseSearchIndexComponent) 可同時管理索引分割區和索引複本。搜尋拓撲中每個索引元件都代表一個索引複本。You use the index component PowerShell cmdlet (New-SPEnterpriseSearchIndexComponent) to manage both index partitions and index replicas. Each index component in the search topology represents an index replica.

您可將搜尋索引分割成不連續的部分,即稱為 索引分割區 。每個索引分割區會在本機磁碟上儲存為一組檔案。如果要 擴充 搜尋索引,可以新增索引分割區。You divide the search index into discrete portions called index partitions. Each index partition is stored as a set of files on a local disk. To scale out the search index, you add a new index partition.

如果要讓 SharePoint Server 搜尋索引具備 容錯 的功能,您可以將現有索引分割區的索引複本新增至搜尋拓撲。每個索引複本均包含相同的資訊。To achieve fault tolerance for the SharePoint Server search index, you add an index replica of an existing index partition to the search topology. Each index replica contains the same information.

開始之前Before you begin

開始之前,請先檢閱下列必要條件。Before you begin, review the following prerequisites.

  • 已安裝 SharePoint Server,並已建立具備搜尋拓撲的 Search Service 應用程式。SharePoint Server is installed and a Search service application with a search topology is created.

  • 正在執行本文中程序的使用者帳戶是 伺服器陣列管理員 群組的成員。The user account that is performing the procedures in this article is a member of the Farm Administrators group.

  • 您已規劃目標搜尋拓樸,並已規劃要裝載索引分割區和索引複本的伺服器。You have planned a target search topology and have planned on which servers that you want to host the index partitions and the index replicas.

  • SharePoint Server 已安裝在您希望用於主控索引元件的所有伺服器上。您可以在現有部署中建立新的應用程式伺服器或定義應用程式伺服器。這些伺服器已新增至伺服器陣列,而您是所有這些伺服器的管理員。SharePoint Server is installed on all the servers that you want to host index components on. You can create new application servers or define application servers in an existing deployment. The servers are added to the farm and you are an administrator on all these servers.

新增索引複本至現有的索引分割區Add an index replica to an existing index partition

新增索引複本至搜尋拓撲可讓現有的索引分割區具備容錯的功能。將索引複本放置在個別伺服器上的個別失敗網域中。當您新增索引複本時,會將新的索引元件新增至搜尋拓撲,並與您想要製作複本的索引分割區建立關聯。You add an index replica to the search topology to achieve fault tolerance for an existing index partition. You place the index replicas on separate failure domains on separate servers. When you add an index replica, you add a new index component to the search topology and associate it with the index partition that you want to make a replica of.

重要

[!重要事項] 此程序使用 Microsoft PowerShell。您可以在伺服器陣列中的任何伺服器上執行 Microsoft PowerShell 命令。然而,在此程序中,您應該對所有的 Microsoft PowerShell 命令使用相同的 SharePoint 管理命令介面,才能夠在命令之間共用 Microsoft PowerShell 物件參照。This procedure uses Microsoft PowerShell. You can run the Microsoft PowerShell commands on any server in the farm. However, you should use the same SharePoint Management Shell for all Microsoft PowerShell commands in this procedure so that you can share Microsoft PowerShell object references between commands.

新增索引複本To add an index replica

  1. 確認執行此程序的使用者帳戶為伺服器陣列管理員群組的成員。Verify that the user account that is performing this procedure is a member of the Farm Administrators group.

  2. 在伺服器陣列中的其一伺服器上啟動 SharePoint 管理命令介面。Start a SharePoint Management Shell on one of the servers in the farm.

  3. 在您希望建立索引複本的伺服器上啟動 Search Service 執行個體,並建立 Search Service 執行個體識別碼的參照。在 Microsoft PowerShell 命令提示字元處,輸入下列命令:Start a search service instance on the server that you want to create the index replica on and create a reference to the search service instance Id. At the Microsoft PowerShell command prompt, type the following command(s):

    $<host n > = Get-SPEnterpriseSearchServiceInstance -Identity "<Server name>"
    Start-SPEnterpriseSearchServiceInstance -Identity $<host n >
    

    其中:Where:

    • $<主機 n> 指定 Search Service 執行個體的 PowerShell 物件參照。$<host n> specifies the PowerShell object reference for the search service instance.

    • <伺服器名稱> 指定您要新增索引元件的伺服器。輸入必須是 12345678-90ab-cdef-1234-567890bcdefgh 格式的有效 GUID;有效的伺服器名稱 (例如 myserver1 );或有效 SearchServiceInstance 物件的執行個體。<Server name> specifies the server on which you want to add an index component. The input must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a server (for example, myserver1 ); or an instance of a valid SearchServiceInstance object.

    例如:For example:

    $hostA = Get-SPEnterpriseSearchServiceInstance -Identity "myserver1"
    Start-SPEnterpriseSearchServiceInstance -Identity $hostA
    
  4. 請稍候,直到 Search Service 執行個體已在執行中。在 Microsoft PowerShell 命令提示字元處輸入下列命令,直到該命令傳回 連線 狀態:Wait until the search service instance is running. At the Microsoft PowerShell command prompt, type the following command until the command returns the status Online:

    Get-SPEnterpriseSearchServiceInstance -Identity $<host n >
    
  5. 複製使用中的搜尋拓撲。在 Microsoft PowerShell 命令提示字元處,輸入下列命令:Clone the active search topology. At the Microsoft PowerShell command prompt, type the following command(s):

    $ssa = Get-SPEnterpriseSearchServiceApplication
    $active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
    $clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone -SearchTopology $active
    
  6. 新增索引元件並與分割區建立關聯。在 Windows PowerShell 命令提示字元處,輸入下列命令:Add a new index component and associate it with a partition. At the Windows PowerShell command prompt, type the following command(s):

    New-SPEnterpriseSearchIndexComponent -SearchTopology $clone -SearchServiceInstance <host n > -IndexPartition <Index partition number>
    

    其中:Where:

    • $clone 是要變更的複製拓撲。$clone is the cloned topology that you are changing.

    • $<主機 n> 是正在您希望新增索引複本的伺服器上執行的 Search Service 執行個體的 PowerShell 物件參照。$<host n> is the PowerShell object reference to the running search service instance on the server that you want to add the index replica to.

    • <索引分割編號> 是您正在建立複本的現有索引分割區的數目。例如,如果要建立索引分割區 0 的索引複本,請選擇 "0" 作為參數值。<Index partition number> is the number of the existing index partition that you are creating a replica of. For example, to create an index replica of index partition 0, choose "0" as the parameter value.

    例如:For example:

    New-SPEnterpriseSearchIndexComponent -SearchTopology $clone -SearchServiceInstance $hostA -IndexPartition 0
    
  7. 啟用複製拓撲。在 Microsoft PowerShell 命令提示字元處,輸入下列命令:Activate the clone topology. At the Microsoft PowerShell command prompt, type the following command(s):

    Set-SPEnterpriseSearchTopology -Identity $clone
    
  8. 確認已啟用新的拓撲,並已新增代表新索引複本的索引元件。在 Microsoft PowerShell 命令提示字元處,輸入下列命令:Verify that your new topology is active and that the index component representing the new index replica is added. At the Microsoft PowerShell command prompt, type the following command(s):

    Get-SPEnterpriseSearchTopology -Active -SearchApplication $ssa
    
  9. 監視現有索引散佈至新複本的情況。在散佈完成前,新增的索引複本將處於 降級 狀態。在 Microsoft PowerShell 命令提示字元處,輸入下列命令:Monitor the distribution of the existing index to the new replica. The added index replica will have the state Degraded until the distribution is finished. At the Microsoft PowerShell command prompt, type the following command(s):

    Get-SPEnterpriseSearchStatus -SearchApplication $ssa -Text
    

    重複此命令直到所有搜尋元件 (包括新的索引元件) 輸出 使用中 狀態為止。若是大型的搜尋索引,這項作業可能需要數小時才能完成。Repeat this command until all search components, including the new index component, output the state Active. For a large search index, this could take several hours.

新增索引分割區Add a new index partition

當您新增索引分割區時,必須重新分割搜尋索引。這項重新分割作業可能需要數小時才能完成,視搜尋索引的大小而定。When you add a new index partition, the search index has to be repartitioned. Depending on the size of the search index, this repartitioning can take several hours to complete.

若要新增索引分割區及重新分割搜尋索引,請將新的索引元件新增至搜尋拓撲,並建立此索引元件與新的索引分割區號碼的關聯。新增索引分割區和重新分割搜尋索引應該以不同的處理程序另行初始化,且不得在您對搜尋拓撲做其他變更時進行初始化。To add an index partition and repartition the search index, you add a new index component to the search topology and associate this index component with a new index partition number. Adding an index partition and repartitioning the search index should be initiated as a separate process and should not be initiated while you are making other changes to the search topology.

您必須新增與您現有的分割區數目相同的索引複本至新的索引分割區。You must add the same number of index replicas to the new index partition as you have for your existing partitions.

在新增索引分割區至搜尋拓撲並開始重新分割搜尋索引之前:Before you add a new index partition to the search topology and start repartitioning the search index:

  • 備份 Search Service 應用程式和現有的搜尋索引。請參閱<在 SharePoint Server 中備份 Search Service 應用程式>。Back up the Search service application and the existing search index. See Back up Search service applications in SharePoint Server.

  • 確認目前使用中的拓撲狀況良好。在管理中心中的 [搜尋管理] 頁面檢視搜尋拓撲的狀態,或執行 Microsoft PowerShell Cmdlet Get-SPEnterpriseSearchStatusMake sure that the current active topology is healthy. View the status of the search topology in the Search Administration page in Central Administration or run the Microsoft PowerShell cmdlet Get-SPEnterpriseSearchStatus.

  • 確定在您要新增索引分割區的伺服器上,有足夠的磁碟空間可用。Make sure that there is sufficient disk space available on the server where you will be adding the index partition.

警告

[!注意] Search Service 應用程式在索引重新分割期間會暫停,且無法對內容進行編目或編製索引。此外,使用者也將無法執行查詢。The Search service application is paused during index repartitioning and cannot crawl or index content. Also, users will not be able to run queries.

新增索引分割區To add an index partition

  1. 確認執行此程序的使用者帳戶為伺服器陣列管理員群組的成員。Verify that the user account that is performing this procedure is a member of the Farm Administrators group.

  2. 在伺服器陣列中的其一伺服器上啟動 SharePoint 管理命令介面。Start a SharePoint Management Shell on one of the servers in the farm.

  3. 在您希望為新的索引分割區新增索引複本的所有伺服器上啟動 Search Service 執行個體,並建立程序中稍後要使用的 Search Service 執行個體的 PowerShell 物件參照。針對每部伺服器,在 Microsoft PowerShell 命令提示字元處,輸入下列命令:Start a search service instance on all the servers where you want to add an index replica for the new index partition. You create a PowerShell object reference to the search service instance that is used later in the procedure. For each server, at the Microsoft PowerShell command prompt, type the following command(s):

    $<host n > = Get-SPEnterpriseSearchServiceInstance -Identity "<Server name>"
    Start-SPEnterpriseSearchServiceInstance -Identity $<host n >
    

    其中:Where:

    • <主機 n> 指定 Search Service 執行個體的 PowerShell 物件參照。<host n> specifies the PowerShell object reference for the search service instance.

    • <伺服器名稱> 指定您要新增索引元件的伺服器。輸入必須是 12345678-90ab-cdef-1234-567890bcdefgh 格式的有效 GUID;有效的伺服器名稱 (例如 myserver1 );或有效 SearchServiceInstance 物件的執行個體。<Server name> specifies the server on which you want to add an index component. The input must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a server (for example, myserver1 ); or an instance of a valid SearchServiceInstance object.

    例如:For example:

    $hostC = Get-SPEnterpriseSearchServiceInstance -Identity "myserver3"
    Start-SPEnterpriseSearchServiceInstance -Identity $hostC
    $hostD = Get-SPEnterpriseSearchServiceInstance -Identity "myserver4"
    Start-SPEnterpriseSearchServiceInstance -Identity $hostD
    
  4. 請稍候,直到 Search Service 執行個體均在執行中。針對每部伺服器,在 Microsoft PowerShell 命令提示字元處輸入下列命令,直到該命令傳回 連線 狀態:Wait until the search service instances are running. For each server, at the Microsoft PowerShell command prompt, type the following command until the command returns the status Online:

    Get-SPEnterpriseSearchServiceInstance -Identity $<host n >
    
  5. 複製使用中的搜尋拓撲。在 Microsoft PowerShell 命令提示字元處,輸入下列命令:Clone the active search topology. At the Microsoft PowerShell command prompt, type the following command(s):

    $ssa = Get-SPEnterpriseSearchServiceApplication
    $active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
    $clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone -SearchTopology $active
    

    此命令會建立可使用 $clone 參照的複製搜尋拓撲,並傳回複製拓撲的相關資訊。記下複製拓撲的拓撲識別碼,以供您在必須取消重新分割程序時使用。The command creates a clone search topology that can be referenced with $clone and returns information about the clone topology. Make a note of the topology Id of the cloned topology, in case you have to cancel the repartitioning process.

  6. 新增一個或多個索引元件並建立與新索引分割區的關聯,以新增索引分割區。建議您為新的索引分割區建立與您現有的分割區數目相同的索引複本。針對每個新的索引元件,在 Windows PowerShell 命令提示字元處,輸入下列命令:Add a new index partition by adding one or more index components and associate them with the new index partition. We recommend that you create the same number of index replicas for the new index partition as you have for the existing partitions. For each new index component, at the Windows PowerShell command prompt, type the following command(s):

    New-SPEnterpriseSearchIndexComponent -SearchTopology $clone -SearchServiceInstance <host n > -IndexPartition <Index partition number>
    

    其中:Where:

    • $clone 是要變更的複製拓撲。$clone is the cloned topology that you are changing.

    • $<主機 n> 指定 Search Service 執行個體的 PowerShell 物件參照。$<host n> specifies the PowerShell object reference for the search service instance.

    • <索引分割編號> 是您正在建立的索引分割區的數目。依預設,您有一個稱為索引分割區 0 的索引分割區。如果您想要建立新的索引分割區,請輸入 IndexPartition 參數值 1,接著是 2,然後是 3,依此類推。<Index partition number> is the number of the index partition that you are creating. By default, you have one index partition, which is called index partition 0. If you want to create a new index partition, enter the IndexPartition parameter value 1, followed by 2, then 3 and so forth.

    例如,如果您現有的索引分割區 0 在主機 A 和主機 B 上有索引複本,而您想要新增在主機 C 和主機 D 上有索引複本的索引分割區:For example, if you have an existing index partition 0 with index replicas on Host A and Host B, and you want to add a new index partition with index replicas on Host C and Host D:

    New-SPEnterpriseSearchIndexComponent -SearchTopology $clone -SearchServiceInstance $hostC -IndexPartition 1
    New-SPEnterpriseSearchIndexComponent -SearchTopology $clone -SearchServiceInstance $hostD -IndexPartition 1
    
  7. 請確認 Search Service 應用程式正在執行。在 Microsoft PowerShell 命令提示字元處,輸入下列命令:Verify that the Search service application is running. At the Microsoft PowerShell command prompt, type the following command(s):

    $ssa.IsPaused() -ne 0
    
    • 若此命令傳回 False ,則 Search Service 應用程式正在執行。請繼續前往步驟 9。If this command returns False, the Search service application is running. Continue with step 9.

    • 若此命令傳回 True ,則 Search Service 應用程式已暫停。請繼續前往步驟 8。If this command returns True, the Search service application is paused. Continue with step 8.

  8. 如果 Search Service 應用程式已暫停,請了解原因並探究是否必須先等待任何作業完成,再繼續前往步驟 9。如需詳細資訊,請參閱在 SharePoint Server 中管理已暫停的 Search Service 應用程式If the Search service application is paused, find out why and if you have to wait for any operation to complete before you can continue with step 9. See Manage a paused Search service application in SharePoint Server for more information.

  9. 開始啟用複製的拓撲。這將會開始啟用包含與新索引分割區有關聯的新索引複本的拓撲,並且啟動索引重新分割程序。Start the activation of the clone topology. This will start the activation of the topology that includes the new index replicas associated with the new index partition. This will start the index repartitioning process.

    重要

    Search Service 應用程式在索引重新分割期間會暫停,且無法對內容進行編目或編製索引。此外,使用者也將無法執行查詢。您將無法存取執行啟用命令的 Windows PowerShell 主控台。The Search service application is paused during index repartitioning and cannot crawl or index content. Also, users will not be able to run queries. You will not be able to access the Windows PowerShell console where the activation command runs.

    注意

    管理中心的「搜尋管理」頁面不會顯示,因為 Search Service 應用程式已由於索引重新分割而暫停。然而,由於當您為了重新分割而暫停 Search Service 應用程式時,所有的查詢處理元件都會暫停,因此「搜尋管理」頁面會顯示此程序進行期間查詢處理元件的錯誤。The Search Administration page in Central Administration does not show that the Search service application has been paused for index repartitioning. However, because all query processing components are suspended when you pause the Search service application for repartitioning, the Search administration page will show errors for the query processing components during this process.

    在 Windows PowerShell 命令提示字元處,輸入下列命令:At the Windows PowerShell command prompt, type the following command(s):

    $ssa.PauseForIndexRepartitioning()
    Set-SPEnterpriseSearchTopology -Identity $clone
    
  10. 監視索引重新分割程序的進度。您只能監視現有拓撲的主要索引元件的重新分割程序進度。下列步驟顯示如何找出主要索引元件。Monitor the progress of the index repartitioning process. You can only monitor the progress of the repartitioning process on the primary index components of the existing topology. The following steps show you how to find the primary index components.

    注意

    [!附註] 您將無法在現有的 SharePoint 管理命令介面中執行任何命令,直到拓撲啟用 (包括索引重新分割程序) 完成為止。請在第二個 SharePoint 管理命令介面中執行下列命令。You will not be able to run any commands in the existing SharePoint Management Shell until the topology activation, including the index repartitioning process, is finished. Run the following commands in a second SharePoint Management Shell.

    • 啟動第二個 SharePoint 管理命令介面。Start a second SharePoint Management Shell.

    • 尋找每個現有索引分割區的主要索引複本。在第二個 SharePoint 管理命令介面的 Windows PowerShell 命令提示字元處,輸入下列命令:Find the primary index replica for each of the existing index partitions. At the Windows PowerShell command prompt of the second SharePoint Management Shell, type the following command(s):

    $ssa = Get-SPEnterpriseSearchServiceApplication
    Get-SPEnterpriseSearchStatus -SearchApplication $ssa -Text
    

    該命令會傳回索引元件與其屬性的清單。請記下主要索引元件的名稱。這些是屬性為 Primary: True 的索引元件。The command returns a list of index components and their properties. Make a note of the names of the primary index component(s). These are the index components that have the property Primary: True.

    例如,輸出可能類似這樣。在此範例中,IndexComponent2 是主要索引元件:For example, the output could look like this. In this example, IndexComponent2 is the primary index component:

    Name      : IndexComponent1
    State     : Active
    Primary   : False
    Partition : 0
    Host      : MyMachine1
    Name      : Cell:IndexComponent1-SPd32cdffb08a2I.0.0
    State     : Active
    Primary   : False
    Partition : 0
    Name      : IndexComponent2
    State     : Active
    Primary   : True
    Partition : 0
    Host      : MyMachine2
    Name      : Cell:IndexComponent2-SPd32cdffb08a2I.1.0
    State     : Active
    Primary   : True
    Partition : 0
    
  11. 針對每個主要索引元件,監視索引重新分割程序。在第二個 SharePoint 管理命令介面的 Windows PowerShell 命令提示字元處,輸入下列命令:For each primary index component, monitor the index repartitioning progress. At the Windows PowerShell command prompt of the second SharePoint Management Shell, type the following command(s):

    Get-SPEnterpriseSearchStatus -SearchApplication $ssa -Healthreport -Component <Index component name> | ? { ($_.name -match "repart") -or ( $_.name -match "splitting") } | ft -AutoSize Name, Message
    

    其中:Where:

    • <索引元件名稱> 是您想要監視進度的主要索引元件名稱,例如 IndexComponent2<Index component name> is the name of the primary index component that you want to monitor the progress of, for instance IndexComponent2.

    監視每個主要索引元件的命令輸出。該命令的輸出包含重新分割索引的相關進度資訊。Monitor the output of the command for each primary index component. The output of the command contains progress information about the repartitioning of the index.

    在索引重新分割程序的初始階段,輸出可能類似如下:During the initial phase of the index repartitioning process, the output will look something like this:

    Name                                              Message
    ----                                              -------
    repartition_component_state[SP...]                Pending
    

    在索引重新分割程序的主要階段,會對索引分割區進行分割。在這個階段,輸出可能類似如下:The index partitions are split during the main phase of the index repartitioning process. During this phase, the output will look something like this:

    Name                                              Message
    ----                                              -------
    index splitting: current fusion progress[SP...]   <Percentage value>
    index splitting: splitting state [SP...]          Index splitter running fusion, building: <Folder>
    repartition_component_state [SP...]               Splitting
    

    輸出中的百分比值表示重新分割程序的概略進度。The percentage value in the output indicates the approximate progress of the repartitioning process.

    針對所有的主要索引元件重複此命令,直到命令的輸出不再傳回任何值為止。這表示索引重新分割程序已完成,而且重新分割的索引現在會在伺服器上進行複製及散佈。這項作業可能需要數小時才能完成。Repeat this command for all primary index components until the output of the commands no longer returns any values. That means that the index repartitioning process has completed and that the repartitioned index will now be replicated and distributed over the servers. This could take several hours.

  12. 監視索引散佈至新索引複本的進度。若要執行這項操作,請確認已啟用新的拓撲,且所有搜尋元件的狀況良好。在第二個 SharePoint 管理命令介面的 Windows PowerShell 命令提示字元處,輸入下列命令:Monitor the progress of the distribution of the index to the new index replicas. To do this, verify that your new topology is active, and that all search components are healthy. At the Windows PowerShell command prompt of the second SharePoint Management Shell, type the following command(s):

    Get-SPEnterpriseSearchStatus -SearchApplication $ssa | ft -AutoSize Name, State, Details
    

    在索引散佈至新索引複本期間,新增的索引複本會傳回 降級 狀態。當所有索引元件在輸出中傳回 使用中 狀態時,散佈即完成。這項作業可能需要數小時才能完成。During the distribution of the index to the new index replicas, the added index replicas will return the state Degraded. The distribution is finished when all index components return the state Active in the output. This could take several hours.

    注意

    由於您已為了索引重新分割而暫停 Search Service 應用程式,因此查詢處理元件也會暫停。在輸出中,所列出的查詢處理元件將處於 不明 狀態。The query processing components are suspended because you have paused the Search service application for index repartitioning. In the output, the query processing components will be listed with the state Unknown.

  13. 在您用於啟動拓撲啟用程序的 SharePoint 管理命令介面中,確認搜尋拓撲啟用命令已完成。In the SharePoint Management Shell that you used to start the topology activation process, verify that the search topology activation command has completed.

  14. (選用) 在重新分割之前,先重新啟動代管索引元件 (代表主要索引複本或任何其他索引複本) 的所有伺服器提供的 SharePoint 搜尋主機控制器服務。(Optional) Restart the SharePoint Search Host Controller service on all the servers that hosted index components (representing a primary index replica or any other index replica) prior to the repartitioning.

    執行此步驟,以便在重新分割搜尋索引後取得正確的文件數並釋出記憶體。若決定不執行此步驟,經過數日和重複索引之後,記憶體使用量也會逐漸減少,文件數 (由 PowerShell Cmdlet 傳回且位於管理中心的「搜尋管理」頁面) 將會是正確的。Perform this step to get a correct document count and free up memory after repartitioning the search index. If you decide not to perform this step, it will take a few days and some indexing iterations for the memory usage to be gradually reduced and the document count (as returned by PowerShell cmdlets and in the Search Administration page in Central Administration) to be correct.

    注意

    [!附註] 為避免查詢中斷,在您重新啟動 SharePoint 搜尋主機控制器服務之前,請先確定針對每個索引分割區,至少有一個索引元件傳回 執行中 狀態。To avoid query outages, ensure that at least one index component returns the state Running for each index partition before you restart the SharePoint Search Host Controller service.

    重要

    [!重要事項] 請勿在 SharePoint Server 管理中心網站上使用 [伺服器上的服務] 頁面重新啟動此服務。Do not use the Services on Server page on the SharePoint Server Central Administration Web site to restart this service.

    • 如果要重新啟動 SharePoint 搜尋主機控制器,在每部主控現有索引分割區之索引元件的伺服器上,開啟命令提示字元視窗。To restart the SharePoint Search Host Controller, open a command prompt window on each of the servers that host index components for existing index partitions.

    • 若要停止 SharePoint 搜尋主機控制器,輸入此命令: net stop spsearchhostcontrollerTo stop the SharePoint Search Host Controller, type this command: net stop spsearchhostcontroller

    • 如果要重新啟動 SharePoint 搜尋主機控制器,輸入此命令: net start spsearchhostcontrollerTo restart the SharePoint Search Host Controller, type this command: net start spsearchhostcontroller

  15. 繼續執行 Search Service 應用程式。在 Windows PowerShell 命令提示字元處,輸入下列命令:Resume the Search service application. At the Windows PowerShell command prompt, type the following command(s):

    $ssa.ResumeAfterIndexRepartitioning()
    

取消重新分割程序Cancel the repartitioning process

如果您必須取消進行中的重新分割程序,請使用下列程序。If you have to cancel an ongoing repartitioning process, use the following procedure.

取消重新分割程序To cancel the repartitioning process

  1. 在您執行拓撲啟用命令的伺服器上,啟動新的 SharePoint 管理命令介面。Start a new SharePoint Management Shell on the server where you ran the topology activation command.

  2. 擷取啟用的拓撲識別碼。在 Windows PowerShell 命令提示字元處,輸入下列命令:Retrieve the activating topology Id. At the Windows PowerShell command prompt, type the following command(s):

    $activating = Get-SPEnterpriseSearchTopology -Identity <Id of the activating topology> -SearchApplication $ssa
    

    其中:Where:

    • <啟用的拓撲識別碼> 是您在複製搜尋拓撲時寫下的複製拓撲的身分識別 (GUID)。<Id of the activating topology> is the identity (GUID) of the clone topology that you wrote down when you cloned the search topology.
  3. 取消拓撲啟用。在 Windows PowerShell 命令提示字元處,輸入下列命令:Cancel the topology activation. At the Windows PowerShell command prompt, type the following command(s):

    $activating.CancelTopologyActivation()
    

移除索引元件Remove an index component

如果索引分割區有多個使用中索引複本,您可以執行<在 SharePoint Server 中管理搜尋元件>一文中的< 移除搜尋元件 >程序來移除索引複本。If you have more than one active index replica for an index partition, you can remove an index replica by performing the procedure Remove a search component in the article Manage search components in SharePoint Server.

您不可使用此程序來移除索引分割區的最後一個索引複本。如果必須從搜尋拓撲中移除所有的索引複本,您必須移除後再重新建立 Search Service 應用程式,然後建立索引分割區數目減少的全新搜尋拓撲。You cannot remove the last index replica of an index partition using this procedure. If you have to remove all index replicas from the search topology, you must remove and re-create the Search service application and create a completely new search topology that has the reduced number of index partitions.

移動索引元件Move an index component

如果要將索引複本從一部伺服器移動到另一部伺服器,建議您先新增索引元件至搜尋拓撲,然後再移除舊的索引元件。If you want to move an index replica from one server to another, we recommend that you add a new index component to the search topology before you remove the old index component.

移動索引元件To move an index component

  1. 新增索引元件至您想要移動索引複本的目的地伺服器。接著複製搜尋拓撲,並新增索引複本,然後等到索引複製到新的索引複本中後,再啟用搜尋拓撲。請參閱<新增索引複本至現有的索引分割區>。Add a new index component to the server that you want to move the index replica to. Clone the search topology, add a new index replica, wait for the index to be replicated to the new index replica and activate the search topology. See Add an index replica to an existing index partition.

  2. 請稍候,直到備妥新的索引複本可供查詢之用。在管理中心的「搜尋管理」頁面或執行 Windows PowerShell Cmdlet Get-SPEnterpriseSearchStatus,皆可檢視搜尋拓撲的狀態。在繼續前,您所新增的索引複本必須為 使用中Wait until the new index replica is ready to serve queries. View the status of the search topology in the Search Administration page in Central Administration or run the Windows PowerShell cmdlet Get-SPEnterpriseSearchStatus. Before you proceed, the index replica that you have added must be Active.

  3. 再次複製搜尋拓撲。Clone the search topology again.

  4. 移除索引元件以移除多餘的索引複本。請參閱<在 SharePoint Server 中管理搜尋元件>一文中的 移除搜尋元件 程序。Remove the superfluous index replica by removing the index component. See the procedure Remove a search component in the article Manage search components in SharePoint Server.

  5. 再次啟用搜尋拓撲。Activate the search topology again.

如此可在您移動索引複本時,確保搜尋索引的容錯功能。This will ensure fault tolerance of the search index while you are moving the index replica.