This example needs to access an SQL node as well as a management node.
If I'm reading the source correctly, the first argument is a mysqld socket, and the second is a cluster connection string, the syntax for which is documented
here. Note that this is for connection to a management server.
In addition, you need a "free" ndbapi slot in the cluster configuration to allow the NDB API application to connect.
BTW, it's not necessary to have a management server running on every host; a single management server is all that's required. You can set up 2 management servers for redundancy, but I can't really think of a reason why you'd need more than that.
Also I'd suggest you use IP addresses rather than host names (excepting "localhost", which should work on most systems). MySQL Cluster doesn't perform host name resolution on its own, it gets this information from the host system, so you'd need to have these set up in the hosts files on every host in the cluster, or by using DNS.
Documentation for the example can be found
here. I'm adding some additional notes to it which I hope will prove helpful.
cheers,
Jon Stephens
MySQL Documentation Team @ Oracle
MySQL Dev Zone
MySQL Server Documentation
Oracle
Edited 2 time(s). Last edit at 05/11/2015 05:03AM by Jonathan Stephens.