I'm prototyping some code for elasticsearch use in a product and using elastisch (so far).
I have not done my homework yet for anything HA related but I know I need to set it up, and while playing with the elastisch client I noticed one thing that surprised me, namely, that a call to 'connect' appears to be lazy. E.g.
(defonce conn (es/connect [[el-host 9300]] {"cluster.name" cluster-name}))
This was just for playing around. One time I executed the code but had no ES server running, and there was no error whatsoever by the connect call.
- Should the connect have failed suine the host was unreachable?
- Since the connect did not fail, does that mean we're not really keeping a connection open to the ES node between client API calls on the connection, and therefore paying a performance penalty?
- Does a real connection established on the first API activity that requires it cause a persistent connection to be open?
- Once a persistent connection is open what is the proper technique for detecting connection failure and redirecting the connection to an alternate ES node?
Tips appreciated, thanks.