Apply High Availability Search Topology – SharePoint 2013 using Power Shell


high2

$App1 = Get-SPEnterpriseSearchServiceInstance -Identity “app1”
$App2 = Get-SPEnterpriseSearchServiceInstance -Identity “app2”
$fe1 = Get-SPEnterpriseSearchServiceInstance -Identity “wfe1”
$fe2 = Get-SPEnterpriseSearchServiceInstance -Identity “wfe2”
$fe3 = Get-SPEnterpriseSearchServiceInstance -Identity “wfe3”
$fe4 = Get-SPEnterpriseSearchServiceInstance -Identity “wfe4”
$searchName = “High Availability Search Service”
$searchDB = “High Availability Search Service_DB”
$searchAcct = “imam\FarmAdminUserName”
$searchManagedAcct = Get-SPManagedAccount | Where {$_.username-eq ‘imam\FarmAdminUserName’}
$searchAppPoolName = “High Availability Search Services Application Pool”
IF((Get-spserviceapplicationPool | Where {$_.name -eq “High Availability Search Services Application Pool”}).name -ne “High Availability Search Services Application Pool”){
$searchAppPool = New-SPServiceApplicationPool -Name $searchAppPoolName -Account $searchManagedAcct}

Write-Host “Starting Search Service Instances on App1…..”

IF((Get-SPEnterpriseSearchServiceInstance -Identity $App1).Status -eq ‘Disabled’)

{
Start-SPEnterpriseSearchServiceInstance -Identity $App1
Write-Host “Starting Search Service Instance on” $App1.Server.Name
Do
{
Start-Sleep 5;
Write-host -NoNewline “.”
}
While ((Get-SPEnterpriseSearchServiceInstance -Identity $App1).Status -eq ‘Online’)
Write-Host -ForegroundColor Green “Search Service Instance Started on” $App1.Server.Name
}
ELSE { Write-Host -f Green “Search Service Instance is already running on” $App1.Server.Name }
Write-Host “Starting Search Service Instances on App2…..”

IF((Get-SPEnterpriseSearchServiceInstance -Identity $App2).Status -eq ‘Disabled’)

{
Start-SPEnterpriseSearchServiceInstance -Identity $App2
Write-Host “Starting Search Service Instance on” $App2.Server.Name
Do
{
Start-Sleep 5;
Write-host -NoNewline “.”
}
While ((Get-SPEnterpriseSearchServiceInstance -Identity $App2).Status -eq ‘Online’)
Write-Host -ForegroundColor Green “Search Service Instance Started on” $App2.Server.Name
}
ELSE { Write-Host -f Green “Search Service Instance is already running on” $App2.Server.Name }
Write-Host “Starting Search Service Instances on fe1…..”

IF((Get-SPEnterpriseSearchServiceInstance -Identity $fe1).Status -eq ‘Disabled’)

{
Start-SPEnterpriseSearchServiceInstance -Identity $fe1
Write-Host “Starting Search Service Instance on” $fe1.Server.Name
Do
{
Start-Sleep 5;
Write-host -NoNewline “.”
}
While ((Get-SPEnterpriseSearchServiceInstance -Identity $fe1).Status -eq ‘Online’)
Write-Host -ForegroundColor Green “Search Service Instance Started on” $fe1.Server.Name
}
ELSE { Write-Host -f Green “Search Service Instance is already running on” $fe1.Server.Name }
Write-Host “Starting Search Service Instances on fe2…..”

IF((Get-SPEnterpriseSearchServiceInstance -Identity $fe2).Status -eq ‘Disabled’)

{
Start-SPEnterpriseSearchServiceInstance -Identity $fe2
Write-Host “Starting Search Service Instance on” $fe2.Server.Name
Do
{
Start-Sleep 5;
Write-host -NoNewline “.”
}
While ((Get-SPEnterpriseSearchServiceInstance -Identity $fe2).Status -eq ‘Online’)
Write-Host -ForegroundColor Green “Search Service Instance Started on” $fe2.Server.Name
}
ELSE { Write-Host -f Green “Search Service Instance is already running on” $fe2.Server.Name }
Write-Host “Starting Search Service Instances on fe3…..”

