Let's talk about the steps we need to take to configure our failover pair. In the previous
lesson you'd have configured an interface instance on PIINT02 matching the configuration of PIINT01.
To configure these as a failover pair we need to create the shared folder for the
synchronization file. We'll host this on PIINT02. There's positives and negatives to placing the
file in different locations but really the most important thing is that it's a location that is
easily accessible by both interface machines, never create it on the PI data archive though
kind of defeats the purpose of this whole thing. Then we configure universal interface or unit
failover on both interfaces indicating that one has an id of one and the other has an id of two
Then we test, we'll run both interfaces and check their statuses and then shut the primary down
ensuring the secondary takes over and data is still flowing. Now here we are on PISRV01
we've got data flowing looks fantastic. Let's take a look at our interfaces,
we have PIINT01 here, I’ve actually got this stopped so we're stopped here and uh naughty me
I haven't got my scrolling log running so I’ll get that running here and let's see PIINT02.
I’ve got this one running. So let's see a scrolling log here all right we'll use that later.
So we can see that PIINT02 is running it's feeding data into the data archive and we're all good.
Now let's configure interface failover. Step number one will be to create our shared file.
So let's do that, we're going to go into windows file explorer,
we're going to create a shared folder on d drive I’m going to create a new folder here
and this will be called interface failover. I’m going to share it so go into properties,
go into sharing and advanced sharing,
I’d like to share this folder with the name interface failover and give some permissions.
So the permissions I’d like to give is the service account that runs both our interfaces.
our interfaces on PIINT01 and zero two should be running under the same account
so we need to give that account permission to modify this. So we can add.
Right now it's not searching for service accounts so only to go into object types
and check service accounts okay. Now I can search for underneath PISCHOOL svc
PIINT okay it's found it, great I’m going to give this full control.
I want it to be able to really do anything it likes to this folder. Okay,
okay on that and then we should be good.
Right next step is to configure our interfaces to be a failover pair.
So I'm first going to configure my interface here on PIINT02,
let's go into failover, enable union failover we're going to call this
give it the id of two our other one will be the id of one and we can browse for that
and we see that we've got two interfaces it's recognized that are running,
I'm going to choose the one on PIINT01. Okay so very important
this is really the only difference in the configuration of these two
I'm on PIINT02 here so I give the id for this interface as two and it's addressed to PIINT02
the id of the other interface is one and it's PIINT01. The failover type is going to be hot
and we have some tags here that haven't been created,
these are tags on the PI data archive that the interfaces will write to. They'll write
their status and their heartbeat and some other tags we'll take a look at.
So I'm going to right click and create the digital state set, for UFO status,
we're successful and then right click and create all points.
Oh one last thing we haven't configured our synchronization file path so I've
got to browse here then I'm going to choose the folder, the shared folder that we just created,
so right at the top I'm going to type in slash PIINT02 slash interface failover it's right there
and okay there it is. I'm going to apply this
and okay. Now I'm going to restart the interface.
Once we restart it we can see any changes in log messages that come up.
So first off we've got some problems. It says here that it's having trouble writing out to
our status points. That's because we just created them but by default their security doesn't allow
this account to write to them so we need to go into the PI data archive and change that,
otherwise I think we're looking pretty good. The interface attempts to assume the primary role
it says that the other one, its pair, failover pair
is not available which is expected because we haven't configured it yet
and otherwise I think we're good, so let's clear that security issue first.
Let's go up into the PI data archive. Let's go into,
let's go into point builder and then find these synchronization points that we just created.
So we're going to do a tag search inside point builder and search for asterisk UFO asterisk.
UFO stands for unit failover and here's our synchronization points.
We'll select all and go okay.
So the issue we had that was occurring is because the interface cannot write to these points and it
needs to. We can go into security and see that the settings don't allow our interface service account
to write to these points. Now we can go into each one individually one by one and go add but
it's just easier to use excel and point builder.
So go and open Microsoft excel, make a blank workbook
and then let's go into PI builder, PI points, find PI points and grab our UFO points here.
So we're searching for all points with UFO in the name and okay on that
so let's clear all and the only thing we need to change is the security.
So let's find that. Let's grab data security and point security.
Okay strictly speaking we only really need to give the account
data security so let's add an extra identity onto here svc PIINT is going to have read
write access. I'm going to copy this down and we should be good so we're going to publish
and use edit mode and we're complete. Now we can see if our change took effect.
Looks like it cleared our post errors that's great I'm going to restart it again for good measure.
This is looking a lot nicer, no more errors
really the only error we get is that the failover pair is not available the secondary.
Let's fix that let's go to our PIINT01 and configure it.
So we go down to failover on PIINT01 enable it, failover id of this interface is going to be one
and then we'll browse and select PIINT02. It says the other interface is already configured
make sure that the configuration is identical and we've done that okay excellent.
Now we're switching to hot
we don't need to create the tags again because they've already been created from our other
configuration but we do need to type in the synchronization file path. So we go to browse
and up the top in the address bar I'm going to type in backslash backslash
PIINT02 backslash and interface failover is there already.
Okay I'm going to select the dat file inside and open. There we go,
applying let's give this a start and see what happens
okay I think we're looking good let's look up in the log and see what's happening here.
So right here failure is initialized and the current state of this interface is backup,
that's what we expect the other interface is completely healthy,
it was working we started this one it sees that the first one's healthy and it just resumes the
backup role. It'll just sit there not sending data through to the PI data archive and waiting
until something goes wrong with the other. Let's take a look at what our status tags look like.
So over on the PI data archive I'm going to go into system management tools
then into current values and then I got to search for these same UFO tags. Well first off all our
tags are still updating that's fantastic looks like that's working, let's go to tag search,
I'm going to search for asterisk UFO asterisk. Here they all are select all go okay.
So we've got our number two interface is currently primary, our number one is currently backup
the heartbeats are updating we don't see updates every second that's fine that's expected
but they're updating and our device statuses are both zero. Zero means good, any number apart
from zero here would indicate that something else is happening apart from smooth running.
We also see the active id is number two. Now let's go and cause an intentional problem.
Let's shut down our PIINT02 so I'm going to stop it
and then go to PIINT01 and we'll watch the log.
It says very quickly that the other interface doesn't have a good status so it attempts to
be primary and it resumes the primary role. Let's take a look at what these status tags
look like now okay. So our status of number one is primary our status of number two is off.
Device status of two is 99 indicates that it's shut down gracefully and our active one
is number one, we also see that the heartbeat of number two is zero it's not increasing.
There's one last step to really ensuring our interface's reliability,
the last scenario is that if the interface is restarted and the PI data archive is not
available where does it get its tag list well right now it can't start it needs to wait for
the PI data archive to become available again. But we can help that along, we can get the interface
to load tags from an internal cache so let's quickly switch that on. So let's go to PIINT01,
in fact a PIINT02 is off already let's take advantage of that
and do this whole thing without getting any data loss. We need to go to disconnected startup
we need to enable disconnected startup, select the location for point cache I'm going to browse
and interfaces is just fine for us here we'll go okay and after that we're going to apply.
After we apply we're just going to go ahead and start the interface.
Okay we now have a local cache. Let's go ahead and do the same thing to PIINT01,
we've got flexibility to do this now and restart the interface willy-nilly because we've got
redundant interfaces. So we can go to disconnected startup, enable it, choose the path, apply
and restart.
So in this lesson we configured interface failover and disconnected startup. We've
really made our interfaces significantly more robust. They're very resistant to
network outages and to applications crashing, windows updates, restarts of the server.
We shouldn't lose data as long as one of them is up and active.