Proficy HMI - SCADA Cerver Redundancy
Proficy HMI - SCADA Cerver Redundancy
Proficy HMI - SCADA Cerver Redundancy
2
Server Redundancy Outline
Server Redundancy is the ability of having two servers acting together to run a
single project. They work in a Master/Slave pair with one node always acting as
the current hot standby to the other. When a failure is detected on the current
active master, then the slave asserts itself as the new master, and all client
applications (i.e. Viewers) transition their requests to the new master (with some
limitations).
3
Server Redundancy Simple Layout
Network
PLC
4
Server Redundancy Moderate Layout
Viewer
Network
PLC
5
Server Redundancy Complex Layout
Viewer PLC
Network A
Network B
CIMPLICITY Server CIMPLICITY Server
Primary Secondary
6
Server Redundancy Configuration Requirements
NOTE:
Prior to CIMPLICITY 5.0 this class/object did not exist. When upgrading a project
from a version prior to CIMPLICITY 5.0 or greater, it must be opened in the
Workbench, the Server Redundancy option must be removed, and then the
Server Redundancy option must be added.
This will add the new GefRedundancy class and Redundancy object.
7
Server Redundancy Configuration
NOTE:
As of Proficy HMI/SCADA – CIMPLICITY 7.0 or greater, you are allowed
to use a UNC path (i.e. \\computer\share) instead of a mapped network drive (i.e.
Z:\)
8
Server Redundancy Configuration Update
Primary Secondary
(Local) (Network Share)
Project Project
alarm_help alarm_help
arc arc
data data
lock lock
Copy/Config Update
log log
master
screens screens
scripts scripts
Project.gef Project.gef
• The folders for the project (with the exception of the /master folder)
are copied to the Secondary Network share.
• The files in the /data folder are modified so that the system knows
that this is a Secondary in a redundant pair (i.e. no modifications
allowed).
• The configuration update is done under the security context of the
Windows User who is using the Workbench on the Primary (relates
to Network Permissions).
9
Server Redundancy Functionality
10
Server Redundancy Core Processes
Primary Secondary
Logical Link
In order to achieve Server Redundancy CIMPLICITY has to make sure that all of
the core processes between the Primary and the Secondary are synchronized.
This means that they must have the same data and must be in the same state
with regards to that data. This is achieved by setting up Logical Links (i.e. direct
connections) between core processes on the nodes.
For each of these core processes there is a master process and slave process.
11
Server Redundancy - The RtrPing Process
The Primary and Secondary are constantly checking to make sure that the other
node is still there. They do this by using a process called “rtrping”. This is a
process that’s sole responsibility is to actively ping, and respond to pings, to/from
the other node in the redundant pair. If a ping does not come back in the
appropriate timeframe then an automatic failover is initiated.
They ping each other on TCP/IP port 4000 (by default). It is configurable to
change which port they ping each other on by changing the
REDUND_PROBE_PORT global parameter. There is further information in the
help files on this.
Primary Secondary
W32RTR W32RTR
Ping
RTRPing RTRPing
TCP/IP Port 4000 TCP/IP Port 4000
Ping
The RtrPing processes ping each other periodically to confirm that the other node
is still there and is still active
12
Server Redundancy Failover Time
The RtrPing utility will ping the other node every 5 seconds (by default). This time
is configurable by the REDUND_PROBE_INTERVAL global parameter. RtrPing
will wait for the time to be exceeded and then will go through the retries. The
number of retries is 1 more than the REDUND_PROBE_COUNT global
parameter (which has a default value of 3).
= REDUND_PROBE_INTERVAL * (REDUND_PROBE_COUNT + 1)
13
Server Redundancy Device Communications
The Device Communications driver is still actively polling the PLC on the slave,
but it’s updates are simply ignored by the Slave Point Management process.
NOTE:
In general this is true, but there are exceptions to this for Unsolicited
communications and OPC Client.
14
Server Redundancy - Device Communications Overview
Poll Poll
PLC
Update Update
Primary Secondary
15
Server Redundancy - Device Communications Detail
Poll Poll
PLC
1
Slave Device
Master Device
2 Communications
Communications
Update Update
4
Primary Secondary
3. The Master PTM Process receives the update and sends it out on the
wire to the slave PTM process.
5. The Slave PTM process receives the update from the Master PTM
Process and uses this update to update its client processes.
16
Server Redundancy - Event Manager Behavior
• Event Manager runs on both the master and the slave at the same
time.
• Setpoint requests are always ignored on the Slave EMRP/PTM
process
• Scripts on the Slave execute just like they would on the Master
node.
• A check should be put into the scripts to validate whether or not the
script is executing on the master. If not, then ideally it should
terminate, or do something innocuous. This is entirely at the
discretion of the user’s programming.
NOTE:
There is a function called “CimIsMaster()” that can be used in scripting to
detect if it is executing on the current master.
17
Server Redundancy - Event Manager Detail
Poll Poll
PLC
1
Slave Device
Master Device
Communications
Communications
Primary Secondary
1. Both Device Communications drivers poll the PLC. The Master Device
Communications driver processes the update and passes it to the Master
Point Management (PTM) Process via the Device Communications Queue
(DCQ).
2. The Master PTM Process receives the update and sends it out on the wire
to the Slave PTM process.
3. The Master EMRP process runs whatever is configured in it. Set points
are written to the Master PTM process.
4. The Slave EMRP process runs (just like the master) and executes.
However, all set point requests are ignored.
18
Server Redundancy - Viewer Communication
19
Server Redundancy - Viewer Communication
UDP Broadcast
Router (W32RTR) Cache
Project Computer Version
Master
UDP Broadcast
Node: Primary `
Project: CIMPROJ
Version: 6.1.5383
Viewer
Slave
Node: Secondary
Project: CIMPROJ
Version: 6.1.5383
Step 1
A Redundant Server pair starts up. Immediately the Master starts to
broadcast its information onto the network via a UDP Broadcast (port
32000).
20
Server Redundancy - Viewer Communication
Node: Primary `
Project: CIMPROJ
Version: 6.1.5383
Viewer
Slave
Node: Secondary
Project: CIMPROJ
Version: 6.1.5383
Step 2
The Viewer updates its cache with the relevant data and directs its PTM
communications to the active master.
21
Server Redundancy - Viewer Communication
Node: Primary `
Project: CIMPROJ
Version: 6.1.5383
Viewer
Master
Node: Secondary
Project: CIMPROJ
Version: 6.1.5383
Step 3
The Secondary transitions to be the master due to a failover
22
Server Redundancy - Viewer Communication
Slave
Node: Primary `
Project: CIMPROJ
Version: 6.1.5383
UDP Broadcast Viewer
Master
Node: Secondary
Project: CIMPROJ
Version: 6.1.5383
Step 4
The Secondary starts to broadcast his UDP broadcast, with the
updated computer name.
23
Server Redundancy - Viewer Communication
Slave
Node: Primary `
Project: CIMPROJ
Version: 6.1.5383
Viewer
Viewer PTM
Master
Communications
Node: Secondary
Project: CIMPROJ
Version: 6.1.5383
Step 5
The Viewer detects the change and redirects its PTM communications to
the new active master.
24
Server Redundancy - Viewer Communication Limitations
NOTE:
This is NOT recommended and should only be considered for special situations.
This broadcast will go out once every 90 seconds by default, unless a Viewer
requests it sooner. When a viewer receives the broadcast it will connect to both
of the servers in the redundant pair via a TCP/IP connection and directs it’s PTM
requests to the current active master. When a failover occurs, the new master
immediately starts to broadcast and the slave will halt broadcasting. The Viewers
local PTM process then directs it’s activities to the new active Master.
25
Server Redundancy - Database Logging
26
Server Redundancy - Database Logger
The Data logging capability of a Server Redundant pair is generally not very well
understood. This is mainly due to the fact that the Data logger prompts you for all
of the DSN’s to be used on the primary and the secondary.
27
Server Redundancy - Database Logging
Primary Secondary
Logical Link
28
Server Redundancy - Database Logger
Why configure the DSN’s on both nodes if only one of them is ever going to
actually be used on each node?
NOTE:
Remember that you aren’t actually allowed to make project configuration
changes on the secondary.
2. The Primary will actually talk to the Secondary’s Database (and vice
versa), but only by a utility called “Datamerge”, and not by the core logging
processes.
29
Server Redundancy – DataMerge Utility
The Datamerge utility is used to synchronize the Databases between the Primary
and the Secondary servers. When one of the Servers in the redundant pair is
stopped or goes down, and then restarts, it will have a gap in it’s SQL Database
for the time period it was down. The Datamerge utility will review the time period
that the Server was down and attempt to migrate the missing data to/from the
local database to the other Server’s database.
NOTE:
The only way the utility can know where both databases are is if the ODBC
DSN’s are configured identically on both of them.
Network
Primary Secondary
Master Slave
ONLINE ONLINE
Step 1
30
Server Redundancy – DataMerge Utility
Network
Create
File
Primary Secondary
Master Slave
ptnr_<timestamp>.log
OFFLINE ONLINE
Step 2:
31
Server Redundancy – DataMerge Utility
Append
Network
File
Primary Secondary
Slave Master
ptnr_<timestamp>.log
ONLINE ONLINE
Step 3
32
Server Redundancy – DataMerge Utility
Datamerge
ptnr_011520071200.log
Primary Secondary
Master Slave
Step 1
The datamerge utility launches and reads the timeframe from all of the
ptnr_*.log files.
33
Server Redundancy – DataMerge Utility
Query
Primary Database Secondary Database
Data
Network
ptnr_011520071200.log
Primary Secondary
Master Slave
Step 2
The Datamerge utility queries the data from the local Database and inserts
the results into the remote Database for the time specified in the ptnr_*.log
file(s).
34
Server Redundancy Pitfalls
35
Server Redundancy Pitfalls
Never start both the Primary and Secondary at the exact same
time
This is an issue, as the pings may not be properly processed until the project is
completely started. This can cause the two servers to fight for control (fail over
back and forth) because they both believe the other isn’t running. Start the
master, let it finish, and then start the slave.
36