IF((Get-SPEnterpriseSearchServiceInstance -Identity $fe2).Status -eq ‘Disabled’)

{
Start-SPEnterpriseSearchServiceInstance -Identity $fe3
Write-Host “Starting Search Service Instance on” $fe3.Server.Name
Do
{
Start-Sleep 5;
Write-host -NoNewline “.”
}
While ((Get-SPEnterpriseSearchServiceInstance -Identity $fe3).Status -eq ‘Online’)
Write-Host -ForegroundColor Green “Search Service Instance Started on” $fe3.Server.Name
}
ELSE { Write-Host -f Green “Search Service Instance is already running on” $fe3.Server.Name }
Write-Host “Starting Search Service Instances on fe4…..”

IF((Get-SPEnterpriseSearchServiceInstance -Identity $fe4).Status -eq ‘Disabled’)

{
Start-SPEnterpriseSearchServiceInstance -Identity $fe4
Write-Host “Starting Search Service Instance on” $fe4.Server.Name
Do
{
Start-Sleep 5;
Write-host -NoNewline “.”
}
While ((Get-SPEnterpriseSearchServiceInstance -Identity $fe4).Status -eq ‘Online’)
Write-Host -ForegroundColor Green “Search Service Instance Started on” $fe4.Server.Name
}
ELSE { Write-Host -f Green “Search Service Instance is already running on” $fe4.Server.Name }

Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance $App1.server.Name
Do {
Start-Sleep 3;
Write-host -NoNewline “.”
}

While ((Get-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance | Where {$_.Server.Name -eq $App1.server.Name}).status -ne ‘Online’)
Write-Host -ForegroundColor Green “Query and Site Settings Service Instance Started on” $App1.Server.Name

Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance $App2.server.Name
Do {
Start-Sleep 3;
Write-host -NoNewline “.”
}
While ((Get-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance | Where {$_.Server.Name -eq $App2.server.Name}).status -ne ‘Online’)
Write-Host -ForegroundColor Green “Query and Site Settings Service Instance Started on” $App2.Server.Name
$searchAppPool = Get-SPServiceApplicationPool -Identity “High Availability Search Services Application Pool”

IF ((Get-SPEnterpriseSearchServiceApplication).Status -ne ‘Online’){
Write-Host “Provisioning. Please wait…”
$searchApp = New-SPEnterpriseSearchServiceApplication -Name $searchName -ApplicationPool $searchAppPool -AdminApplicationPool $searchAppPool -DatabaseName $searchDB
DO {start-sleep 2;
write-host -nonewline “.” } While ( (Get-SPEnterpriseSearchServiceApplication).status -ne ‘Online’)
Write-Host -f green “Provisioned Search Service Application”
} ELSE { write-host -f green “Search Service Application already provisioned.”
$searchApp = Get-SPEnterpriseSearchServiceApplication
}

