List:Cluster« Previous MessageNext Message »
From:Jon Stephens Date:May 9 2011 12:23pm
Subject:Re: MySQL Cluster Installation
View as plain text  
It looks like you're running the mysql client on the data node host (.2).

There's no reason to do this that I can tell: Even if there's a mysqld 
running on .2, it doesn't connect to the cluster because there's no 
matching [mysqld] section in the config.ini file -- so, if you're 
connecting to a mysqld running on the same machine (.2), it's not doing 
you any good, since the only mysqld that's connected to the cluster is 
connecting from .4.

cheers

jon.

On 09/05/11 13:23, k wrote:
>
> Hi Jon,
>
> when i am creating table with data using ndb in sql node it is not
> available in storage nodes;
>
> SQL Node (10.10.1.4):-
>
> mysql> show processlist;
>
> +----+-------------+-----------+------+---------+------+-----------------------------------+------------------+
> | Id | User        | Host      | db   | Command | Time | State
>                    | Info             |
>
> +----+-------------+-----------+------+---------+------+-----------------------------------+------------------+
> |  1 | system user |           |      | Daemon  |    0 | Waiting for
> event from ndbcluster | NULL             |
> | 13 | root        | localhost | NULL | Query   |    0 | NULL
>                     | show processlist |
>
> +----+-------------+-----------+------+---------+------+-----------------------------------+------------------+
> 2 rows in set (0.00 sec)
>
>
>
> mysql> SHOW GLOBAL STATUS LIKE 'ndb%';
> +--------------------------------+---------------+
> | Variable_name                  | Value         |
> +--------------------------------+---------------+
> | Ndb_cluster_node_id            | 4             |
> | Ndb_config_from_host           | 10.10.1.1     |
> | Ndb_config_from_port           | 1186          |
> | Ndb_number_of_data_nodes       | 2             |
> | Ndb_number_of_ready_data_nodes | 2             |
> | Ndb_connect_count              | 3             |
> | Ndb_execute_count              | 0             |
> | Ndb_scan_count                 | 0             |
> | Ndb_pruned_scan_count          | 0             |
> | Ndb_cluster_connection_pool    | 1             |
> | Ndb_conflict_fn_max            | 0             |
> | Ndb_conflict_fn_old            | 0             |
> +--------------------------------+---------------+
> 12 rows in set (0.00 sec)
>
> mysql> SHOW ENGINE NDB STATUS;
>
> +------------+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
> | Type       | Name                  | Status
>
>
>            |
>
> +------------+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
> | ndbcluster | connection            | cluster_node_id=4,
> connected_host=10.10.1.1, connected_port=1186, number_of_data_nodes=2,
> number_of_ready_data_nodes=2, connect_count=3
>                       |
> | ndbcluster | NdbTransaction        | created=2, free=2, sizeof=328
>
>
>           |
> | ndbcluster | NdbOperation          | created=4, free=4, sizeof=960
>
>
>           |
> | ndbcluster | NdbIndexScanOperation | created=0, free=0, sizeof=1168
>
>
>            |
> | ndbcluster | NdbIndexOperation     | created=0, free=0, sizeof=968
>
>
>           |
> | ndbcluster | NdbRecAttr            | created=0, free=0, sizeof=88
>
>
>            |
> | ndbcluster | NdbApiSignal          | created=16, free=16, sizeof=144
>
>
>           |
> | ndbcluster | NdbLabel              | created=0, free=0, sizeof=200
>
>
>           |
> | ndbcluster | NdbBranch             | created=0, free=0, sizeof=32
>
>
>            |
> | ndbcluster | NdbSubroutine         | created=0, free=0, sizeof=72
>
>
>            |
> | ndbcluster | NdbCall               | created=0, free=0, sizeof=24
>
>
>            |
> | ndbcluster | NdbBlob               | created=0, free=0, sizeof=496
>
>
>           |
> | ndbcluster | NdbReceiver           | created=0, free=0, sizeof=144
>
>
>           |
> | ndbcluster | NdbLockHandle         | created=0, free=0, sizeof=48
>
>
>            |
> | ndbcluster | binlog                | latest_epoch=379129648119808,
> latest_trans_epoch=343618858516497,
> latest_received_binlog_epoch=379129648119808,
> latest_handled_binlog_epoch=379129648119808, latest_applied_binlog_epoch=0 |
>
> +------------+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
> 15 rows in set (0.00 sec)
>
> mysql>
>
>
>
>
> Data Node 1 (10.10.1.2):-
>
> mysql> show processlist;
>
> +----+-------------+-----------+------+---------+-------+---------------------------------+------------------+
> | Id | User        | Host      | db   | Command | Time  | State
>                    | Info             |
>
> +----+-------------+-----------+------+---------+-------+---------------------------------+------------------+
> |  1 | system user |           | NULL | Daemon  | 17349 | Waiting for
> ndbcluster to start | NULL             |
> |  6 | root        | localhost | NULL | Query   |     0 | NULL
>                   | show processlist |
>
> +----+-------------+-----------+------+---------+-------+---------------------------------+------------------+
> 2 rows in set (0.00 sec)
>
> mysql> SHOW ENGINE NDB STATUS;
>
> +------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
> | Type       | Name                  | Status
>
>                                     |
>
> +------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
> | ndbcluster | connection            | cluster_node_id=0,
> connected_host=10.10.1.1, connected_port=1186, number_of_data_nodes=0,
> number_of_ready_data_nodes=0, connect_count=0 |
> | ndbcluster | NdbTransaction        | created=1, free=1, sizeof=328
>
>                                    |
> | ndbcluster | NdbOperation          | created=1, free=1, sizeof=960
>
>                                    |
> | ndbcluster | NdbIndexScanOperation | created=0, free=0, sizeof=1168
>
>                                     |
> | ndbcluster | NdbIndexOperation     | created=0, free=0, sizeof=968
>
>                                    |
> | ndbcluster | NdbRecAttr            | created=0, free=0, sizeof=88
>
>                                     |
> | ndbcluster | NdbApiSignal          | created=16, free=16, sizeof=144
>
>                                    |
> | ndbcluster | NdbLabel              | created=0, free=0, sizeof=200
>
>                                    |
> | ndbcluster | NdbBranch             | created=0, free=0, sizeof=32
>
>                                     |
> | ndbcluster | NdbSubroutine         | created=0, free=0, sizeof=72
>
>                                     |
> | ndbcluster | NdbCall               | created=0, free=0, sizeof=24
>
>                                     |
> | ndbcluster | NdbBlob               | created=0, free=0, sizeof=496
>
>                                    |
> | ndbcluster | NdbReceiver           | created=0, free=0, sizeof=144
>
>                                    |
> | ndbcluster | NdbLockHandle         | created=0, free=0, sizeof=48
>
>                                     |
> | ndbcluster | binlog                | latest_epoch=0,
> latest_trans_epoch=0, latest_received_binlog_epoch=0,
> latest_handled_binlog_epoch=0, latest_applied_binlog_epoch=0          |
>
> +------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
> 15 rows in set (0.00 sec)
>
> mysql>  SHOW GLOBAL STATUS LIKE 'ndb%';
> +--------------------------------+---------------+
> | Variable_name                  | Value         |
> +--------------------------------+---------------+
> | Ndb_cluster_node_id            | 0             |
> | Ndb_config_from_host           | 10.10.1.1     |
> | Ndb_config_from_port           | 1186          |
> | Ndb_number_of_data_nodes       | 0             |
> | Ndb_number_of_ready_data_nodes | 0             |
> | Ndb_connect_count              | 0             |
> | Ndb_execute_count              | 0             |
> | Ndb_scan_count                 | 0             |
> | Ndb_pruned_scan_count          | 0             |
> | Ndb_cluster_connection_pool    | 1             |
> | Ndb_conflict_fn_max            | 0             |
> | Ndb_conflict_fn_old            | 0             |
> +--------------------------------+---------------+
> 12 rows in set (0.00 sec)
>
> mysql>
>
>
>
>
> Data node 2 (10.10.1.3)
>
> mysql> show processlist;
>
> +----+-------------+-----------+------+---------+-------+---------------------------------+------------------+
> | Id | User        | Host      | db   | Command | Time  | State
>                    | Info             |
>
> +----+-------------+-----------+------+---------+-------+---------------------------------+------------------+
> |  1 | system user |           | NULL | Daemon  | 17467 | Waiting for
> ndbcluster to start | NULL             |
> |  3 | root        | localhost | NULL | Query   |     0 | NULL
>                   | show processlist |
>
> +----+-------------+-----------+------+---------+-------+---------------------------------+------------------+
> 2 rows in set (0.00 sec)
>
> mysql>  SHOW ENGINE NDB STATUS;
>
> +------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
> | Type       | Name                  | Status
>
>                                     |
>
> +------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
> | ndbcluster | connection            | cluster_node_id=0,
> connected_host=10.10.1.1, connected_port=1186, number_of_data_nodes=0,
> number_of_ready_data_nodes=0, connect_count=0 |
> | ndbcluster | NdbTransaction        | created=1, free=1, sizeof=328
>
>                                    |
> | ndbcluster | NdbOperation          | created=1, free=1, sizeof=960
>
>                                    |
> | ndbcluster | NdbIndexScanOperation | created=0, free=0, sizeof=1168
>
>                                     |
> | ndbcluster | NdbIndexOperation     | created=0, free=0, sizeof=968
>
>                                    |
> | ndbcluster | NdbRecAttr            | created=0, free=0, sizeof=88
>
>                                     |
> | ndbcluster | NdbApiSignal          | created=16, free=16, sizeof=144
>
>                                    |
> | ndbcluster | NdbLabel              | created=0, free=0, sizeof=200
>
>                                    |
> | ndbcluster | NdbBranch             | created=0, free=0, sizeof=32
>
>                                     |
> | ndbcluster | NdbSubroutine         | created=0, free=0, sizeof=72
>
>                                     |
> | ndbcluster | NdbCall               | created=0, free=0, sizeof=24
>
>                                     |
> | ndbcluster | NdbBlob               | created=0, free=0, sizeof=496
>
>                                    |
> | ndbcluster | NdbReceiver           | created=0, free=0, sizeof=144
>
>                                    |
> | ndbcluster | NdbLockHandle         | created=0, free=0, sizeof=48
>
>                                     |
> | ndbcluster | binlog                | latest_epoch=0,
> latest_trans_epoch=0, latest_received_binlog_epoch=0,
> latest_handled_binlog_epoch=0, latest_applied_binlog_epoch=0          |
>
> +------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
> 15 rows in set (0.00 sec)
>
> mysql>  SHOW GLOBAL STATUS LIKE 'ndb%';
> +--------------------------------+---------------+
> | Variable_name                  | Value         |
> +--------------------------------+---------------+
> | Ndb_cluster_node_id            | 0             |
> | Ndb_config_from_host           | 10.10.1.1     |
> | Ndb_config_from_port           | 1186          |
> | Ndb_number_of_data_nodes       | 0             |
> | Ndb_number_of_ready_data_nodes | 0             |
> | Ndb_connect_count              | 0             |
> | Ndb_execute_count              | 0             |
> | Ndb_scan_count                 | 0             |
> | Ndb_pruned_scan_count          | 0             |
> | Ndb_cluster_connection_pool    | 1             |
> | Ndb_conflict_fn_max            | 0             |
> | Ndb_conflict_fn_old            | 0             |
> +--------------------------------+---------------+
> 12 rows in set (0.00 sec)
>
> mysql>
>
> i follow this document
> http://www.zealkabi.com/2007/06/mysql-cluster-installation-and.html
>
> <http://www.zealkabi.com/2007/06/mysql-cluster-installation-and.html>please
> help me
>
> thank you
>
> On Mon, May 9, 2011 at 12:26 PM, Jon Stephens <jon.stephens@stripped
> <mailto:jon.stephens@stripped>> wrote:
>
>
>     Looks like you're trying to run mysqld processes on hosts that
>     aren't configured for them.
>
>
>      > [mysqld]
>      > hostname=10.10.1.4
>
>     with no other [mysqld] or [api] sections in the config.ini file
>     means "the cluster [data nodes] will accept connections from a
>     mysqld process running on host 10.10.1.4 only".
>
>     Also, it appears you're trying to create the same database/table
>     more than once.
>
>
>     On 09/05/11 08:44, kranthi wrote:
>
>         We have set up the Mysql Cluster and we follow the following steps
>
>         one management node and 2 data nodes and one sql node
>
>         The my.cnf files in Data node ‘A’, Data node ‘B’,SQL
> node were
>         updated with
>         following
>
>
>         [mysqld]
>         ndbcluster
>         ndb-connectstring=10.10.1.1
>
>         [mysql_cluster]
>         ndb-connectstring=10.10.1.1
>
>
>         Management Node config.ini:-
>
>
>
>         [ndbd default]
>         NoOfReplicas=2
>         DataMemory=80M
>         IndexMemory=18M
>
>         [ndb_mgmd]
>         hostname=10.10.1.1
>         datadir=/var/lib/mysql-cluster
>         [ndbd]
>         hostname=10.10.1.2
>         datadir=/usr/local/mysql/data
>
>         [ndbd]
>         hostname=10.10.1.3
>         datadir=/usr/local/mysql/data
>
>         [mysqld]
>         hostname=10.10.1.4
>
>         copy the config.ini file in 2 data nodes:-
>
>         scp config.ini 10.10.1.2:/var/lib/mysql-cluster/
>
>         scp config.ini 10.10.1.3:/var/lib/mysql-cluster/
>
>
>         The cluster was started in the following order:-
>
>         MGM node : ndb_mgmd -f /var/lib/mysql-cluster/config.ini
>
>         Data nodes A and B : ndbd --initial
>
>         SQL node: mysqld_safe --user=mysql --ndbcluster --ndb-connectstring=
>         10.10.1.1:1186&
>
>         Running show from ndb_mgm client on MGM node we get the following
>
>         Cluster Configuration
>         ---------------------
>         [ndbd(NDB)]     2 node(s)
>         id=2    @10.10.1.2 <http://10.10.1.2>  (mysql-5.1.51 ndb-7.1.10,
>         Nodegroup: 0, Master)
>         id=3    @10.10.1.3 <http://10.10.1.3>  (mysql-5.1.51 ndb-7.1.10,
>         Nodegroup: 0)
>
>         [ndb_mgmd(MGM)] 1 node(s)
>         id=1    @10.10.1.1 <http://10.10.1.1>  (mysql-5.1.51 ndb-7.1.10)
>
>         [mysqld(API)]   1 node(s)
>         id=4    @10.10.1.4 <http://10.10.1.4>  (mysql-5.1.51 ndb-7.1.10)
>
>         ndb_mgm>
>
>
>         Following checks were done on the SQL node
>
>         1. Show Engines;
>
>         mysql>  Show Engines;
>        
> +------------+---------+----------------------------------------------------------------+--------------+------+------------+
>         | Engine     | Support |
>         Comment                                                        |
>         Transactions | XA   | Savepoints |
>        
> +------------+---------+----------------------------------------------------------------+--------------+------+------------+
>         | ndbcluster | YES     | Clustered, fault-tolerant
>         tables                               | YES          | NO   | NO
>                  |
>         | MRG_MYISAM | YES     | Collection of identical MyISAM
>         tables                          | NO           | NO   | NO         |
>         | ndbinfo    | YES     | MySQL Cluster system information storage
>         engine                | NO           | NO   | NO         |
>         | CSV        | YES     | CSV storage
>         engine                                             | NO
>            | NO   |
>         NO         |
>         | MEMORY     | YES     | Hash based, stored in memory, useful
>         for temporary
>         tables      | NO           | NO   | NO         |
>         | FEDERATED  | NO      | Federated MySQL storage
>         engine                                 | NULL         | NULL |
>         NULL       |
>         | ARCHIVE    | YES     | Archive storage
>         engine                                         | NO           |
>         NO   |
>         NO         |
>         | InnoDB     | YES     | Supports transactions, row-level
>         locking, and
>         foreign keys     | YES          | YES  | YES        |
>         | MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great
>         performance         | NO           | NO   | NO         |
>         | BLACKHOLE  | YES     | /dev/null storage engine (anything you
>         write to it
>         disappears) | NO           | NO   | NO         |
>        
> +------------+---------+----------------------------------------------------------------+--------------+------+------------+
>         10 rows in set (0.00 sec)
>
>
>         mysql>  show processlist;
>        
> +----+-------------+-----------+------+---------+------+-----------------------------------+------------------+
>         | Id | User        | Host      | db   | Command | Time |
>         State                             | Info             |
>        
> +----+-------------+-----------+------+---------+------+-----------------------------------+------------------+
>         |  1 | system user |           |      | Daemon  |    0 | Waiting
>         for event
>         from ndbcluster | NULL             |
>         |  8 | root        | localhost | NULL | Query   |    0 |
>         NULL                              | show processlist |
>        
> +----+-------------+-----------+------+---------+------+-----------------------------------+------------------+
>         2 rows in set (0.00 sec)
>
>
>
>         2) create database and table ;
>
>         mysql>  create database hk;
>         Query OK, 1 row affected (0.00 sec)
>
>         mysql>  \u hk
>         Database changed
>         mysql>  create table hh(id int(1)) engine=ndbcluster;
>         Query OK, 0 rows affected (0.05 sec)
>
>         mysql>
>
>
>
>
>
>         Following checks were done on the Data node 1:
>
>         mysql>  show engines;
>        
> +------------+---------+----------------------------------------------------------------+--------------+------+------------+
>         | Engine     | Support |
>         Comment                                                        |
>         Transactions | XA   | Savepoints |
>        
> +------------+---------+----------------------------------------------------------------+--------------+------+------------+
>         | ndbcluster | YES     | Clustered, fault-tolerant
>         tables                               | YES          | NO   | NO
>                  |
>         | MRG_MYISAM | YES     | Collection of identical MyISAM
>         tables                          | NO           | NO   | NO         |
>         | ndbinfo    | YES     | MySQL Cluster system information storage
>         engine                | NO           | NO   | NO         |
>         | CSV        | YES     | CSV storage
>         engine                                             | NO
>            | NO   |
>         NO         |
>         | MEMORY     | YES     | Hash based, stored in memory, useful
>         for temporary
>         tables      | NO           | NO   | NO         |
>         | FEDERATED  | NO      | Federated MySQL storage
>         engine                                 | NULL         | NULL |
>         NULL       |
>         | ARCHIVE    | YES     | Archive storage
>         engine                                         | NO           |
>         NO   |
>         NO         |
>         | InnoDB     | YES     | Supports transactions, row-level
>         locking, and
>         foreign keys     | YES          | YES  | YES        |
>         | MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great
>         performance         | NO           | NO   | NO         |
>         | BLACKHOLE  | YES     | /dev/null storage engine (anything you
>         write to it
>         disappears) | NO           | NO   | NO         |
>        
> +------------+---------+----------------------------------------------------------------+--------------+------+------------+
>         10 rows in set (0.00 sec)
>
>
>
>         mysql>  create database hello1;
>         Query OK, 1 row affected, 1 warning (0.00 sec)
>
>
>         mysql>  show warnings;
>        
> +-------+------+---------------------------------------------------------------------------------+
>         | Level | Code |
>         Message
>         |
>        
> +-------+------+---------------------------------------------------------------------------------+
>         | Error | 1296 | Got error 4009 'Cluster Failure' from NDB.
>         Could not
>         acquire global schema lock |
>        
> +-------+------+---------------------------------------------------------------------------------+
>         1 row in set (0.00 sec)
>
>         mysql>  \u hello1
>         Database changed
>
>
>
>         mysql>  create table nn(id int(1)) engine=ndbcluster;
>         ERROR 1005 (HY000): Can't create table 'hellol.nn' (errno: 157)
>         mysql>
>
>
>         mysql>  create table hh(id int(1));
>         Query OK, 0 rows affected, 2 warnings (0.04 sec)
>
>         mysql>  show warnings;
>        
> +-------+------+---------------------------------------------------------------------------------+
>         | Level | Code |
>         Message
>         |
>        
> +-------+------+---------------------------------------------------------------------------------+
>         | Error | 1296 | Got error 4009 'Cluster Failure' from NDB.
>         Could not
>         acquire global schema lock |
>         | Error | 1296 | Got error 4009 'Cluster Failure' from
>         NDB                                       |
>        
> +-------+------+---------------------------------------------------------------------------------+
>         2 rows in set (0.00 sec)
>
>         mysql>  show processlist;
>        
> +----+-------------+-----------+--------+---------+--------+---------------------------------+------------------+
>         | Id | User        | Host      | db     | Command | Time   |
>         State                           | Info             |
>        
> +----+-------------+-----------+--------+---------+--------+---------------------------------+------------------+
>         |  1 | system user |           | NULL   | Daemon  | 162545 |
>         Waiting for
>         ndbcluster to start | NULL             |
>         |  6 | root        | localhost | hello1 | Query   |      0 |
>         NULL                            | show processlist |
>        
> +----+-------------+-----------+--------+---------+--------+---------------------------------+------------------+
>         2 rows in set (0.00 sec)
>
>         mysql>
>
>         Please let us know how to overcome this and create the NDB tables
>
>         Thanks&  Regards,
>         Kranthi
>
>
>
>     --
>
>     Jon Stephens / MySQL Documentation Team
>     Oracle Svenska AB / Stockholm
>     Mobile: +46 (0) 73 677 39 93
>     Summer: UTC +02.00 / Winter: UTC +01.00
>     MySQL: www.mysql.com <http://www.mysql.com>
>     Oracle: www.oracle.com <http://www.oracle.com>
>
>


-- 

Jon Stephens / MySQL Documentation Team
Oracle Svenska AB / Stockholm
Mobile: +46 (0) 73 677 39 93
Summer: UTC +02.00 / Winter: UTC +01.00
MySQL: www.mysql.com
Oracle: www.oracle.com

Thread
MySQL Cluster Installationkranthi9 May
  • Re: MySQL Cluster InstallationJon Stephens9 May
  • Re: MySQL Cluster InstallationStewart Smith11 May
Re: MySQL Cluster InstallationJon Stephens9 May