question

NguyenTee-6512 avatar image
0 Votes"
NguyenTee-6512 asked JoyZ commented

C:\ drive running out of space during full index SharePoint Onprem 2013

We moved our search index from C:\ to E:\ drive by create new search topology from below script to avoid C:\ drive ran out of disk space:

Set Index/Replicas directories location, maker sure you do this for both Index server
$IndexLocation = "E:\SPIndex"

Create Index/Replicas directories maker sure you do this for both Index server
Remove-Item -Recurse -Force -LiteralPath $IndexLocation -ErrorAction SilentlyContinue
mkdir -Path $IndexLocation -Force

Create new search topology
$ssa = Get-SPEnterpriseSearchServiceApplication -Identity 'Search Service Application'
$newTopology = New-SPEnterpriseSearchTopology -SearchApplication $ssa

$hostA = Get-SPEnterpriseSearchServiceInstance -Identity "SPApp1"
$hostB = Get-SPEnterpriseSearchServiceInstance -Identity "SPApp2"

Below commands will start the search service instance on all 2 servers.
Start-SPEnterpriseSearchServiceInstance -Identity $hostA
Start-SPEnterpriseSearchServiceInstance -Identity $hostB

Below commands will show the status of search service instance on all the servers. Wait untill all the services have been succesfully started.
Get-SPEnterpriseSearchServiceInstance -Identity $hostA
Get-SPEnterpriseSearchServiceInstance -Identity $hostB

Create search component A
New-SPEnterpriseSearchAdminComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
New-SPEnterpriseSearchContentProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostA

Create search component B
New-SPEnterpriseSearchAdminComponent -SearchTopology $newTopology -SearchServiceInstance $hostB
New-SPEnterpriseSearchContentProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostB
New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostB

Create search component A
New-SPEnterpriseSearchCrawlComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
Create search component B
New-SPEnterpriseSearchCrawlComponent -SearchTopology $newTopology -SearchServiceInstance $hostB

Create index partition and replicas A
New-SPEnterpriseSearchIndexComponent –SearchTopology $newTopology -SearchServiceInstance $hostA -RootDirectory $IndexLocation -IndexPartition 0
Create index partition and replicas B
New-SPEnterpriseSearchIndexComponent –SearchTopology $newTopology -SearchServiceInstance $hostB -RootDirectory $IndexLocation -IndexPartition 0

Create search query processing componenthost A
New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
Create search query processing componenthost B
New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostB

Active new topology - Before activate, make sure to reset content index - When powershell command below completed (return to prompt), wait for few minutes for the script completed the processing
Set-SPEnterpriseSearchTopology -Identity $newTopology

Last step is cleanup old topology
Get-SPEnterpriseSearchServiceApplication | Get-SPEnterpriseSearchTopology |? {$.State -eq "Inactive"} |% { Remove-SPEnterpriseSearchTopology -Identity $ -Confirm:$false};

Confirm if old topology had been deleted
Get-SPEnterpriseSearchServiceApplication | Get-SPEnterpriseSearchTopology |? {$_.State -eq "Inactive"}



However, when we run full crawl with new topology above, C:\ drive still running out of space, so I ran the below 2 commands to check Index location

$ssa = Get-SPEnterpriseSearchServiceApplication -Identity "Search Service Application"
$ssa.AdminComponent.IndexLocation

PS C:\Windows\system32> $ssa.AdminComponent.IndexLocation
C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server\Applications

It pointed C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server\Applications and this caused C:\ drive ran out of diskspace.

How can I change all the index related components/location point to D:\ drive instead of C:\ without reinstall SharePoint?

I found dozens of articles recommended to change from window registry to clone new topology and none of them is working. After I try and run $ssa.AdminComponent.IndexLocation, it still point to C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server\Applications.

Please help.
Thanks
Tee

office-sharepoint-server-administration
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I am currently test it on my end and will give you an update as soon as possible.

Thank you for your understanding and support.

0 Votes 0 ·

1 Answer

JoyZ avatar image
0 Votes"
JoyZ answered JoyZ commented

@NguyenTee-6512,

According to my test, I can change the index location by following the steps below:

  • Get the current search topology

  • Clone the current search topology

  • Modify the cloned Search topology(add a new index component with new search index location)

  • Activate the cloned search topology

  • Remove the old search topology

  • Remove old index component(This means clone, modify, activate search topology and remove the old search topology)

Get the current Search topology

 $ssa = Get-SPEnterpriseSearchServiceApplication "Search Service Application" 
 $instance=Get-SPEnterpriseSearchServiceInstance -Local
 $current=Get-SPEnterpriseSearchTopology -SearchApplication $ssa

Clone the current Search topology

 $clone=New-SPEnterpriseSearchTopology -Clone -SearchApplication $ssa -SearchTopology $current

Modify the cloned Search topology
This will add a second index component with a new index location.

 New-SPEnterpriseSearchIndexComponent -SearchTopology $clone -IndexPartition 0 -SearchServiceInstance $instance -RootDirectory "E:\NewIndexLocation"

Activate the cloned Search topology

 Set-SPEnterpriseSearchTopology -Identity $clone

Remove the old Search topology

 Remove-SPEnterpriseSearchTopology -Identity $current

The next step, remove the old index component, should be done when the new index component is ready. This can be checked from Central Admin on the Search Administration page, view the status of the search topology or use PowerShell Get-SPEnterpriseSearchStatus. The new index component must be Active.

Remove the old index component
This must be done by get, clone, modify, activate the new search topology and remove the old search topology.

 $current=Get-SPEnterpriseSearchTopology -SearchApplication $ssa
 $clone=New-SPEnterpriseSearchTopology -Clone -SearchApplication $ssa -SearchTopology $current
 $comp=Get-SPEnterpriseSearchComponent -SearchTopology $clone | ? {$_.Name -eq "IndexComponent1"}
 Remove-SPEnterpriseSearchComponent -Identity $comp -SearchTopology $clone
 Set-SPEnterpriseSearchTopology -Identity $clone
 Remove-SPEnterpriseSearchTopology -Identity $current

Lastly, we could use following powershell to check the result:

 $searchServiceApp = Get-SPServiceApplication -Name "Search Service Application"
 $activeTopology = $searchServiceApp.ActiveTopology
 Get-SPEnterpriseSearchComponent -SearchTopology $activeTopology

124564-image.png


If an Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



image.png (59.5 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@NguyenTee-6512,

Do you have any progress on this issue?

Please remember to update this thread if you need further assistance.

0 Votes 0 ·