You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Oliver Eilhard edited this page Jan 21, 2016
·
2 revisions
In the normal use case, you create one client in your application on startup. You then share this client throughout your application, elastic will automatically mark nodes as healthy or dead etc.
However, in restricted environments like App Engine, one cannot create such a shared client. You must create a new client for every request. So we cannot afford to keep Goroutines around and must make the creation of a client as efficient as possible.
So if you now create a new client with the sniffer and healthchecker disabled (SetSniff(false) and SetHealthcheck(false)), the NewClient function will skip most of the sanity checks it does on normal startup. It will also not start any Goroutines.
So to use elastic with restricted environments like App Engine, be sure to disable sniffer and healthchecker via the options SetSniff(false) and SetHealthcheck(false).
Here's an example from an elastic user on App Engine that happens to also use HTTP Basic Authentication: