Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

jonasheisterkam
Contributor III

How to restart one QVS-cluster-node with QMSAPI

Hi,

i wrote a code to restart QVSs. But it is not able to differ between the cluster nodes, how can I implement it.

QMSClient Client;

Client = new QMSClient("BasicHttpBinding_IQMS");

string key = Client.GetTimeLimitedServiceKey();

ServiceKeyClientMessageInspector.ServiceKey = key;

ServiceInfo[] MyQVS = Client.GetServices(ServiceTypes.QlikViewServer);

for (int i = 0; i < MyQVS.Length; i++)

{

//If this is the one

//{

Client.RestartQVS(MyQVS.ID);

//}

}

In other part of the code I parse the qvsstatus.aspx page to detect the QVSs I need to restart.

Is there code to get this status from the api? I found some status functions in the object list but I'm not able to run it.

Thanks

Jonas

1 Reply
jonasheisterkam
Contributor III

Re: How to restart one QVS-cluster-node with QMSAPI

For the status of each cluster i found a solution, but not for the restart.

Status:

Guid[] MyQVSID = new Guid[MyQVS.Length];

            for (int i = 0; i < MyQVS.Length; i++)

            {

                MyQVSID = MyQVS.ID;

            }

            ServiceStatus[] QVSStatus = Client.GetServiceStatuses(MyQVSID);

            for (int i = 0; i < QVSStatus.Length; i++)

            {

                Console.WriteLine("Service Status:" + QVSStatus.ID + " " + QVSStatus.Name + " " + QVSStatus.Url.DnsSafeHost.ToString() + " " + QVSStatus.ServiceComposition.ToString());

                ServiceStatusDetail[] MSD = new ServiceStatusDetail[QVSStatus.MemberStatusDetails.Length];

                MSD = QVSStatus.MemberStatusDetails;

                for (int j = 0; j < MSD.Length; j++)

                {

                    Console.WriteLine("Service Status Detail:" + MSD.ID + " " + MSD.Host+ " " +MSD.Status.ToString());

                    string[] Message = new string[MSD.Message.Length];

                    Message = MSD.Message;

                    for (int k = 0; k < Message.Length; k++)

                    {

                        Console.WriteLine("Service Status Detail Message:" +  Message);

                    }

                }

            }

        }

Community Browser