Software AG Products 10.7 | Configuring API Gateway | Docker Configuration | API Gateway Container Cluster Configuration
 
API Gateway Container Cluster Configuration
You can combine API Gateway Docker containers to form a cluster.
To configure an API Gateway Docker container cluster:
1. Configure loadbalancer on the Docker host.
The custom loadbalancer is installed on the Docker host. For more details on setting up the load balancer, see Configuring an API Gateway Cluster.
2. Configure Terracotta Server Array.
API Gateway requires a Terracotta Server Array installation. For details, see webMethods Integration Server Clustering Guide and Terracotta documentation ( https://www.terracotta.org/). The Terracotta Server Array on its own can be deployed as a Docker container.
3. Create the basic API Gateway Docker image.
For details on creating the API Gateway Docker image, see Building the Docker Image for an API Gateway Instance .
4. Create cluster API Gateway Docker image and enhance it with the cluster configuration in one of the following ways:
*Clustered all-in-one containers that consist of API Gateway, Elasticsearch, and Kibana.
*Clustered API Gateway containers with externalized Elasticsearch and Kibana containers.
Clustered all-in-one Containers that consist of API Gateway, Kibana and Elasticsearch
Although API Gateway clusters with externalized Elasticsearch is the preferred approach API Gateway all-in-one containers can also be clustered.
Note:
Having external Kibana is an optional variation.
The following diagram depicts clustering based on all-in-one containers.
The all-in-one containers hold API Gateway, Kibana and Elasticsearch. The clustering is done through a Terracotta Server Array and the cluster capabilities of the embedded Elasticsearch instances.
The required settings for the cluster configuration can be injected during Docker run through an environment file. A sample environment file looks as follows.
apigw_cluster_tsaUrls=tc:9510
apigw_terracotta_license_filename=terracotta-license.key
apigw_cluster_discoverySeedHosts=apigw1:9340,apigw2:9340,apigw3:9340
apigw_cluster_initialMasterNodes=apigw1_master
Clustered API Gateway Containers with externalized Elasticsearch and Kibana containers
The API Gateway containers are clustered. They are talking to a clustered Terracotta Server Array container and to a cluster of Elasticsearch container through a loadbalancer. The Elasticsearch loadbalancer is also providing the Elasticsearch endpoint for the Kibana containers.
Note:
The externalized Kibana is optional. You can still run Kibana within the API Gateway container.
To cluster the API Gateway with external containers for Elasticsearch, Kibana, and Terracotta Server Array, the settings can be injected into an API Gateway Docker image when starting by proving an environment file. The environment file needs to define the following environment variables.
apigw_cluster_tsaUrls=host:port
apigw_terracotta_license_filename=license-key-filename

apigw_elasticsearch_hosts=host:port
apigw_elasticsearch_http_username=user
apigw_elasticsearch_http_password=password

apigw_kibana_dashboardInstance=instance
A sample assignment of the environment variables looks as follows.
apigw_cluster_tsaUrls=tc:9510
apigw_terracotta_license_filename=terracotta-license.key

apigw_elasticsearch_hosts=testhost1:9200
apigw_elasticsearch_http_username=
apigw_elasticsearch_http_password=

apigw_kibana_dashboardInstance=http://testhost1:9405