Configuring External Elasticsearch for API Gateway 10.2

webMethods API Gateway tutorial

Author: Jagadish, Dinesh (External)
Supported Versions: 10.2 & above

Please refer Configuring External Elasticsearch for API Gateway 10.1 for configuring external Elasticsearch for API Gateway version 10.1 and below

Overview of the tutorial

This tutorial explains how an Elasticsearch in an external system can be configured in API Gateway as back end data store instead of the readily available EventDataStore that is shipped with API Gateway.

Required knowledge

  • A basic understanding of API Gateway and its communication with EventDataStore for storing data
  • A basic understanding of Kibana and its communication with EventDataStore to retrieve analytics data for rendering dashboards in API Gateway

Why?

API Gateway ships with EventDataStore, a wrapper product over ElasticSeach 5.6.4 (as of API Gateway 10.2), for storing data. But in some cases the API Provider might need API Gateway to connect to an external Elasticsearch for storing data. For example the Provider might already have a licensed Elasticsearch and would like to use that for API Gateway instead of going with the EventDataStore. Another case is, the Provider needs to create a new API Gateway instance in the Integration Server. This would not create a new instance of EventDataStore for it as only one instance of EventDataStore will be installed and exist for all the instances of API Gateway in the same installation. In this case the Provider can install an Elasticsearch instance outside the product or in an external machine and use it for the newly created API Gateway instance.

Prerequisite steps

Complete the below prerequisite steps before configuring external Elasticsearch in API Gateway:

  • Install API Gateway advanced edition of version 10.2 and above
  • Install external Elasticsearch instance of versions above 5.6.x

Details

The below section explains the configuration details need for connecting API Gateway to an external Elastisearch instance.

Changing Kibana configurations to connect to Elasticsearch

Now we need to modify the Kibana server configurations to connect to the Elasticsearch for rendering dashboards in API Gateway.

Open uiconfiguration.properties file from the directory <SAG-Home>\profiles\IS_instance_name\apigateway\config. Set apigw.kibana.autostart to false.

Open kibana.yml file from the directory <SAG-Home>\profiles\IS_instance_name\apigateway\dashboard\config\kibana.yml . Set elasticsearch.url: http://<external elasticsearch host:port>, for e.g http://localhost:9200

Now start the Kibana manually by running the kibanat.bat in the location <SAG-Home>\profiles\IS_instance_name\apigateway\dashboard\bin.

Changing API Gateway configurations to connect to Elasticsearch

Follow the below steps to change the API Gateway configurations to connect to EventDataStore.

Go to <SAG_HOME>/IntegrationServer/instances/default/packages/WmAPIGateway/config/resources/elasticsearch and open config.properties file.

pg.gateway.elasticsearch.autostart=false
pg.gateway.elasticsearch.hosts=<external elasticsearch host:port>

After making the configurations, start the Elasticsearch. After Elasticsearch is up and running, start the API Gateway. Now you would be able to login to API Gateway, create APIs, and see the analytics page for dashboards.

Limitations

  • These configurations are applicable for API Gateway versions 10.2 and above. For 10.1 and below refer Configuring External Elasticsearch for API Gateway 10.1

References

Refer https://www.elastic.co/guide/en/elasticsearch/reference/5.6/zip-windows.html for Elasticsearch installation

Learn more