Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Folks,
I'm hoping to use Powershell to get my Qlik cluster to switch central nodes. Right now, I've got the following code which works correctly.
$hdrs = @{}
$hdrs.Add("X-Qlik-xrfkey","12345678qwert2ui")
$url = "https://002.megacorp.com/admin/qrs/ServerNodeConfiguration/full?xrfkey=12345678qwert2ui"
$clusterNodes = Invoke-RestMethod -Uri $url -Method Get -Headers $hdrs -UseDefaultCredentials
But when I send the request to change, I get a 403. I am sending this request with RootAdmin privileges.
$destinationNodeName = '003.megacorp.com'
$currentCentralNode = $clusterNodes | Where-Object { $_.isCentral -eq $true }
$destinationCentralNode = $clusterNodes | Where-Object { $_.hostName -match $destinationNodeName }
$destinationCentralNodeGuid = $destinationCentralNode.id
$changeOverPutUrl = "https://003.megacorp.com/admin/qrs/failover/tonode/${destinationCentralNodeGuid}"
Write-Host $changeOverPutUrl
$response = Invoke-RestMethod -Uri $changeOverPutUrl -Method Post -Headers $hdrs -UseDefaultCredentials
When I look into the logs, I see "InvalidConnection" along with the 403 code
What might I be doing wrong?
Any help is greatly appreciated.
Hi,
In the second Powershell script, did you try to perform a GET call, as described in this doc ?
Issuing POST commands via the proxy | Qlik Sense for developers Help
Best