Transparent Elasticsearch proxy
In this scenario, Quesma is used as a transparent proxy between Kibana/OpenSearchDashboards(OSD) and Elasticsearch/OpenSearch.
Quesma installation
Prerequisites:
- Elasticsearch/OpenSearch is running.
- Kibana/OSD is running.
- Docker is installed, at least 20.10 version.
Installation steps:
- Create a configuration file named
quesma.yamlwith the following content, make sure to replace placeholders (#PLACE_YOUR*) with actual values.yamlfrontendConnectors: - name: elastic-ingest type: elasticsearch-fe-ingest config: listenPort: 8080 - name: elastic-query type: elasticsearch-fe-query config: listenPort: 8080 backendConnectors: - name: backend-elasticsearch type: elasticsearch config: url: #PLACE_YOUR_ELASTICSEARCH_URL_HERE, for example: http://192.168.0.7:9200 user: #PLACE_YOUR_ELASTICSEARCH_USERNAME_HERE password: #PLACE_YOUR_ELASTICSEARCH_PASSWORD_HERE processors: - name: my-noop-processor type: quesma-v1-processor-noop pipelines: - name: elasticsearch-proxy-read frontendConnectors: [ elastic-query ] processors: [ my-noop-processor ] backendConnectors: [ backend-elasticsearch ] - name: elasticsearch-proxy-write frontendConnectors: [ elastic-ingest ] processors: [ my-noop-processor ] backendConnectors: [ backend-elasticsearch ]
Note: To learn more about configuration options, refer to Configuration primer
- Run Quesma with the following command:bashYou now have a running Quesma instance running with Elasticsearch API endpoint on port 8080. You can also enable Quesma's admin panel at localhost:9999 by adding
docker run --name quesma -p 8080:8080 \ -e QUESMA_CONFIG_FILE=/configuration/quesma.yaml \ -v $(pwd)/quesma.yaml:/configuration/quesma.yaml quesma/quesma:latest-p 9999:9999to docker run command. - Reconfigure client endpoint
- For Kibana: Update your Kibana configuration, so that it points to Quesma Elasticsearch API endpoint mentioned above, instead of Elasticsearch original endpoint. In your Kibana configuration file, replace the
elasticsearch.hostsvalue with Quesma's host and port, e.g.:yamlor optionally useelasticsearch.hosts: ["http://localhost:8080"]ELASTICSEARCH_HOSTSenvironment variable. - For OpenSearchDashboards: modify
opensearch_dashboards.ymlfile and change theopensearch.hostsproperty.
- For Kibana: Update your Kibana configuration, so that it points to Quesma Elasticsearch API endpoint mentioned above, instead of Elasticsearch original endpoint. In your Kibana configuration file, replace the
- Restart Kibana/OSD.