# Cluster Discovery

The discovery system behind Comrade is pretty simple.\
During startup the service lists the content of **clusters** (configurable) folder and load all the files that ends with .json.\
Each json have the connection information for a single cluster. Comrade uses the [official python client of elasticsearch](https://elasticsearch-py.readthedocs.io/en/master/) and the **params** key passed directly to Elasticsearch connection constructor.

### Examples

#### Http plain connection

```javascript
{
    "name": "clustername",
    "params": {
        "hosts": ["http://3.219.233.212:9200"]
    }
}
```

#### SSL and auth

```javascript
{
    "params":  {
        "hosts": ["localhost", "otherhost"],
        "http_auth": ["user", "secret"],
        "scheme": "https",
        "port": 443
    }
}
```

More examples [here](https://elasticsearch-py.readthedocs.io/en/master/#ssl-and-authentication)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://moshe-1.gitbook.io/comrade/configuration/cluster-discovery.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
