Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rohitk1609
Master
Master

How to change central node type manually from Failover Node

Hi Techies,

I have 5 servers in my Qlik site

1. Central node(Master Node)

2. Scheduler Node1(Failover Candidate) and Scheduler Node2(Failover Candidate)

3. Consumer Node1 and Consumer Node2

On one incident, services of Central node(Master Node) have been stopped and Scheduler Node2(Failover Candidate) took the charge then Scheduler Node2 is MASTER type with scheduler as MASTER only and Central node became SLAVE and now my new config is


1. Central node(slave or scheduler node)

2. Scheduler Node1(Failover Candidate) and Scheduler Node2(Master Node)

3. Consumer Node1 and Consumer Node2

I want to make my Central node back to Master type of master node. Can please anyone tell me what is the best way to change a node's node type or make my old central node back to master node ?

Thanks,

Rohit


1 Solution

Accepted Solutions
Levi_Turner
Employee
Employee

Hey Rohit,

You can accomplish this via API call (POST /qrs/failover/tonode/{ServerNode_GUID}).

Video discussing Failover: https://youtu.be/Y5IblMGwrLU?t=335

This can be done in PowerShell when run as the service account (or other account with the QlikClient certificate installed:

$hdrs = @{}

$hdrs.Add("X-Qlik-Xrfkey","examplexrfkey123")

$hdrs.Add("X-Qlik-User", "UserDirectory=INTERNAL; UserId=sa_api")

$cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'}

$Data = Get-Content C:\ProgramData\Qlik\Sense\Host.cfg

$FQDN = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($($Data)))

$body = ''

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12'

Invoke-RestMethod -Uri "https://$($FQDN):4242/qrs/failover/tonode/GUID?xrfkey=examplexrfkey123" -Method Post -Body $body -Headers $hdrs -ContentType 'application/json' -Certificate $cert

Hope that helps.

View solution in original post

12 Replies
Levi_Turner
Employee
Employee

Hey Rohit,

You can accomplish this via API call (POST /qrs/failover/tonode/{ServerNode_GUID}).

Video discussing Failover: https://youtu.be/Y5IblMGwrLU?t=335

This can be done in PowerShell when run as the service account (or other account with the QlikClient certificate installed:

$hdrs = @{}

$hdrs.Add("X-Qlik-Xrfkey","examplexrfkey123")

$hdrs.Add("X-Qlik-User", "UserDirectory=INTERNAL; UserId=sa_api")

$cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'}

$Data = Get-Content C:\ProgramData\Qlik\Sense\Host.cfg

$FQDN = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($($Data)))

$body = ''

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12'

Invoke-RestMethod -Uri "https://$($FQDN):4242/qrs/failover/tonode/GUID?xrfkey=examplexrfkey123" -Method Post -Body $body -Headers $hdrs -ContentType 'application/json' -Certificate $cert

Hope that helps.

rohitk1609
Master
Master
Author

Hi Levi thanks for your instant response.

So I tried the solution with power shell.

I copied your code and pasted in notedpad and saved it to .ps1 extension.

I replaced GUID by node id(my old central node but currently its scheduler node).

Currently I tested it in my dev server where there is stand alone Qlik or no rim node(Failover node). It didn't change anything but obviously.


Please confirm which node id I need to use at place of GUID in above code ??.



Second, I watched the your suggested video and tried to do what it say by POSTMAN:

URL: https://84-pc:4242/qrs/failover/tonode/114d1c27-d0de-4f5d-8a3e-46fc6c7ca925

=>Node id: 114d1c27-d0de-4f5d-8a3e-46fc6c7ca925


X-Qlik-Xrfkey: examplexrfkey123

X-Qlik-User: UserDirectory=INTERNAL; UserId=sa_api


but it is throwing error:


Postman.png

Please help me to find where I am wrong.


I like the power shell way but trying to know both one.


Thanks,

Rohit



Levi_Turner
Employee
Employee

RE the GUID: It's the GUID of the server you want to become the Central.

RE Postman: It's hard to tell, but here's a Support article on using Postman: https://qliksupport.force.com/articles/000045268

Hope that helps.

rohitk1609
Master
Master
Author

Thank Levi for your instant response. So, I just need to use the power shell script, update GUI, run power shell with admin account(service user) then execute the script. Do i need to restart the service or stop service before execution of script of such node which I want make master node ?

Regards,

Rohit

Levi_Turner
Employee
Employee

Correct, so long as the node is configured as a failover candidate.

rohitk1609
Master
Master
Author

Okay Levi, i will first stop services, then execute the script then start the services again.

Thanks,

Rohit

Levi_Turner
Employee
Employee

A service restart should not be needed, by the way.

rohitk1609
Master
Master
Author

services stop before execution of script is needed ?

Levi_Turner
Employee
Employee

No. The expected work-flow is: execute script, QRS API(s) handle the changes, end. There's no need to restart services on any node.