3 Replies Latest reply on Apr 3, 2013 3:46 PM by Gregor

    Using multiple Pi Servers




      I have created a service (in C# using PISDK) that connects to a single Pi Server.


       I create the connection like this:

      PISDK.PISDK pi = new PISDK.PISDK();
      Servers servers = pi.Servers;
      string piServerHost = Config.getString("piServerHost");
      server = servers[piServerHost];

      This gives me a connection to 1 server, which is kept open until the application quits (can run for weeks/months).


      Is there a way to specify multiple servers (primary and secondary) such that it will transparently switch over to the secondary server if the primary server isn't available?




        • Re: Using multiple Pi Servers

          Hi David,


          If your servers are configured a PI High Availability collective. the failover or switch between the collective members are taken care of by PI SDK. You do not have to explicitly handle it in your application. 


          If you are new to this idea of a PI HA Collective, I would suggest that you look at this document in the vCampus Library

            • Re: Using multiple Pi Servers

              Hello David and Han Yong,


              To my knowledge PISDK.Servers is not collective aware. When using the Server object the application will connect to a dedicated PI Server node.


              Please use the IPICollective interface when your application is supposed to support PI High Availability (HA). The IPICollective interface has all the necessary methods to i.e. check if an entry in Known Servers Table (KST) refers a HA Collective or a single PI Server node. It knows the Collective members and provides the ability to switch over to another member.


              For details, please PI-SDK Help (pisdk.chm). It is installed along with PI SDK in the %PIHOME%\Help

                • Re: Using multiple Pi Servers

                  Hello David and Han Yong,


                  I recognize that I was mistaken. The PISDK is collective aware and has been since version 1.3.4.


                  A collective is treated as a single unit and the PISDK connects to the best PI Collective member. Only one member of the collective may be connected at a time, unless memberOpen is used (which is exclusive to collective, or normal mode).