Configuring Elasticsearch Connection Settings

About this task

This section provides information about configuring internal or external Elasticsearch for API Gateway.

To configure Elasticsearch

Procedure

  1. In Command Central, navigate to Environments > Instances > All > API Gateway > Configuration.
  2. Click Elasticsearch from the drop-down menu. The Elasticsearch section appears.
  3. Provide Tenant name.
  4. Select one of the following values in the Auto start field:
    • Yes - if you are using internal Elasticsearch.
    • No - if you are using external Elasticsearch.
  5. Provide the Host and Port of the server where the Elasticsearch (external or internal) is running, in the Transport section.
  6. If the Elasticsearch is protected with basic authorization, provide the user name and password in the Authentication section.
  7. If the Elasticsearch is protected with HTTPS, perform the following in the SSL section:
    1. Select the Enable check box.
    2. Provide valid Keystore and Truststore details.
  8. Provide additional configurations that defines the API Gateway's connectivity to Elasticsearch in the Additional Information section.
  9. Save your changes.
    The Pending restart value is changed to true and Status is Enabled.
  10. Restart the API Gateway instance.
    The Elasticsearch details are updated in API Gateway.

Configuring External Elasticsearch using Template

About this task

You can configure external Elasticsearch using the following Command Central template:

sagcc exec templates composite import -i cc-minimal-es.yaml

sagcc exec templates composite apply cc-minimal-es nodes=local ssl_username=username ssl_password=password
eshost=eshost esport=esport keystore_location=your_keystore_location keystore_alias=alias_of_keystore
truststore_location=your_truststore_location truststorealias=your_truststore_alias
truststore_password=truststorepassword

Sample external Elasticsearch configuration template

alias: elasticsearch-alias
description: Elastic search configuration

layers:
  runtime:
    templates:
     - cc-minimal-es

templates:
  cc-minimal-es:
    products:
      integrationServer:
        default:
          configuration:
            OSGI-IS_apigateway-WmAPIGateway:
              APIGATEWAY-ELASTICSEARCH:
                APIGATEWAY-ELASTICSEARCH:
                  '@alias': Elasticsearch
                  autostart: 'false'
                  tenantId: apigateway
                  Auth:
                    '@type': SSL
                    User: ${ssl_username}
                    Password: ${ssl_password}
                  Transport:
                    Host: ${eshost}
                    Port: ${esport}
                  SSL:
                    Enable: 'true'
                    HostnameVerification: 'false'
                    KeystoreLocation: ${keystore_location}
                    KeystoreAlias: ${keystore_alias}
                    TruststoreLocation: ${truststore_location}
                    TruststoreAlias: ${truststore_alias}
                    TruststorePassword: ${truststore_password}
                  ExtendedProperties:
                    Property:
                      - '@name': clientHttpResponseSize
                        $: '1024'
                      - '@name': connectionTimeout
                        $: '10000'
                      - '@name': keepalive
                        $: '10'
                      - '@name': keepAliveConnectionsPerRoute
                        $: '1000'
                      - '@name': maxRetry
                        $: '10000'
                      - '@name': socketTimeout
                        $: '10000'
                      - '@name': sniffEnabled
                        $: 'true'
                      - '@name': sniffTimeInterval
                        $: '5000'

provision:
  default:
    runtime: ${nodes}