Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

For some testing I have installed MySQL Cluster.
I can get it to work with configuration suggested in Lunix guick start guide.
My configuration:

[ndb_mgmd]
hostname=localhost
datadir=/home/vmUser/my_cluster/ndb_data
NodeId=1
[ndbd default]
noofreplicas=2
datadir=/home/vmUser/my_cluster/ndb_data
[ndbd]
hostname=localhost
NodeId=3
[ndbd]
hostname=localhost
NodeId=4
[mysqld]
NodeId=50

And start script:

#/bin/bash
echo "" > mysql_cluster_start_script.log
$HOME/mysqlc/bin/ndb_mgmd -f conf/config.ini --initial --configdir=$HOME/my_cluster/conf/ >> mysql_cluster_start_script.log
$HOME/mysqlc/bin/ndbd -c localhost:1186 >> mysql_cluster_start_script.log
$HOME/mysqlc/bin/ndbd -c localhost:1186 >> mysql_cluster_start_script.log
$HOME/mysqlc/bin/ndb_mgm -e show >> mysql_cluster_start_script.log
$HOME/mysqlc/bin/mysqld --defaults-file=conf/my.cnf > mysqld.log 2>&1 &

And it works.
Now I want to start it with only one node. So I changed noofreplicas to 1, deleted second node configuration from conf and starting second node from start script.
New config file:

[ndb_mgmd]
hostname=localhost
datadir=/home/vmUser/my_cluster/ndb_data
NodeId=1
[ndbd default]
noofreplicas=1
datadir=/home/vmUser/my_cluster/ndb_data
[ndbd]
hostname=localhost
NodeId=3
[mysqld]
NodeId=50

New startup script:

#/bin/bash
echo "" > mysql_cluster_start_script.log
$HOME/mysqlc/bin/ndb_mgmd -f conf/config.ini --initial --configdir=$HOME/my_cluster/conf/ >> mysql_cluster_start_script.log
$HOME/mysqlc/bin/ndbd -c localhost:1186 >> mysql_cluster_start_script.log
$HOME/mysqlc/bin/ndb_mgm -e show >> mysql_cluster_start_script.log
$HOME/mysqlc/bin/mysqld --defaults-file=conf/my.cnf > mysqld.log 2>&1 &

With one configuration I get strange error when trying to operate on database:

mysql> CREATE TABLE `test_table` (
    ->   `id` int(11) NOT NULL,
    ->   `data` blob NOT NULL,
    ->   PRIMARY KEY (`id`)
    -> )
    -> engine=ndb;
ERROR 157 (HY000): Could not connect to storage engine
mysql> SHOW WARNINGS;
+---------+------+---------------------------------------------------------------------------------+
| Level   | Code | Message                                                                         |
+---------+------+---------------------------------------------------------------------------------+
| Warning | 1296 | Got error 4009 'Cluster Failure' from NDB. Could not acquire global schema lock |
| Warning | 1296 | Got error 4009 'Cluster Failure' from NDB                                       |
| Error   |  157 | Could not connect to storage engine                                             |
| Error   | 1499 | Too many partitions (including subpartitions) were defined                      |
+---------+------+---------------------------------------------------------------------------------+
4 rows in set (0.00 sec)

I have no idea what I am doing wrong.
I want to start only one node because ram saving during tests.

EDIT: Ok, I have no idea which one of logs I should investigate first.

vmUser@DB-38:~/my_cluster/ndb_data$ ll
total 1024
drwxrwxrwx 4 mysql  mysql    4096 Aug 15 09:20 ./
drwxrwxrwx 6 mysql  mysql    4096 Aug 15 09:20 ../
-rw-rw-r-- 1 vmUser vmUser 205438 Aug 15 09:20 ndb_1_cluster.log
-rw-r--r-- 1 vmUser vmUser   1316 Aug 15 09:15 ndb_1_out.log
-rw-rw-r-- 1 vmUser vmUser   3063 Aug 15 09:15 ndb_3_error.log
drwxr-x--- 9 vmUser vmUser   4096 Apr  3 10:54 ndb_3_fs/
-rw-r--r-- 1 vmUser vmUser 133015 Aug 15 09:15 ndb_3_out.log
-rw-r--r-- 1 vmUser vmUser      4 Aug 15 09:15 ndb_3.pid
-rw-rw-r-- 1 vmUser vmUser 136828 Aug 11 10:17 ndb_3_trace.log.1
-rw-rw-r-- 1 vmUser vmUser  76253 Aug 11 11:08 ndb_3_trace.log.2
-rw-rw-r-- 1 vmUser vmUser  79854 Aug 11 11:08 ndb_3_trace.log.3
-rw-rw-r-- 1 vmUser vmUser  79406 Aug 11 11:11 ndb_3_trace.log.4
-rw-rw-r-- 1 vmUser vmUser  80864 Aug 11 11:14 ndb_3_trace.log.5
-rw-rw-r-- 1 vmUser vmUser  84115 Aug 15 09:15 ndb_3_trace.log.6
-rw-rw-r-- 1 vmUser vmUser      1 Aug 15 09:15 ndb_3_trace.log.next
drwxr-x--- 9 vmUser vmUser   4096 Apr  3 10:54 ndb_4_fs/
-rw-r--r-- 1 vmUser vmUser 103650 Aug 15 09:10 ndb_4_out.log
-rw-r--r-- 1 vmUser vmUser      4 Aug 15 09:05 ndb_4.pid

EDIT2:

Ok, I think I get actual error from ndb_3_error.log:

Time: Thursday 15 August 2013 - 09:15:30
Status: Permanent error, external action needed
Message: Invalid configuration received from Management Server (Configuration error)
Error: 2350
Error data: Illegal configuration change. Initial start needs to be performed  when changing no of replicas (2 != 1)
Error object: DBDIH (Line: 4826) 0x00000002
Program: ndbd
Pid: 1836
Version: mysql-5.5.30 ndb-7.2.12
Trace: /home/vmUser/my_cluster/ndb_data/ndb_3_trace.log.6 [t1..t1]
***EOM***

And from ndb_1_cluster.log I have:

2013-08-15 09:15:30 [MgmtSrvr] ALERT    -- Node 3: Forced node shutdown completed. Occured during startphase 1. Caused by error 2350: 'Invalid configuration received from Management Server(Configuration error). Permanent error, external action needed'.
2013-08-15 09:15:30 [MgmtSrvr] ALERT    -- Node 1: Node 3 Disconnected

I do not exactly understand what I am doing wrong. It says: Initial start needs to be performed when changing no of replicas, but I am starting engine from scratch.
Do I need to put this option also in some other place than my.conf file? Or maybe my starting script is not proper?

share|improve this question
    
Check ndb_mgmd and ndbd logs in /home/vmUser/my_cluster/ndb_data directory. –  Mindaugas Riauba Aug 15 '13 at 11:53
    
Edited question –  Michał Herman Aug 15 '13 at 15:23
    
First you should look into ndb_3_error.log. It's modification time at "Aug 15 09:15" indicates that some critical error happened then. Then look into ndb_3_out.log which is ndbd log which had a problem. And ndb_1_cluster.log generated by ndb_mgmd. –  Mindaugas Riauba Aug 16 '13 at 6:16
    
@MindaugasRiauba Question edited with error from logs. –  Michał Herman Aug 17 '13 at 7:55
1  
@MindaugasRiauba Now it works, thank you very much! :-) –  Michał Herman Aug 18 '13 at 7:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.