Elasticsearch

Elasticsearch #

Defining a Resource #

INFINI Gateway supports multi-cluster access and different versions. Each cluster serves as one Elasticsearch back-end resource and can be subsequently used by INFINI Gateway in multiple locations. See the following example.

elasticsearch:
- name: local
  enabled: true
  endpoint: https://127.0.0.1:9200
- name: dev
  enabled: true
  endpoint: https://192.168.3.98:9200
  basic_auth:
    username: elastic
    password: pass
- name: prod
  enabled: true
  endpoint: http://192.168.3.201:9200 
  discovery:
    enabled: true
    refresh:
      enabled: true
      interval: 10s
  basic_auth:
    username: elastic
    password: pass

The above example defines a local development test cluster named local and a development cluster named dev. Authentication is enabled in the development cluster, in which corresponding usernames and passwords are also defined. In addition, one production cluster named prod is defined, and the auto node topology discovery and update of the cluster are enabled through the discovery parameter.

Parameter Description #

NameTypeDescription
namestringName of an Elasticsearch cluster
enabledboolWhether the cluster is enabled
endpointstringElasticsearch access address, for example, http://localhost:9200
endpointsarrayList of Elasticsearch access addresses. Multiple entry addresses are supported for redundancy.
schemastringProtocol type: http or https
hoststringElasticsearch host, in the format of localhost:9200. Either the host or endpoint configuration mode can be used.
hostsarrayElasticsearch host list. Multiple entry addresses are supported for redundancy.
request_timeoutintRequest timeout duration, in seconds
request_compressboolWhether to enable Gzip compression
basic_authobjectAuthentication information
basic_auth.usernamestringUsername
basic_auth.passwordstringPassword
discoveryobjectCluster discovery settings
discovery.enabledboolWhether to enable cluster topology discovery
discovery.refreshobjectCluster topology update settings
discovery.refresh.enabledboolWhether to enable auto cluster topology update
discovery.refresh.intervalstringInterval of auto cluster topology update
traffic_controlobjectNode-level overall traffic control of the cluster
traffic_control.max_bytes_per_nodeintMaximum allowable number of request bytes per second
traffic_control.max_qps_per_nodeintMaximum allowable number of requests per second, regardless of read or write requests