Showing posts with label move index components. Show all posts
Showing posts with label move index components. Show all posts

Thursday, May 30, 2013

SharePoint 2013 Search: Add an Index Component to a New Web Front End

I previously moved the query component to my single web front end server (WFE) and then moved the index partition . Now I have a second WFE provisioned and I wanted to create a query and an index component on that server as well. This post outlines the steps for the index component. The query component steps are here.


Get Search Service Instance and Start on New WFE Server
$ssi = Get-SPEnterpriseSearchServiceInstance -Identity "<<NEW WFE SERVER NAME>>"
Start-SPEnterpriseSearchServiceInstance -Identity $ssi

Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance -Identity "<<NEW WFE SERVER NAME>>"


Wait for Search Service Instance to come online
Get-SPEnterpriseSearchServiceInstance -Identity $ssi

In the full script I have a loop that waits for the service to become online.
 

Clone the Active Search Topology$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active



Create the New Index Component for Index Partition 0
New-SPEnterpriseSearchIndexComponent –SearchTopology $clone -SearchServiceInstance $ssi -IndexPartition 0             -RootDirectory "E:\SPIndex"

{click image to see larger view}

Activate  the Cloned Search Topology
Set-SPEnterpriseSearchTopology -Identity $clone

Optionally Review new topology
Get-SPEnterpriseSearchTopology -Active -SearchApplication $ssa

Monitor/Verify the Search Status
Get-SPEnterpriseSearchStatus -SearchApplication $ssa

In the full script I have a loop that waits for the index component to become active. The new Index Component will need to sync-up.

You may use the -text parameter to get additional information about the search component statuses:

Get-SPEnterpriseSearchStatus -SearchApplication $ssa -text


I now have the Index Partition across two web front ends:


{click image to see larger view}


FULL SCRIPT (with loops)
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Get Search Service Instance and Start on New WFE Server
$ssi = Get-SPEnterpriseSearchServiceInstance -Identity "<<NEW WFE SERVER NAME>>"
Start-SPEnterpriseSearchServiceInstance -Identity $ssi

Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance -Identity "<<NEW WFE SERVER NAME>>"

#Wait for Search Service Instance to come online
do {$online = Get-SPEnterpriseSearchServiceInstance -Identity $ssi; Write-Host "Waiting for service: " $online.Status}
until ($online.Status -eq "Online")


#Clone Active Search Topology
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active


#Create New Index Component for Index Partition 0
New-SPEnterpriseSearchIndexComponent –SearchTopology $clone -SearchServiceInstance $ssi -IndexPartition 0 -RootDirectory "E:\SPIndex"

# Activate  Search Topology
Set-SPEnterpriseSearchTopology -Identity $clone


#Review new topology
Get-SPEnterpriseSearchTopology -Active -SearchApplication $ssa


#Monitor Distribution of Index
do {$activeState = Get-SPEnterpriseSearchStatus -SearchApplication $ssa | Where-Object {$_.Name -eq "IndexComponent2"}; Write-Host "Waiting for active distribution: " $activeState.State}
until ($activeState.State -eq "Active")

SharePoint 2013 Search: Add a Query Component to a New Web Front End

I previously moved the query component to my single web front end server (WFE) and then moved the index partition . Now I have a second WFE provisioned and I wanted to create a query and an index component on that server as well. This post outlines the steps for the query component. The index component was next and those steps are outlined here.


Get Search Service Instance and Start on New WFE Server
$ssi = Get-SPEnterpriseSearchServiceInstance -Identity "<<NEW WFE SERVER NAME>>"
Start-SPEnterpriseSearchServiceInstance -Identity $ssi

Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance -Identity "<<NEW WFE SERVER NAME>>"


Wait for Search Service Instance to come online
Get-SPEnterpriseSearchServiceInstance -Identity $ssi

In the full script I have a loop that waits for the service to become online.
 

Clone the Active Search Topology$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active





Add the New Query Processing Component
New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $clone -SearchServiceInstance $ssi


Activate  the Cloned Search Topology
Set-SPEnterpriseSearchTopology -Identity $clone

Optionally Review new topology
Get-SPEnterpriseSearchTopology -Active -SearchApplication $ssa

Monitor/Verify the Search Status
Get-SPEnterpriseSearchStatus -SearchApplication $ssa

In the full script I have a loop that waits for the index component to become active. If you have two index components, one usually needs to be re-synced.

You may use the -text parameter to get additional information about the search component statuses:

Get-SPEnterpriseSearchStatus -SearchApplication $ssa -text


I now have a Query Processing component on two web front ends:

{click image to see larger view}

Next I wanted to expand the index partition across the two WFEs and so I added a new Index Component to WFE2.


FULL SCRIPT (with loops)
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Get Search Service Instance and Start on New WFE Server
$ssi = Get-SPEnterpriseSearchServiceInstance -Identity "<<NEW WFE SERVER NAME>>"
Start-SPEnterpriseSearchServiceInstance -Identity $ssi

Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance -Identity "<<NEW WFE SERVER NAME>>"

#Wait for Search Service Instance to come online
do {$online = Get-SPEnterpriseSearchServiceInstance -Identity $ssi; Write-Host "Waiting for service: " $online.Status}
until ($online.Status -eq "Online")


#Clone Active Search Topology
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active


# Add New Search Component
New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $clone -SearchServiceInstance $ssi


# Activate  Search Topology
Set-SPEnterpriseSearchTopology -Identity $clone


#Review new topology
Get-SPEnterpriseSearchTopology -Active -SearchApplication $ssa


#Monitor Distribution of Index
do {$activeState = Get-SPEnterpriseSearchStatus -SearchApplication $ssa | Where-Object {$_.Name -eq "IndexComponent2"}; Write-Host "Waiting for active distribution: " $activeState.State}
until ($activeState.State -eq "Active")

