變更 SharePoint Server 中的預設搜尋拓撲Change the default search topology in SharePoint Server

摘要: 了解如何使用 Windows PowerShell,在 SharePoint Server 2016 和 SharePoint Server 2013 中將具有空白搜尋索引的預設搜尋拓撲變更為新的搜尋拓撲。Summary: Learn how to use Windows PowerShell to change from the default search topology with an empty search index in SharePoint Server 2016 and SharePoint Server 2013 to a new search topology.

本文從預設的搜尋拓樸開始,說明如何在新的搜尋拓樸中建立及啟動搜尋元件。本文中的程序和範例假設最近才安裝了 SharePoint Server 和 Search Service 應用程式,且 SharePoint Server 中沒有內容。拓樸是雲端混合式搜尋解決方案的一部分時,您也可以使用該程序和範例來管理 SharePoint Server 中的搜尋拓撲。This article explains how to create and activate search components in a new search topology starting from the default search topology. The procedures and the examples in this article assume that SharePoint Server and the Search service application are newly installed and that there is no content in the SharePoint Server search index. You can also use the procedures and examples to manage the search topology in SharePoint Server when the topology is part of a cloud hybrid search solution.

如果 SharePoint Server 搜尋索引中已有項目,請按照<在 SharePoint Server 中管理搜尋元件在 SharePoint Server 中管理索引元件>中的程序進行。If there are items in the SharePoint Server search index, follow the procedures in Manage search components in SharePoint Server and Manage the index component in SharePoint Server.

開始之前Before you begin

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

  • SharePoint Server 已安裝在單一伺服器上,且已建立含有預設搜尋拓撲的Search Service 應用程式。在預設搜尋拓撲中,所有的搜尋元件均位於主控管理中心的伺服器上。SharePoint Server is installed on a single server and a Search service application with a default search topology is created. In the default search topology, all the search components are located on the server that hosts Central Administration.

  • 您是 Search Service 應用程式的管理員。You are an administrator of the Search service application.

  • 您已經規劃好目標搜尋拓撲。在 SharePoint Server 2016 中規劃企業搜尋架構提供企業中搜尋的逐步指引 (包括硬體需求)。如需網際網路網站的範例伺服器陣列架構和搜尋拓撲,請參閱技術圖《SharePoint Server 2016 的網際網路網站搜尋架構》。針對企業中的搜尋,我們建議您根據搜尋中預期的項目數,規劃目標搜尋拓撲。You have planned a target search topology. Plan enterprise search architecture in SharePoint Server 2016 gives step-by-step guidance for search in enterprises, including hardware requirements. For example farm architectures and search topologies for Internet sites, see the technical diagram Internet sites search architectures for SharePoint Server 2016. We recommend that you plan a target search topology based on the expected number of items in the search index for search in enterprises.

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

概觀:變更搜尋索引中沒有內容的搜尋拓撲Overview: changing a search topology without content in the search index

下列清單提供有關將 SharePoint Server 搜尋索引中不含任何內容之預設搜尋拓撲,變更為新搜尋拓撲的工作概觀。The following list provides an overview of the tasks involved to change from the default search topology, without any content in the SharePoint Server search index, to a new search topology.

  • 確認所有編目皆尚未啟動,且 SharePoint Server 搜尋索引為空白。Ensure that no crawls have been started and that the SharePoint Server search index is empty.

  • 在所有您要主控搜尋元件的伺服器上啟動 Search Service 執行個體。Start a search service instance on all the servers that you want to host search components on.

  • 建立新的空白搜尋拓撲。Create a new empty search topology.

  • 新增搜尋元件至新的搜尋拓撲。Add search components to the new search topology.

  • 啟動新的搜尋拓撲。Activate the new search topology.

  • 確認搜尋拓撲正在使用中。Verify that the search topology is active.

範例:從預設的搜尋拓撲變更為小型企業搜尋拓撲Example: Change from the default search topology to a small enterprise search topology

下列程序可在多部伺服器上建立並啟動小型企業搜尋拓撲,如 目標搜尋拓撲 表格中所規劃。小型企業搜尋拓撲可使用實體應用程式伺服器上的虛擬機器。本範例中的所有搜尋元件均設有容錯能力,即所有搜尋元件和索引分割區均部署在個別失效網域中的多部實體機器上。The following procedures will create and activate a small enterprise search topology on multiple servers, as planned for in the table Target search topology. The small enterprise search topology uses virtual machines on physical application servers. All search components in this example are set up with fault tolerance, which means that all search components and index partitions are deployed across more than one physical machine on separate failure domains.

如果您想要擴充到較大的企業搜尋拓樸或網際網路網站的搜尋拓樸,可以依照相同的程序,但使用不同的變數。You can follow the same procedures using different variables if you want to scale out to a larger enterprise search topology or to a search topology for Internet Sites.

目標搜尋拓撲Target search topology

虛擬機器 A (位於實體應用程式伺服器 X) myserver1.example.comVirtual machine A (on physical application server X) myserver1.example.com 虛擬機器 B (位於實體應用程式伺服器 X) myserver2.example.comVirtual machine B (on physical application server X) myserver2.example.com 虛擬機器 C (位於實體應用程式伺服器 X) myserver3.example.comVirtual machine C (on physical application server Y) myserver3.example.com 虛擬機器 D (位於實體應用程式伺服器 X) myserver4.example.comVirtual machine D (on physical application server Y) myserver4.example.com
管理元件 1Admin component 1

編目元件 1Crawl component 1

內容處理元件 1Content processing component 1

分析處理元件 1Analytics processing component 1
查詢處理元件 1Query processing component 1

索引元件 1 (屬於索引分割區 0)Index component 1 (that belongs to index partition 0)
管理元件 2Admin component 2

編目元件 2Crawl component 2

內容處理元件 2Content processing component 2

分析處理元件 2Analytics processing component 2
查詢處理元件 2Query processing component 2

