Open jimlindeman opened 5 years ago
Hi @jimlindeman I've never heard of this before. You're welcome to make a pull request with the implementation you're looking for. How to contribute is https://github.com/mysqljs/mysql#contributing
Also @jimlindeman is this something different from the pool cluster feature? https://github.com/mysqljs/mysql#poolcluster
It looked like pooling was for master/slave designations (i.e. talking with specific hosts behind a haproxy layer)
Gotcha. So what exactly is different from that and what you want? Example is just master / slavem you can call them whatever you want and balance across multiple hosts. Seems to me exactly the same as the elasticsearch ezample you gave just different syntax. So is it just you want the syntax to be identical to eslaticsearch one or is there a behavior that is different?
If you don't want to describe exactly what you need created, then you can make a pull request, otherwise I have no idea what you're asking to get implemented at this point.
Okay, if there isn't a designated master/slave hierarchy with that, which the pooling example confused me to think there was, I'll try experimenting with using that pooling like:
var poolCluster = mysql.createPoolCluster(); poolCluster.add('HA-1, haConfig[0]); // add a named configuration poolCluster.add('HA-2', haConfig[1]); poolCluster.add('HA-3', haConfig[2]); var pool = poolCluster.of('*'); pool.query(function (error, results, fields) {});
And always happy to take pull requests to improve docs! All the pool cluster docs were written by the original person who contributed the pool cluster implementation.
Some commercial mysql offerings not only offer a haproxy frontend to their mysql server cluster, but also implement >1 haproxy URLs (to HA the haproxy layer). Such is the case with Compose.com's mysql offering (currently beta).
Is there a plan for the configuration options to support a hosts parameter to override the host parameter, which takes in an array of host strings? This is the approach used by other nodejs drivers like elasticsearch: https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/auth-reference.html#_https_ssl