
In this blog let us see how to achieve High Availability for SAP CPI service using cross-region failover configuration. The method shown here is not only limited to failover configuration but can also be used to distribute traffic optimally for high responsiveness. The same can be applied to other SAP Cloud Platform Services too.
If you haven't yet, I suggest reading this blog How to crash your iflows and watch them failover beautifully by martin-pankraz. An excellent article detailing why failover is required and how to achieve it using Azure Front Door. His blog also saves me some writing effort to explain the same and hence let's jump directly into the Solution.
The solution is to run two SAP CPI instances in a different region and load balance them with Azure Traffic Manager. Azure Traffic Manager is a DNS based load balancing solution and supports six different routing methods as documented here. The proposed solution below is based on the Priority routing method.
High Availability Setup
The easiest part here is spinning two tenants, while the difficult part is having them both in synch always i.e.maintaining the same version of Interface, same configuration values, credentials, Trust Certificates, Client Authentication Certificates etc. This can be done manually (everytime), however, I choose to enhance the Command line tool released here SAP CPI : Artifact Extractor – Command Line Utility to download and upload Package from Primary to Secondary, similarly apply the IFlow configuration from Primary to Secondary tenant, with a help a custom IFlow download the Security Artifacts with password from Primary and create/update them in Secondary, Download the Trust Certificate and create/update them in Secondary etc. Most of these operations were done leveraging the Platform APIs. I'm looking to publish this version of the tool too in near future.
Read my previous blog SAP CPI – How to Configure Custom Domain to create a custom domain for SAP CPI primary and secondary tenant. It's important to have the same custom domain name in the both primary and secondary tenant.
We need to set-up a ping kind of service in SAP CPI for Azure Traffic Manager to check if the configured Tenant is reachable. This heartbeat result will enable Azure Traffic Manager to determine the availability and latency to the SCPI tenant and thus decide which tenant should the DNS resolution happen to.
Set-up a simple iflow and control access to it using a custom role of your choice. It's advised to create a new role a not share it with other productive interfaces.
Tenant Ping IFlow
Maintain Customer Header Setting with SAP CPI Custom Domain Host. This is because in this step-2 & 3 we will only maintain the SSL Hostname and in step-4 just the HTTP path to SCPI Health Check Interface. So Traffic manager will perform the Health Check Interface all performing an HTTP get to SSL HOST with the configured path (which is wrong). So this custom header setting will send additionally the hostname of SAP IFL application to SSL Host which will route the message to correct CPI IFL Application.
The approach defined here with Azure Traffic Manager is for Push based interface i.e. Interfaces listening to HTTP traffic. Pull/Interface Polling from a Message Broker / Event Streaming Platform is to be approached differently.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |