3

I am trying to configure MySQL cluster under three Windows 7 machines with disabled firewall, cluster information is like the following:

  • 2 hosts with each running 1 data node

  • 3rd host running management node and 2 MySQL Servers (MySQLD)

  • MySQL cluster application has been downloaded from http://dev.mysql.com/downloads/cluster/

  • On each machine I have created two folder inside C:\MySQL_Cluster\My_Cluster\ with the following names: conf and data

  • Data folder from the previous step has been copied from MySQL cluster application data folder.

  • the MySQL server application has been also configured in the environment variable

  • MySQL config file has contain the following:

    [ndbd default]
    noofreplicas=2
    datadir=C:\MySQL_Cluster\My_Cluster\data

    [ndbd]
    hostname=host_nod_1
    Nodeid=2

    [ndbd]
    hostname=host_nod_2
    Nodeid=3

    [ndb_mgmd]
    Nodeid=1
    hostname=host_management

    [mysqld]
    Nodeid=101
    hostname=host_management

    [mysqld]
    Nodeid=102  
    hostname=host_management
  • My.cnf contain the following:

My1.cnf:

[mysqld]
ndb-nodeid=101
ndbcluster
datadir=C:\MySQL_Cluster\My_Cluster\data\mysqld_1
Port=1111
ndb-connectstring=host_management:1186

My2.cnf:

    [mysqld]
        ndb-nodeid=101
        ndbcluster
        datadir=C:\MySQL_Cluster\My_Cluster\data\mysqld_1
        Port=2222
        ndb-connectstring=host_management:1186
  • to start the management node I used the following command:
    C:\mysql\cluster\bin>ndb_mgmd --initial -f C:\MySQL_Cluster\My_Cluster\conf\config.ini --configdir=C:\MySQL_Cluster\My_Cluster\conf
  • to start data nodes I used the following command on each node:

       C:\mysql\cluster\bin>ndbd -c host_management:1186 --initial
  • to start API node (MySQL node) I used the following commands:

C:\>MySQL_Cluster\My_Cluster\data\mysqld_1> mysqld --install My1111 --defaults-file="C:\MySQL_Cluster\My_Cluster\conf\my1111.cnf"
***************************************************************************************************************
C:\>MySQL_Cluster\My_Cluster\data\mysqld_2> mysqld --install My2222 --defaults-file="C:\MySQL_Cluster\My_Cluster\conf\my2222.cnf"
  • when I checked management using the following command it retains the result:
C:\mysql\cluster\bin>ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)]     2 node(s)
id=2    @host_nod_1  (mysql-5.6.15 ndb-7.3.4, Nodegroup: 0, *)
id=3    @host_nod_2  (mysql-5.6.15 ndb-7.3.4, Nodegroup: 0)

[ndb_mgmd(MGM)] 1 node(s)
id=1    @host_management  (mysql-5.6.15 ndb-7.3.4)

[mysqld(API)]   2 node(s)
id=4 (not connected, accepting connect from host_management)
id=5 (not connected, accepting connect from host_management) 
  • if I connect for example to MySQL1 and create a table:
create table test.t1(id int) ENGINE=NDBCLUSTER;

I've got the following error and warnings:

ERROR 157 (HY000): Could not connect to storage engine
Warning | 1296 | Got error 4009 'Cluster Failure' from NDB. Could not acquire
global schema lock
Warning | 1296 | Got error 4009 'Cluster Failure' from NDB
Warning | 1296 | Got error 4009 'Cluster Failure' from NDB

what did I miss in my configuration?

Edit adding hostname.err

2014-12-24 14:28:25 808 [Warning] NDB : Tables not available after 30 seconds.  Consider increasing --ndb-wait-setup value
2014-12-24 14:52:52 808 [Warning] NDB: Could not acquire global schema lock (4009)Cluster Failure
2014-12-24 14:55:22 808 [Warning] NDB: Could not acquire global schema lock (4009)Cluster Failure
2014-12-24 14:55:22 a34 InnoDB: Error: Table "mysql"."innodb_table_stats" not found.
2014-12-24 14:55:49 808 [Warning] NDB: Could not acquire global schema lock (4009)Cluster Failure

bumped to the homepage by Community 2 days ago

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

  • Your mysql (api) nodes are not connected so only innodb and other engines will be available – KCD Oct 12 '15 at 4:59
0

If you have had a previous version of MySQL server installed, can you run where mysqld in a command prompt to make sure that you're running the MySQL Cluster version of the mysqld binary and not the 'normal' mysqld binary?

Since your management node and SQL nodes both seem to reside on the same machine, you could try changing the config.ini to:

[mysqld]
HostName = 127.0.0.1 

instead of

[mysqld]
hostname = host_management

And the SQL Node my.cnf files to:

[mysqld]
ndb-connectstring=127.0.0.1:1186

instead of

[mysqld]
ndb-connectstring=host_management:1186

This might rule out some networking issues.

EDIT: this only works if all hostnames in the config resolve to localhost, meaning you can only use localhost addresses/hostnames in a single server setup.

Also, your management node is showing slots for NodeId's 4 and 5 for the SQL nodes, which doesn't match the definitions in your current config. You could try removing the NodeId configuration from either the SQL Node my.cnf files or the config.ini

You need to perform a rolling restart for the config changes to take effect. As noted by RolandoMySQLDBA, be careful about the --initial

Note: Placing all SQL nodes on the management node machine is not a recommended setup because it creates a single point of failure in your cluster. You could consider placing the SQL nodes on the data node machines.

  • Additionally, with the currently shown my.cnf for the data nodes, the MySQL servers should not be able to start, as they share datadirs and other configs. – jynus Jan 5 '15 at 12:02
  • @lennardtvdd I changed the configuration to contain localhost, and when I tried to start the management nod I have error message: ERROR -- at line 21: Mixing of localhost (default for [NDBD]HostName) with other hostname is illegal – Ahmad Abuhasna Jan 5 '15 at 15:31
  • Did you try changing all of the references to the management node's hostname? Also in the [ndb_mgm] section? – lennartvdd Jan 5 '15 at 20:19
  • Ah.. using localhost seems to be bad advise sorry.. Seems to only be possible in a single server setup – lennartvdd Jan 5 '15 at 20:44
  • Can you look at the sql server error log(s) for for lines containing "NDB:" and post them here? By default you will find this file as host_name.err in the data directory. Specifically after (re)starting your mysql server (sql node) – lennartvdd Jan 5 '15 at 21:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.