索引元件 2 (屬於索引分割區 0)Index component 2 (that belongs to index partition 0)
  1. 確認所有編目皆尚未啟動,且主控管理中心之伺服器上的搜尋索引為空白。Ensure that no crawls have been started and that the search index is empty on the server that hosts Central Administration.

    • 確認執行此程序的使用者帳戶是否為 Search Service 應用程式的管理員。Verify that the user account that is performing this procedure is an administrator for the Search service application.

    • 在管理中心的 [應用程式管理] 區段中,按一下 [管理服務應用程式]。In Central Administration, in the Application Management section, click Manage Service Applications.

    • 在 [管理服務應用程式] 頁面上,按一下服務應用程式清單中的 [Search Service 應用程式]。On the Manage Service Applications page, in the list of service applications, click the Search service application.

    • 確認搜尋索引為空白。在「搜尋管理」**** 頁面的 [系統狀態]**** 下方,確認 [可搜尋項目]**** 顯示為 "0"。Verify that the search index is empty. On the Search Administration page, under System Status, verify that Searchable items displays "0".

      警告

      如果 SharePoint Server 搜尋索引中有項目存在,請勿繼續執行此程序。If there are items in the SharePoint Server search index, do not continue with this procedure.

    • 確認所有編目皆尚未啟動。在「搜尋管理」頁面上,按一下 [正在編目] 下的 [內容來源]。在「管理內容來源」頁面上,確認所有現有內容來源的 [狀態] 欄均顯示為 [閒置]。Verify that no crawls have been started. On the Search Administration page, under Crawling, click Content Sources. On the Manage Content Sources page, verify that the Status column for any existing content source displays Idle.

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

  3. 指定您要新增搜尋元件的新伺服器,啟動這些伺服器上的 Search Service 執行個體 (SSI),並建立 Search Service 執行個體的參照。在此程序中,我們已使用列於 目標搜尋拓撲 表格之伺服器的範例主機名稱 "myserver< n >"。在 Windows PowerShell 命令提示字元處,輸入下列命令:Specify the new servers you want to add search components to, start a search service instance (ssi) on these servers and create references to the search service instances. In this procedure we have used the example host names "myserver< n >" for the servers as listed in the Target search topology table. At the Windows PowerShell command prompt, type the following command(s):

    $hostA = Get-SPEnterpriseSearchServiceInstance -Identity "myserver1"
    $hostB = Get-SPEnterpriseSearchServiceInstance -Identity "myserver2"
    $hostC = Get-SPEnterpriseSearchServiceInstance -Identity "myserver3"
    $hostD = Get-SPEnterpriseSearchServiceInstance -Identity "myserver4"
    Start-SPEnterpriseSearchServiceInstance -Identity $hostA
    Start-SPEnterpriseSearchServiceInstance -Identity $hostB
    Start-SPEnterpriseSearchServiceInstance -Identity $hostC
    Start-SPEnterpriseSearchServiceInstance -Identity $hostD
    
  4. 請稍候,直到所有 Search Service 執行個體均在執行中。在 Windows PowerShell 命令提示字元中,對每個 Search Service 執行個體輸入下列命令,直到命令回復「線上」狀態:Wait until all the search service instances are running. At the Windows PowerShell command prompt, type the following commands until the commands return the state "Online" for each of the search service instances:

    Get-SPEnterpriseSearchServiceInstance -Identity $hostA
    Get-SPEnterpriseSearchServiceInstance -Identity $hostB
    Get-SPEnterpriseSearchServiceInstance -Identity $hostC
    Get-SPEnterpriseSearchServiceInstance -Identity $hostD
    
  5. 建立新的搜尋拓撲和新搜尋拓撲的參照。在 Windows PowerShell 命令提示字元處,輸入下列命令:Create a new search topology and a reference to the new search topology. At the Windows PowerShell command prompt, type the following command(s):

    $ssa = Get-SPEnterpriseSearchServiceApplication
    $newTopology = New-SPEnterpriseSearchTopology -SearchApplication $ssa
    
  6. 將所有搜尋元件新增至新的搜尋拓撲。下列 Windows PowerShell 命令會建立新拓撲的搜尋元件,並將其指派給新的伺服器。在此小型企業搜尋拓撲中,有一個索引分割區 (即索引分割區 0)。這會以 -IndexPartition 命令中的 New-SPEnterpriseSearchIndexComponent 參數來表示。索引分割區在虛擬機器 B 和虛擬機器 D 各有一個索引複本。每個索引複本會包含完全相同的搜尋索引,並裝載在不同的實體伺服器上,以達成容錯能力。在 Windows PowerShell 命令提示字元處,輸入下列命令:Add all the search components to the new search topology. The following Windows PowerShell commands will create the search components of the new topology and assign them to the new servers. In this small enterprise search topology there is one index partition, index partition 0. This is indicated with the parameter -IndexPartition in the command New-SPEnterpriseSearchIndexComponent. The index partition has one index replica on virtual machine B and one index replica on virtual machine D. Each index replica will contain the exact same search index and is hosted on a different physical server to achieve fault tolerance. At the Windows PowerShell command prompt, type the following command(s):

    New-SPEnterpriseSearchAdminComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
    New-SPEnterpriseSearchCrawlComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
    New-SPEnterpriseSearchContentProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
    New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
    New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostB
    New-SPEnterpriseSearchIndexComponent -SearchTopology $newTopology -SearchServiceInstance $hostB -IndexPartition 0
    New-SPEnterpriseSearchAdminComponent -SearchTopology $newTopology -SearchServiceInstance $hostC
    New-SPEnterpriseSearchCrawlComponent -SearchTopology $newTopology -SearchServiceInstance $hostC
    New-SPEnterpriseSearchContentProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostC
    New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostC
    New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostD
    New-SPEnterpriseSearchIndexComponent -SearchTopology $newTopology -SearchServiceInstance $hostD -IndexPartition 0 
    
  7. 啟動新的搜尋拓撲。在 Windows PowerShell 命令提示字元處,輸入下列命令:Activate the new search topology. At the Windows PowerShell command prompt, type the following command:

    Set-SPEnterpriseSearchTopology -Identity $newTopology
    
  8. 請確認新的搜尋拓撲正在使用中。在 Windows PowerShell 命令提示字元處,輸入下列命令:Verify that the new search topology is active. At the Windows PowerShell command prompt, type the following command:

    Get-SPEnterpriseSearchTopology -SearchApplication $ssa
    

    在此範例中,該命令會傳回使用中與非使用中的拓撲概觀:The command returns an overview of active and inactive topologies, in this example:

    TopologyId     : fce8507d-61c6-4498-8038-4fd2d0a62c6e
    CreationDate   : 1/30/2016 2:52:00 AM
    State          : Inactive
    ComponentCount : 6
    TopologyId     : b63d48b2-df5c-41be-a7f4-9abaee483611
    CreationDate   : 1/30/2016 4:30:00 AM
    State          : Active
    ComponentCount : 12
    

    在此範例中的先前拓撲和預設拓撲皆列為非使用中。此範例中新的使用中拓撲會有 12 項元件。The previous topology, the default topology in this example, is listed as inactive. The new active topology from this example will have a component count of twelve.

  9. 確認新搜尋拓撲的所有元件均運作正常。在 Windows PowerShell 命令提示字元處,輸入下列命令:Verify that all components of the new search topology are running correctly. At the Windows PowerShell command prompt, type the following command:

    Get-SPEnterpriseSearchStatus -SearchApplication $ssa -Text
    

    此命令應傳回所有使用中的搜尋元件清單。使用中的搜尋元件狀態應顯示為 使用中This command should return a list of all the active search components. The state of the active search components should be displayed as Active.