MySQL Cluster Setup

Discussion in 'HOWTO-Related Questions' started by rwillie6, Nov 10, 2007.

  1. rwillie6

    rwillie6 New Member

    Nevermind, figured it out! See below for problem and solution.

    I'm following the tutorial on setting up a load balanced MySQL cluster on 4 machines. So far, I have the management server set up, and I have the 2 data nodes set up. Here's the problem:

    ndb_mgm> show;
    Connected to Management Server at: localhost:1186
    Cluster Configuration
    ---------------------
    [ndbd(NDB)] 2 node(s)
    id=2 @xxx.xxx.xxx.242 (Version: 5.0.45, starting, Nodegroup: 0)
    id=3 @xxx.xxx.xxx.243 (Version: 5.0.45, starting, Nodegroup: 0)

    [ndb_mgmd(MGM)] 1 node(s)
    id=1 (Version: 5.0.45)

    [mysqld(API)] 2 node(s)
    id=4 (not connected, accepting connect from any host)
    id=5 (not connected, accepting connect from any host)

    but it SHOULD be this:

    ndb_mgm> show;
    Connected to Management Server at: localhost:1186
    Cluster Configuration
    ---------------------
    [ndbd(NDB)] 2 node(s)
    id=2 @xxx.xxx.xxx.242 (Version: 5.0.45, Nodegroup: 0, Master)
    id=3 @xxx.xxx.xxx.243 (Version: 5.0.45, Nodegroup: 0)

    [ndb_mgmd(MGM)] 1 node(s)
    id=1 @xxx.xxx.xxx.241 (Version: 5.0.45)

    [mysqld(API)] 2 node(s)
    id=4 @xxx.xxx.xxx.242 (Version: 5.0.45)
    id=5 @xxx.xxx.xxx.243 (Version: 5.0.45)

    So, basically, my 2 data storage nodes are not connected in the mysqld section, but are connected in the ndbd section.

    My config.ini on the management server is:

    [ndbd default]
    NoOfReplicas=2

    [mysqld default]
    [ndb_mgmd default]
    [tcp default]

    # Section for the cluster management node
    [ndb_mgmd]
    # IP address of the management node (this system)
    HostName=216.147.203.241

    # Section for the storage nodes
    [ndbd]
    # IP address of the first storage node
    HostName=216.147.203.242
    DataDir=/var/lib/mysql-cluster

    [ndbd]
    # IP address of the second storage node
    HostName=216.147.203.243
    DataDir=/var/lib/mysql-cluster

    # one [MYSQLD] per storage node
    [mysqld]
    HostName=216.147.203.242

    [mysqld]
    HostName=216.147.203.243

    I also tried it without explicitly listing the hosts in the mysqld sections above, but that produced the same results. Both of my data nodes have the following /etc/my.cnf:

    [mysqld]
    ndbcluster
    ndb-connectstring=216.147.203.241

    [mysql_cluster]
    ndb-connectstring=216.147.203.241

    The problem turned out to be that one of the two storage nodes had a firewall which was preventing communication.
     
    Last edited: Nov 10, 2007

Share This Page