API Gateway 10.11 | Administering API Gateway | Container-based Provisioning | 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 API Gateway Cluster Configuration.
2. Configure Terracotta Server Array.
Note:
This configuration step is required only if your API Gateway cluster uses TSA.
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, API Data Store (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 API Data Store
Although API Gateway clusters with externalized Elasticsearch is the preferred approach, you can also cluster API Gateway all-in-one containers. The clustering can be configured using Apache Ignite or Terracotta Server Array.
Note:
Having external Kibana is an optional variation.
Peer-to-peer clustering using Apache Ignite
The following diagram depicts peer-to-peer clustering using Apache Ignite.
The all-in-one containers hold API Gateway, Kibana, and Elasticsearch. The clustering is done using Apache Ignite and the cluster capabilities of the embedded Elasticsearch instances.
Inject the required settings for the cluster configuration during Docker run through an environment file.
A sample environment file when clustering is done through Apache Ignite looks as follows.
apigw_cluster_aware=true
apigw_cluster_name=APIGatewayCluster
apigw_cluster_ignite_hostnames=apigw1,apigw2,apigw3
apigw_cluster_ignite_discoveryPort=10100
apigw_cluster_ignite_communicationPort=10400
Clustering using Terracotta Server Array
The following diagram depicts clustering using TSA.
The all-in-one containers hold API Gateway, Kibana, and Elasticsearch. The clustering is done using a TSA and the cluster capabilities of the embedded Elasticsearch instances.
Inject the required settings for the cluster configuration during Docker run through an environment file.
A sample environment file when clustering is done through Terracotta server array 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 cluster can be peer-to-peer, or based on TSA, and it communicates to a cluster of Elasticsearch containers through a load balancer. The Elasticsearch load balancer also provides the Elasticsearch endpoint for the Kibana containers.
Note:
The externalized Kibana is optional. You can still run Kibana within the API Gateway container.
Peer-to-peer clustering using Apache Ignite
To cluster API Gateway with external containers for Elasticsearch, Kibana, and Apache Ignite, you can inject the settings into an API Gateway Docker image when starting, by providing an environment file. The environment file has to define the following environment variables.
apigw_cluster_aware=true
apigw_cluster_name=name
apigw_cluster_ignite_hostnames=comma-separated list of host names
apigw_cluster_ignite_discoveryPort=port
apigw_cluster_ignite_communicationPort=port
apigw_elasticsearch_hosts=host:port
apigw_elasticsearch_http_username=user
apigw_elasticsearch_http_password=password
apigw_kibana_dashboardInstance=instance
A sample assignment of environment variables looks as follows:
apigw_cluster_aware=true
apigw_cluster_name=APIGatewayCluster
apigw_cluster_ignite_hostnames=apigw1,apigw2,apigw3
apigw_cluster_ignite_discoveryPort=10100
apigw_cluster_ignite_communicationPort=10400
apigw_elasticsearch_hosts=testhost1:9200
apigw_elasticsearch_http_username=
apigw_elasticsearch_http_password=
apigw_kibana_dashboardInstance=http://testhost1:9405
Clustering using Terracotta Server Array
To cluster the API Gateway with external containers for Elasticsearch, Kibana, and TSA, you can inject the settings into an API Gateway Docker image when starting by providing an environment file. The environment file has 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