Elasticsearch
The driver for Elasticsearch is community-supported and is not supported by Cube or the vendor.
To connect to an Elasticsearch database, use CUBEJS_DB_URL
with the username and password embedded in the URL, if required.
If you're not using Elastic Cloud, you must specify
CUBEJS_DB_ELASTIC_QUERY_FORMAT
.
For a self-hosted Elasticsearch instance, add the following to a .env
file in
your Cube project:
CUBEJS_DB_TYPE=elasticsearch
CUBEJS_DB_URL=https://my.elasticsearch.host:9200
CUBEJS_DB_ELASTIC_QUERY_FORMAT=json
For an Elasticsearch instanced hosted by Elastic.co, add the
following to a .env
file in your Cube project:
CUBEJS_DB_TYPE=elasticsearch
CUBEJS_DB_URL=https://my.elasticsearch.host:9200
CUBEJS_DB_ELASTIC_APIKEY_ID=VuaCfGcBCdbkQm-e5aOx
CUBEJS_DB_ELASTIC_APIKEY_KEY=ui2lp2axTNmsyakw9tvNnw
Environment Variable | Description | Possible Values | Required | Supports multiple data sources? |
---|---|---|---|---|
CUBEJS_DB_URL | The URL for a database | A valid database URL for Elasticsearch | ✅ | ✅ |
CUBEJS_DB_ELASTIC_QUERY_FORMAT | By default, queries return data in JDBC format, but you can also return data in standard Elasticsearch JDBC, JSON, CSV, YAML or raw formats (only JSON and JDBC are currently supported) | json , jdbc | ❌ | ✅ |
CUBEJS_DB_ELASTIC_OPENDISTRO | If true , then use the Open Distro for Elasticsearch | true , false | ❌ | ✅ |
CUBEJS_DB_ELASTIC_APIKEY_ID | ID of the API key from elastic.co | A valid Elastic.co API key ID | ❌ | ✅ |
CUBEJS_DB_ELASTIC_APIKEY_KEY | Value of the API key from elastic.co | A valid Elastic.co API key value | ❌ | ✅ |
CUBEJS_CONCURRENCY | The number of concurrent connections each queue has to the database. Default is 2 | A valid number | ❌ | ❌ |
CUBEJS_DB_MAX_POOL | The maximum number of concurrent database connections to pool. Default is 8 | A valid number | ❌ | ✅ |
Cube does not require any additional configuration to enable SSL as Elasticsearch connections are made over HTTPS.
Did you find this page useful?