$AdminComponent = $searchApp | Get-SPEnterpriseSearchAdministrationComponent | Set-SPEnterpriseSearchAdministrationComponent -SearchServiceInstance $App1
$initialTopology = Get-SPEnterpriseSearchTopology -SearchApplication $searchApp
$cloneTopology = New-SPEnterpriseSearchTopology -SearchApplication $searchApp -Clone -SearchTopology $initialTopology
$AdminTopology = New-SPEnterpriseSearchAdminComponent -SearchServiceInstance $App1 -SearchTopology $cloneTopology
$CrawlTopology = New-SPEnterpriseSearchCrawlComponent -SearchServiceInstance $App1 -SearchTopology $cloneTopology
$AnalyticsTopology = New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchServiceInstance $App1 -SearchTopology $cloneTopology
$ContentProcessingTopology = New-SPEnterpriseSearchContentProcessingComponent -SearchServiceInstance $App1 -SearchTopology $cloneTopology
$IndexTopology = New-SPEnterpriseSearchIndexComponent -SearchServiceInstance $App1 -SearchTopology $cloneTopology -IndexPartition 0
$AdminTopology = New-SPEnterpriseSearchAdminComponent -SearchServiceInstance $App2 -SearchTopology $cloneTopology
$CrawlTopology = New-SPEnterpriseSearchCrawlComponent -SearchServiceInstance $App2 -SearchTopology $cloneTopology
$AnalyticsTopology = New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchServiceInstance $App2 -SearchTopology $cloneTopology
$ContentProcessingTopology = New-SPEnterpriseSearchContentProcessingComponent -SearchServiceInstance $App2 -SearchTopology $cloneTopology
$IndexTopology = New-SPEnterpriseSearchIndexComponent -SearchServiceInstance $App2 -SearchTopology $cloneTopology -IndexPartition 0
$fe1 = Get-SPEnterpriseSearchServiceInstance -Identity “sp-ife1”
$QueryTopology = New-SPEnterpriseSearchQueryProcessingComponent -SearchServiceInstance $fe1 -SearchTopology $cloneTopology

$fe2 = Get-SPEnterpriseSearchServiceInstance -Identity “sp-ife2”
$QueryTopology = New-SPEnterpriseSearchQueryProcessingComponent -SearchServiceInstance $fe2 -SearchTopology $cloneTopology

$fe3 = Get-SPEnterpriseSearchServiceInstance -Identity “sp-efe1”
$QueryTopology = New-SPEnterpriseSearchQueryProcessingComponent -SearchServiceInstance $fe3 -SearchTopology $cloneTopology

$fe4 = Get-SPEnterpriseSearchServiceInstance -Identity “sp–efe2”
$QueryTopology = New-SPEnterpriseSearchQueryProcessingComponent -SearchServiceInstance $fe4 -SearchTopology $cloneTopology
Set-SPEnterpriseSearchTopology -Identity $cloneTopology

$initialTopology = Get-SPEnterpriseSearchTopology -SearchApplication $searchApp | where {($_.State) -eq “Inactive”}
Remove-SPEnterpriseSearchTopology -Identity $initialTopology -Confirm:$false

$searchAppProxy = New-SPEnterpriseSearchServiceApplicationProxy -Name “$searchName Proxy” -SearchApplication $searchApp

Advertisements

Managed Metadata Column Vs Lookup Column in Content Type Hub!


If you start to apply the content type hub you must take in considerations some issues you will focus after the first time you will publish the first content type 🙂

about the creation of the hub and the steps in details i’ll make another post soon isA but today i’ll tell you the problem and how can i found a solution for it.

problems

The Problem Description:

After creating the hub and deploying the content types with lookup columns you will face the first problem.That you already create the lookup column and the list already exist on the web application that host the hub but not exists on the other web applications that the content type will be published on it.so what we can do now.don’t tell me to create the lists manually on all web applications 🙂 

 

A computers red solution key

Solution:

managed metadata navigation

we will make a managed meta data column instead of lookup.

What’s managed metadata column? a definition from Microsoft

A Managed Metadata column is a new column type that can be added to lists, libraries, or content types to enable site users to select values from a specific term set of managed terms and apply these values to their content. You can create and configure a Managed Metadata column to map to an existing term set or term, or you can create a new term set specifically for a Managed Metadata column.

 

If we create the column from this type we can alter the values without depending on a list existence like the lookup column.in this case all you need the Managed Metadata Service to be running and you have the permission to the Taxonomy terms store to enable you to add/edit/delete terms.also this solution solve another big issue it’s the Language of the values

if we used lookup column how you can change the values depending on the current culture in a multilingual portals?

taxonomy-in-term-store

our solution will deal with languages because the term store enable you to add language packs so you can add the value in Arabic then switch the language in the term store to English as another language and translate the word.

image_thumb[5]

when you open any page contains the field you will find the word in the current Language!

 

Thanks & Regards,

Ahmed Samir