HTTP(s) Failover Concepts for REST, OPC UA Server, and Web Management in the OPC Router
What Is Failover?
This chapter deals exclusively with external failover for HTTP(s)-based interfaces of the OPC Router, i.e., for the REST API and Web Management, as well as for access to the integrated OPC UA Server, provided that this access is made available via the Web Management endpoint.
Failover ensures that, in the event of a server failure, requests are automatically redirected to another available server. This is typically achieved using a reverse proxy, which uses health checks to determine which endpoint of a redundancy pair is currently active.
This failover supplements the internal OPC Router redundancy but does not replace it. The redundancy controls which OPC Router is active. The HTTP(s) failover additionally ensures that clients can continue to reach this active OPC Router at a stable address.
When This Chapter Applies
This chapter applies when external clients need to always access a REST endpoint, the integrated OPC UA server, or the web management interface of the active OPC Router at the same address.
If, on the other hand, you want to configure the internal role distribution, project synchronization, heartbeats, or certificates for OPC router redundancy, use the pages on Redundancy. The reverse proxy configurations described here build upon an already established redundancy setup.
The configuration examples shown in this chapter specifically refer to the REST scenario. The basic principle can be applied analogously to web management. If access to the integrated OPC UA server occurs via the OPC router’s web management endpoint, this HTTP(S) path can also be integrated into a reverse proxy failover. This chapter does not include a separate example of native OPC UA failover via opc.tcp. For native OPC UA failover via opc.tcp, the client should support OPC UA client redundancy accordingly.
Use Case Example for Failover with OPC Router Redundancy
Situation
The two OPC Routers in a redundancy pair provide the same REST endpoint.
The following sample projects show the configuration for the primary and secondary services.
Requirement
The REST endpoint must be reliably accessible at a fixed address. Requests to this address should be automatically forwarded to the currently active OPC Router in the redundancy pair.
Solution
A reverse proxy, such as Nginx, is configured so that requests to a fixed address can be forwarded to both OPC Routers. Health checks are used to determine which endpoint is currently active. Only this endpoint should accept requests.
The following describes the configuration of such a failover for an OPC Router redundancy pair using Nginx and Traefik.
Related Pages
The specific implementation is described on the following subpages: