Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Apr 22, 2021 4:19:22 AM
Nov 28, 2018 6:37:39 AM
Failover in Qlik Sense normally occurs automatically after the current central node has been down for the failover timeout (default 10 minutes).
This can also be done manually using the Qlik Sense APIs.
If you decide that you want to move the central node to another node in your site, you can manually migrate it using the following REST API calls:
For more information about Failover, see Configuring failover for central node resiliency
Requirements:
Get /qrs/serverNodeConfiguration
Request :
$hdrs = @{}
$hdrs.Add("X-Qlik-xrfkey","12345678qwertyui")
$hdrs.Add("X-Qlik-User","UserDirectory=DOMAIN;UserId=Administrator")
$cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'}
$url = "https://qlikserver1.domain.local:4242/qrs/serverNodeConfiguration?xrfkey=12345678qwertyui"
Invoke-RestMethod -Uri $url -Method Get -Headers $hdrs -Certificate $cert
Response:
id : 2bd6ad22-6f02-453d-bdf3-1045f0cc3757
name : Central
hostName : qlikserver1.domain.local
temporaryfilepath : C:\Users\qvservice\AppData\Local\Temp\
roles : {@{id=8ea30475-1170-4d91-8138-6167677bd038; definition=0; privileges=}, @{id=3853567e-0bbf-40d5-986c-8be7e0bf3581;
definition=1; privileges=}, @{id=3680e3b5-949d-4efc-b62a-d8c5033c4b0b; definition=2; privileges=}, @{id=b51a2b42-
4a03-49b1-b290-42bec3c6ba0b; definition=3; privileges=}...}
serviceCluster : @{id=37446216-256c-4edc-8b55-77fedfd6e6a5; name=ServiceCluster; privileges=}
privileges :
id : 391a518c-c2f3-4984-9060-0d710636b909
name : Rim01
hostName : qlikserver2.domain.local
temporaryfilepath :
roles : {}
serviceCluster : @{id=37446216-256c-4edc-8b55-77fedfd6e6a5; name=ServiceCluster; privileges=}
privileges :
POST /qrs/failover/tonode/{serverNodeConfigurationID}
Request:
$hdrs = @{}
$hdrs.Add("X-Qlik-xrfkey","12345678qwertyui")
$hdrs.Add("X-Qlik-User","UserDirectory=DOMAIN;UserId=Administrator")
$cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'}
$url = "https://qlikserver1.domain.local:4242/qrs/failover/tonode/391a518c-c2f3-4984-9060-0d710636b909?xrfkey=12345678qwertyui"
Invoke-RestMethod -Uri $url -Method Post -Headers $hdrs -Certificate $cert
If no error is returned, it means the API call succeeded.
Hi,
This is a great tip and I've used it but, does anyone know what happens if there is a problem with the tonode-value? I used the correct value...
Is there a check to validate that the node exist and fail if it doesn't?
I don't have an environment with failover configured where I can test this.
TIA
/lars