Wednesday, May 22, 2013

SharePoint 2013 Search: Moving the Index Partition to the Web Front Ends

I previously wrote a post about Moving the Query Component to a Web Front End. There were questions in regards to the Index Partition/Index Components as well. However, in the meantime I scaled out some of my SharePoint 2013 Search architecture since I had a new "Index Server" provisioned.

While I'll post all of the details of my "scaling out" search experiences, it is recommended that the Index Partition and Query Components live on the same servers;  this is for performance purposes. The more I added to my awesome search results and promoted result blocks across multiple result sources, the slower the search response became. Therefore I decided that we should see what happens if we moved the Index Partition to the web front ends (currently I only have 1 WFE but it would still provide some baseline).

This is all accomplished in PowerShell and/or the SharePoint 2013 Management Console.

Here we go!



Step #1: Get the Search Service Instance and Start on the WFE
#Get Search Service Instance and Start on WFE
$ssi = Get-SPEnterpriseSearchServiceInstance -Identity "<<WFE Server Name>>"
Start-SPEnterpriseSearchServiceInstance -Identity $ssi


Step #2: Wait for the Search Service to Come Online
Get-SPEnterpriseSearchServiceInstance -Identity $ssi

In my full script version, I have a loop that continues until the search service is online.

Step #3: Clone the Active Search Topology
#Clone Active Search Topology
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active


Step #4: Create the New Index Component on the WFE
#Create New Index Component for Index Partition 0
New-SPEnterpriseSearchIndexComponent –SearchTopology $clone -SearchServiceInstance $ssi -IndexPartition 0

-RootDirectory "E:\SPIndex"

I created a folder named SPIndex on the E: drive of the WFE. Modify this for your own location.

This step generates a new Index Component. I had IndexComponent3 and IndexComponent4 already so my new one was IndexComponent5 (yours will probably be different):



Step #5: Activate the Cloned Search Topology with the New Index Component
#Activate the Cloned Search Topology
Set-SPEnterpriseSearchTopology -Identity $clone


Once this is complete you may review your search topology:
#Review new topology
Get-SPEnterpriseSearchTopology -Active -SearchApplication $ssa



Step #6: Monitor the Distribution of the Index
Get-SPEnterpriseSearchStatus -SearchApplication $ssa

The new index component will be degraded until it has sync'ed with the active index components:



In the full script I again have a loop that waits until the new component is Active. Looking at your Search Service Application in Central Admin shows a warning:


Once the new Index Component is active, a new green check appears in the Search Service Application:


Step #7: Clone the Active Search Topology Again
# Clone Again
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active


Step #8: Get the ID of the Index Component to Remove
# Get the Index Search Component ID To Remove
$indexComponentID = (Get-SPEnterpriseSearchComponent -SearchTopology $clone -Identity IndexComponent3).componentID


My component was IndexComponent3 yours may be different.
Use Get-SPEnterpriseSearchStatus -SearchApplication $ssa to see which components you have.

Step #9: Remove the original Index Component
# Remove Search Component
Remove-SPEnterpriseSearchComponent -Identity $indexComponentID.GUID -SearchTopology $clone -confirm:$false


In my case I has had the two components on two servers so I repeated Step #8 and Step #9.


Step #10: Activate Search Topology Again
# Activate  Search Topology Again
Set-SPEnterpriseSearchTopology -Identity $clone



Step #11: Monitor the Distribution of the Index (this time it should be instantaneous)
Get-SPEnterpriseSearchStatus -SearchApplication $ssa

Once the new search topology is activated the Index Partition is moved to the web front end:



What about other WFEs? I will need to add index components to additional WFEs which will be similiar to the process I used to build out my index components on my index servers. More to come on that.

Full Script (fill in the << >> values)

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Get Search Service Instance and Start on WFE
$ssi = Get-SPEnterpriseSearchServiceInstance -Identity "<<WFE Server Name>>"
Start-SPEnterpriseSearchServiceInstance -Identity $ssi


#Wait for Search Service Instance to come online
do {$online = Get-SPEnterpriseSearchServiceInstance -Identity $ssi; Write-Host "Waiting for service: " $online.Status}
until ($online.Status -eq "Online")


#Clone Active Search Topology
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active

#Create New Index Component for Index Partition 0
New-SPEnterpriseSearchIndexComponent –SearchTopology $clone -SearchServiceInstance $ssi -IndexPartition 0 -RootDirectory "E:\SPIndex"

#Activate the Cloned Search Topology
Set-SPEnterpriseSearchTopology -Identity $clone


#Review new topology
Get-SPEnterpriseSearchTopology -Active -SearchApplication $ssa


#Monitor Distribution of Index
do {$activeState = Get-SPEnterpriseSearchStatus -SearchApplication $ssa | Where-Object {$_.Name -eq "IndexComponent5"}; Write-Host "Waiting for active distribution: " $activeState.State}
until ($activeState.State -eq "Active")


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


# Get the Index Search Component ID To Remove
$indexComponentID = (Get-SPEnterpriseSearchComponent -SearchTopology $clone -Identity <<Index Component Name>>).componentID


# Remove Search Component
Remove-SPEnterpriseSearchComponent -Identity $indexComponentID.GUID -SearchTopology $clone -confirm:$false


# Activate  Search Topology Again
Set-SPEnterpriseSearchTopology -Identity $clone


#Monitor Distribution of Index
do {$activeState = Get-SPEnterpriseSearchStatus -SearchApplication $ssa | Where-Object {$_.Name -eq "<<New Index Component Name>>"}; Write-Host "Waiting for active distribution: " $activeState.State}
until ($activeState.State -eq "Active")


 

Matched Content