-
-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add some retries to type mapping discovery? #1591
Labels
Comments
orangejulius
added a commit
that referenced
this issue
May 9, 2022
This adds a new config option, `api.targets.auto_discover_required`. If set to true, the API will quit with a fatal error if there is any problem performing the type mapping discovery. In practice what this means is a working Elasticsearch cluster with a valid Pelias index must exist and be properly configured in `pelias.json`, or the API won't start. This can actually be quite helpful in production environments as it can protect against misconfiguration issues such as using the wrong URL to the Elasticsearch cluster. Because the check is only performed once at startup, it won't cause the API to quit if there's an intermittent network issue or something similar later on. Connects #1591 Connects pelias/pelias#925
orangejulius
added a commit
that referenced
this issue
Jul 4, 2022
This adds a new config option, `api.targets.auto_discover_required`. If set to true, the API will quit with a fatal error if there is any problem performing the type mapping discovery. In practice what this means is a working Elasticsearch cluster with a valid Pelias index must exist and be properly configured in `pelias.json`, or the API won't start. This can actually be quite helpful in production environments as it can protect against misconfiguration issues such as using the wrong URL to the Elasticsearch cluster. Because the check is only performed once at startup, it won't cause the API to quit if there's an intermittent network issue or something similar later on. Connects #1591 Connects pelias/pelias#925
orangejulius
added a commit
that referenced
this issue
Jul 4, 2022
This adds a new config option, `api.targets.auto_discover_required`. If set to true, the API will quit with a fatal error if there is any problem performing the type mapping discovery. In practice what this means is a working Elasticsearch cluster with a valid Pelias index must exist and be properly configured in `pelias.json`, or the API won't start. This can actually be quite helpful in production environments as it can protect against misconfiguration issues such as using the wrong URL to the Elasticsearch cluster. Because the check is only performed once at startup, it won't cause the API to quit if there's an intermittent network issue or something similar later on. Connects #1591 Connects pelias/pelias#925
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A helpful but sometimes confusing part of the APIs behavior is that it queries Elasticsearch on startup to get the list of custom sources and layers.
We had a report from a Pelias user with custom layers that they were no longer seeing them after running
pelias compose down && pelias compose up
. It turned out that telling both the API and Elasticsearch to start up at the same time doesn't work. The API's initial query to Elasticsearch will fail, so it won't detect any custom sources and layers.While we have the
pelias elastic wait
command to help with this, the "safe" way to stop and start all Pelias components is rather verbose:pelias compose kill && pelias elastic start && pelias elastic wait && pelias compose up
.What if instead we added a couple retries to the API's Elasticsearch request? Elasticsearch usually starts up within a few seconds, and then the call to detect custom sources and layers would work fine.
The text was updated successfully, but these errors were encountered: