Rehearse the failover and failback of your solution on one computer: the redundant pair you deploy on two servers runs the same way in two Docker containers.
How-to → Solution Lifecycle How-to → Runtime → Redundancy Testing with Docker
Version 10.1.6+
The FrameworX runtime runs on .NET 10, and the same installation runs on Windows and on Linux. That portability makes a full hot-standby test possible on the computer you already develop on: two Linux containers, each with its own network address, form a real redundant pair, with the same switch-over, synchronization and replication as two physical servers.
With this setup you can:
Prerequisites
The containers run the real runtime, so the redundancy logic under test is the one you deploy. Some parts of a field installation are not in the picture, and they still need a test on the target servers.
Covered on one computer | Still to test on the target servers |
|---|---|
|
|
Two runtimes on the same Windows computer cannot form a pair, because both would listen on the same address. Docker solves it with a user-defined bridge network. Each container gets a fixed address on that network, 172.20.0.5 for the primary and 172.20.0.4 for the secondary. Each address is local to its own container, which is the condition for a node to take its role in the pair. See Redundancy in Docker Bridge Networks.
Each container runs two processes from your installation:
On your Windows computer, the two runtimes answer on ports 3101 (primary) and 3102 (secondary).
In Runtime → Startup, enable redundancy with IP1 172.20.0.5 and IP2 172.20.0.4, both on port 3101. Set Main Port to 3101 and clear Auto Ports. These container addresses are for the test: on site, IP1 and IP2 are the two servers.
The image copies the net10.0 and fx-10\net10.0 folders of your installation, so the pair runs exactly the version you deliver. Save the two files below in an empty folder.
On Linux the installation has no |
In that folder, build the image, pointing fxroot at the FrameworX folder of your installation:
docker buildx build --load --build-context fxroot="<installation folder>\FrameworX" -t fx-pair:10.1.6 . |
Save the Compose file in the same folder and start it. Each node keeps its solution, databases and trace files in its own volume.
|
docker compose up -d docker ps --filter name=fx- # both containers show (healthy) |
Both nodes run the same solution file. Copy it to both, start the primary, then the secondary:
docker cp .\Plant1.dbsln fx-primary:/app/Documents/FrameworX/Solutions/Plant1.dbsln docker cp .\Plant1.dbsln fx-secondary:/app/Documents/FrameworX/Solutions/Plant1.dbsln $fxArgs = '/solution:/app/Documents/FrameworX/Solutions/Plant1.dbsln /profile:1 /redundancy /ip1:172.20.0.5 /port1:3101 /ip2:172.20.0.4 /port2:3101 /connectiontimeout:3 /SaveLog:3' docker exec -d -w /app/FactoryStudio/fx-10 fx-primary sh -c "sleep infinity | dotnet TStartup.dll $fxArgs" Start-Sleep 20 docker exec -d -w /app/FactoryStudio/fx-10 fx-secondary sh -c "sleep infinity | dotnet TStartup.dll $fxArgs" |
/SaveLog:3 writes each node's trace to disk. This is how you read what the standby does.sleep infinity keeps the launcher running in the background.http://localhost:10109 for the primary and http://localhost:10110 for the secondary.Open Property Watch and Trace Window from the fx-10 folder of your installation, with /redundancy and both node addresses. The tools then follow the active node across every switch, as an operator client does. Without /redundancy, they stay on the first address after a failure:
& "<installation folder>\FrameworX\fx-10\PropertyWatch.exe" /redundancy /ip1:127.0.0.1 /port1:3101 /ip2:127.0.0.1 /port2:3102 & "<installation folder>\FrameworX\fx-10\TraceWindow.exe" /redundancy /ip1:127.0.0.1 /port1:3101 /ip2:127.0.0.1 /port2:3102 |
A standby server accepts no clients, so the tools always show the active node. The standby's side is in its trace files. The redundancy detail is in ExecutionLog_TServer_*.txt, in the Debug_* folder of each start. The files are UTF-16:
docker exec fx-secondary sh -c 'cd /app/Documents/FrameworX/TraceLogs; f=$(ls -t Debug_*/ExecutionLog_TServer_*.txt | head -1); iconv -f UTF-16 -t UTF-8 "$f" | grep -E "Pair connected|Activated"' |
Work through the table on your own solution. Each row is a question your customer will ask about the redundant system.
Test | How | Expected |
|---|---|---|
The pair forms | Start both nodes as in the setup. | In Property Watch, |
Takeover after a failure | Inject one failure on the active node (table below). | The standby becomes active within seconds. A process crash is detected fastest; a frozen server or a network loss takes longer, because the standby waits for the connection timeout. |
Values continue | Before the failure, note a few tag values, a retentive tag and a counter that a script increments. | The new active node continues from the synchronized values. Nothing restarts from zero. |
Scripts run once | Watch a script task that writes a tag or a log line. | It runs on the active node only, and resumes on the new active node after the switch. |
Alarms and history | Raise an alarm and log historian values across the switch, with alarm and historian replication enabled. | The new active node has the alarm state and the history recorded before the switch. |
Clients follow | Keep an operator client open during the failure, started with | The client connects to whichever node is active, and reconnects to the new active node on its own within seconds. Without |
Failback | Bring the failed node back (table below). | After a restart, the primary joins as standby, and |
Failure on site | Command | Bring it back |
|---|---|---|
Runtime crash |
| Start the primary again (step 4). |
Power loss |
|
|
Frozen server |
|
|
Network cable unplugged |
|
|
A server takes part in a switch only after one minute has passed since it started, rejoined its partner or switched. A switch requested earlier is not carried out, and no message says so. If a failback seems to do nothing, wait for the minute and request it again. |
| Symptom | Likely Cause | Next Step |
|---|---|---|
| Both nodes stay active, and nothing synchronizes. | The redundancy parameters were dropped at start, because IP1 and IP2 are not the container addresses. | Run docker exec fx-secondary ps -eo args: the TServer.dll line must carry /redundancy /ip1:172.20.0.5 /ip2:172.20.0.4. Correct IP1 and IP2 in the solution. |
| Both nodes report active for a few seconds after a freeze or a network loss. | Expected: the primary comes back while the secondary has taken over. | Wait. The secondary steps back to standby once the pair reconnects. |
| A commanded switch does nothing. | The one-minute wait after a start, rejoin or switch. | Request it again after the minute. |
| The solution does not start in the container. | The solution has a Windows target. | Set it to Multiplatform and copy it to both nodes again. |
| Property Watch or a client does not connect. | Main Port differs from 3101, or Auto Ports moved the port. | Set Main Port to 3101 and clear Auto Ports. |
| The runtime stops after 4 hours. | Evaluation mode. | Start it again, or license the containers from Solution Center. |
docker compose stop stops both nodes and keeps the solutions and databases in the volumes.docker compose down -v removes the containers and the volumes, so the next test starts from empty nodes.In this section...