Open yii-bot opened 8 years ago
This is not the typical use case.
Generally, a new node is set up at localhost. This node is part of the cluster, but does not store any data and never appoints itself master (the so-called client node). This local node forwards all requests to the cluster. The cluster is smart enough to handle failures of its data nodes.
Default Elasticsearch nodes are setup to act as data, master-eligible, and client nodes. Smaller clusters are not likely to dedicate a machine as a client node, that generally happens when traffic and data needs get much larger. Even at that point, it is likely that several client nodes will be setup to handle the incoming traffic / result parsing. which this enhancement would solve for.
This will hopefully be fixed by PR #104
This issue has originally been reported by @chuntley at https://github.com/yiisoft/yii2/issues/6377. Moved here by @cebe.
With ElasticSearch you can connect to any query against any node on the cluster. The way the Yii's ElasticSearch connection is setup you set an array of IP addresses of the nodes in your cluster, then Yii randomly chooses a server to connect to then begins running commands against it.
This is great, however ElasticSearch is designed to allow servers to fail on the cluster gracefully while others take over that server's responsibilities. Yii could randomly select a failed server, then report back that it is unable to connect to ElasticSearch. However this is not true, as any of the other servers in the connection string would be alive and active.
It would be a great addition to have Yii continue to try all nodes in the connection string before sending back a failure.