dhiaayachi / temporal

Temporal service
https://docs.temporal.io
MIT License
0 stars 0 forks source link

Connect to a multi-node Elasticsearch cluster #276

Open dhiaayachi opened 2 months ago

dhiaayachi commented 2 months ago

Is your feature request related to a problem? Please describe. I have an Elasticsearch cluster with no load balancer, so I must specify more than one host when creating a client.

Describe the solution you'd like I'd like to specify multiple hosts in the Elasticsearh config. This should be easy since elastic.SetURL already accepts (url string...). However, it requires changing the configuration file format.

dhiaayachi commented 2 months ago

Thank you for your feature request!

Currently, Temporal's Elasticsearch configuration doesn't support specifying multiple hosts directly in the configuration file. However, you can work around this by using the elastic.SetURL function with multiple host URLs:

client, err := elasticsearch.NewClient(elasticsearch.Config{
    // ... other config options
}, elastic.SetURL("http://host1:9200", "http://host2:9200", "http://host3:9200"))

This way, you can still configure your Elasticsearch client with multiple hosts without modifying the configuration file format.

dhiaayachi commented 2 months ago

Thanks for your feature request!

It sounds like you're looking for a way to specify multiple hosts in the Elasticsearch configuration without having to change the file format. Currently, the elastic.SetURL method accepts a variadic argument (...string), but this requires updating the configuration file.

While we don't have a direct way to specify multiple hosts within the configuration file format yet, you can use the elastic.SetURL method with the elastic.URL struct. This allows you to define a list of URLs within the configuration file.

Here's an example:

elastic:
  urls:
    - "http://host1:9200"
    - "http://host2:9200"

Let us know if this workaround helps or if you have any other questions!

dhiaayachi commented 2 months ago

Thank you for your feature request! I understand you would like to specify multiple hosts in the Elasticsearch config when using Temporal.

While we don't currently support specifying multiple hosts directly in the Elasticsearch configuration file, you can work around this by using the elastic.SetURL function with multiple URLs. For example:

elastic.SetURL("http://host1:9200", "http://host2:9200")

This will allow you to connect to your Elasticsearch cluster without a load balancer.

We appreciate your feedback and will consider adding this functionality to future versions of Temporal.

dhiaayachi commented 2 months ago

Thank you for your feature request!

Currently, the Temporal Elasticsearch sink configuration does not support specifying multiple hosts directly in the configuration file.

To address this, you can use the following workaround:

  1. Configure a load balancer: Using a load balancer in front of your Elasticsearch cluster allows you to specify a single endpoint in the Temporal configuration.
  2. Use environment variables: Define the Elasticsearch host URLs as environment variables and access them in your Temporal configuration.

We appreciate your feedback and will consider adding support for specifying multiple hosts in future releases.