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.

I am attempting to setup a MySQL Cluster.

I have the folllowing setup

  • one management node
  • two data nodes
  • another machine on which two more nodes reside

Below is the config.ini file:

[ndbd default]

# Options affecting ndbd processes on all data nodes:
NoOfReplicas=2    # Number of replicas

DataMemory=80M    # How much memory to allocate for data storage

IndexMemory=18M   # How much memory to allocate for index storage

                  # For DataMemory and IndexMemory, we have used the
                  # default values. Since the "world" database takes up
                  # only about 500KB, this should be more than enough for
                  # this example Cluster setup.

DataDir=/var/lib/mysql-cluster

[MYSQLD DEFAULT]

[NDB_MGMD DEFAULT]

LogDestination=FILE:filename=my-cluster.log


[tcp default]

[ndb_mgmd]

# Management process options:
hostname=X.X.X.26         # Hostname or IP address of MGM node

datadir=/var/lib/mysql-cluster  # Directory for MGM node log files

# Storage Nodes
[NDBD]

hostname=X.X.X.26   # IP address of storage-node-1

DataDir= /var/lib/mysql-cluster

[NDBD]

HostName=X.X.X.73         # IP address of storage-node-2

DataDir= /var/lib/mysql-cluster

[NDBD]
hostname=X.X.X.26      # IP address of storage-node-3
DataDir= /var/lib/mysql-cluster

[NDBD]
HostName=X.X.X.73         # IP address of storage-node-4
DataDir= /var/lib/mysql-cluster

# Setup node IDs for mySQL API-servers (clients of the cluster)

[mysqld]
# SQL node options:
hostname=X.X.X.73        # Hostname or IP address
                                # (additional mysqld connections can be
                                # specified for this node for various
                                # purposes such as running ndb_restore)

Below is the my.cnf file for both systems:

[mysqld]

ndbcluster # run NDB storage engine

ndb-connectstring=X.X.X.26 # location of management server

[mysql_cluster]

ndb-connectstring=X.X.X.26 # location of management server


When I try to start the cluster, it gives me following error:

Could not determine which NodeID to use for this node. Specify it with --ndb-nodeid=<nodeid> on command line

If clustering setup is done, there is no replication of data as it give me again another error: ERROR 1296 (HY000): Got error 4009 'Cluster Failure' from NDBCLUSTER

Can anyone help me determine the problem?

share|improve this question
    
Can you provide the command line you are using to start the cluster? –  Craig Efrein Sep 7 '12 at 12:39
    
its ndb_mgmd -f /etc/config.ini --initial –  Yogesh Ballani Sep 7 '12 at 12:45
    
what do you see in the my-cluster.log file? –  Craig Efrein Sep 7 '12 at 12:51
    
@Craig Efrein This is what i got from mysql-cluster.log File Couldn't start as daemon, error: 'Failed to lock pidfile '/var/lib/mysql-cluster/ndb_1.pid', already locked by pid=3722, errno: 11' [MgmtSrvr] WARNING -- Failed to allocate nodeid for API at 192.168.9.73. Returned eror: 'No free node id found for mysqld(API).' [MgmtSrvr] INFO -- Got initial configuration from '/etc/config.ini', will try to set it when all ndb_mgmd(s) started [MgmtSrvr] ERROR -- Couldn't start as daemon, error: 'Failed to lock pidfile '/var/lib/mysql-cluster/ndb_1.pid', already locked by pid=3722, errno: 11' –  Yogesh Ballani Sep 10 '12 at 3:47
add comment

1 Answer 1

up vote 1 down vote accepted

Your management configuration seems fine to me. It sounds like ndb_mgmd didn't quite die or there is a problem with the contents in the /var/lib/mysql-cluster directory on the management server.

You might also want to make sure that ndb_mgmd isn't starting automatically, like through some startup script in /etc/init.d/.

To try and resolve the issue, I'd start with these steps first.

Since you are just getting started and don't have any real data yet.

  1. Kill any left over ndb_mgmd processes with: killall ndb_mgmd or by rebooting if killall doesn't help.
  2. Completely delete everything within /var/lib/mysql-cluster: rm -Rf /var/lib/mysql-cluster/*
  3. Start the cluster process again: ndb_mgmd -f /etc/config.ini --initial
  4. Verify that ndb_mgmd is listening with netstat

    $> netstat -tlpn

    Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 0.0.0.0:1186 0.0.0.0:* LISTEN 3251/ndb_mgmd

Connect to management node

$> ndb_mgm
ndb_mgm> show
Connected to Management Server at: localhost:1186
Cluster Configuration


[ndb_mgmd(MGM)] 1 node(s)
id=1    @192.168.9.26  (mysql-5.1.61 ndb-7.1.22)

Update

Here is a Quick Start guide from Oracle with all nodes, management, mysql and data running on one server.

http://downloads.mysql.com/tutorials/cluster/GetMySQLClusterRunning-LINUX.pdf

share|improve this answer
    
Is is possible to make Managment node and Data Node On Same Machines.... –  Yogesh Ballani Sep 10 '12 at 6:07
    
yes, everything can run on one server, that's typically how people start out learning cluster. –  Craig Efrein Sep 10 '12 at 6:08
    
:Thanx It works –  Yogesh Ballani Sep 10 '12 at 6:34
    
Pleasure to help –  Craig Efrein Sep 10 '12 at 6:36
    
As per you suggestion we have done and resolved the issue ASAP. –  user2407817 Oct 16 '13 at 9:14
add comment

Your Answer

 
discard

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

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