Bug #25935 linux install w/ DNS can mean ndbd hostnames resolve locally to 127.0.0.1
Submitted: 30 Jan 2007 5:02 Modified: 5 Mar 2007 7:44
Reporter: Sean Pringle Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.0.32 OS:Linux (Linux)
Assigned to: Jon Stephens CPU Architecture:Any

[30 Jan 2007 5:02] Sean Pringle
Description:
In setting up MySQL Cluster, a default Red Hat Linux based install (tested on CentOS and Fedora) creates an /etc/hosts file, eg:

127.0.0.1   hostname.domain hostname localhost.localdomain localhost

And an /etc/resolv.conf file, eg:

search domain
nameserver IP

In this case, the short form "hostname" would resolve to 127.0.0.1 on the local node, and a public IP on other nodes.

This means a syntactically correct config.ini file can be created using short form hostnames and result in ndbd nodes connecting successfully to the management server, but getting stuck waiting for other data nodes to connect.

How to repeat:
- Install CentOS specifying *.cluster hostnames manually.

- Setup DNS for mgm.cluster, ndb1.cluster, ndb2.cluster.

- Create a config.ini file using short form hostnames for data nodes, eg:

[NDB]
hostname=ndb1

[NDB]
hostname=ndb2

- Start both data nodes and see cluster log fill up as they each use 127.0.0.1 locally:

[MgmSrvr] INFO -- Node 1: Initial start, waiting for 0000000000000004 to connect, nodes [ all: 0000000000000006 connected: 0000000000000002 no-wait: 0000000000000000 ]
[MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000002 to connect, nodes [ all: 0000000000000006 connected: 0000000000000004 no-wait: 0000000000000000 ]

Suggested fix:
This behavior is obviously quite logical, but it can be a trap and is not (?) mentioned in the manual.

The management node already rejects a mix of localhost and other hostnames, but obviously it cannot tell the contents of other node's /etc/hosts to check for localhost aliases.  Maybe simply emphasize this /etc/hosts setup as a potential trap in the manual and suggest fully qualified hostnames be used in config.ini.
[30 Jan 2007 11:36] Valeriy Kravchuk
Looks like a reasonable documentation request.
[5 Mar 2007 7:44] Jon Stephens
Discussed with Sean on IRC.

Update appears as a Note in http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-multi-computer.html (and in the equivalent pages in the 4.1 and 5.0 versions as well).
[5 Mar 2007 7:45] Jon Stephens
Problems with commits db today - changeset was mysqldoc rev 5166