mysql ndb cluster add data node - mysql

This is my config.ini file
options affecting ndbd processes on all data nodes:
[ndbd default]
NoOfReplicas=1 # 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.
TCP/IP options:
[tcp default]
portnumber=2202 # This the default; however, you can use any port that is free
# for all the hosts in the cluster
# Note: It is recommended that you do not specify the port
# number at all and allow the default value to be used instead
Management process options:
[ndb_mgmd]
hostname=192.168.1.10 # Hostname or IP address of management node
datadir=/var/lib/mysql-cluster # Directory for management node log files
Options for data node "A":
[ndbd]
# (one [ndbd] section per data node)
hostname=192.168.1.10 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's data files
Options for data node "B":
[ndbd]
hostname=192.168.0.20 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's data files
SQL node options:
[mysqld]
hostname=192.168.1.10 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
I want to specify second data node on 192.168.0.20 server.
What changes do i need to do on 192.168.0.20? It is a very low end machine so, I want don't want mysqld to run there.
can anyone provide any input on this.

If you use http://www.severalnines.com/config/index.php to create configurations files, and ask it to send it to you as an e-mail, you will get several scripts, including add_node.sh, which might be what you need.

Related

why did the error "The hostname this node should have according to the configuration does not match a local interface" occur?

Host1:
ip: 42.a1.b1.c1 (in configuration file, a1,b1,c1 will be replaced by real values.)
mysql-cluster-community-server, mysql-cluster-community-management-server and mysql-cluster-community-data-node are all installed on this host.
Host2:
ip: 119.a2.b2.c2 (in configuration file, a2,b2,c2 will be replaced by real values.)
Both mysql-cluster-community-server and mysql-cluster-community-data-node are installed on this host.
All mysql-cluster-* softwares on both hosts didn't start.
cat /var/lib/mysql-cluster/config.ini on host1 outputs:
[ndbd default]
# Options affecting ndbd processes on all data nodes:
NoOfReplicas=1 # Number of fragment 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 NDB Cluster setup.
# NOTE: IndexMemory is deprecated in NDB 7.6 and later; in
# these versions, resources for all data and indexes are
# allocated by DataMemory and any that are set for IndexMemory
# are added to the DataMemory resource pool
ServerPort=2202 # This the default value; however, you can use any
# port that is free for all the hosts in the cluster
# Note1: It is recommended that you do not specify the port
# number at all and simply allow the default value to be used
# instead
# Note2: The port was formerly specified using the PortNumber
# TCP parameter; this parameter is no longer available in NDB
# Cluster 7.5.
[ndb_mgmd]
# Management process options:
HostName=42.a1.b1.c1 # Hostname or IP address of management node
DataDir=/var/lib/mysql-cluster # Directory for management node log files
#[ndbd]
#Options for data node "A":
# (one [ndbd] section per data node)
#HostName=42.a1.b1.c1 # Hostname or IP address
#NodeId=2 # Node ID for this data node
#DataDir=/usr/local/mysql/data # Directory for this data node's data files
[ndbd]
#Options for data node "B":
HostName=119.a2.b2.c2 # Hostname or IP address
NodeId=3 # Node ID for this data node
DataDir=/usr/local/mysql/data # Directory for this data node's data files
[mysqld]
#SQL node options:
HostName=119.a2.b2.c2 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
ndb_mgmd -f /var/lib/mysql-cluster/config.ini --ndb-nodeid=1 on host1 outpus:
MySQL Cluster Management Server mysql-5.7.32 ndb-7.6.16
2020-11-07 16:35:20 [MgmtSrvr] WARNING -- at line 5: [DB] IndexMemory is deprecated, will use Number bytes on each ndbd(DB) node allocated for storing indexes instead
2020-11-07 16:35:20 [MgmtSrvr] ERROR -- The hostname this node should have according to the configuration does not match a local interface. Attempt to bind '42.a1.b1.c1' failed with error: 99 'Cannot assign requested address'
why did the error "The hostname this node should have according to the configuration does not match a local interface" occur?
thanks a lot.
Happen because /etc/hosts has not been loaded in ram at boot time when your ndb service load.
i do resolve this on my case just adding 5 sec pause into the service script.
detail:
[Service]
ExecStartPre=-/bin/sleep 5

mysql-cluser ndb_restore issue

I've been trying with intermittent success to restore my ndb_backups to a new cluster.
We have a 6 NDB node cluster with 3 API nodes. When I run an ndb_restore, usually the first 2 or 3 node backups get pulled in without issue. But the 4th and 5th node fail with the following error:
Temporary error: 266: Time-out in NDB, probably caused by deadlock
Temporary error: 266: Time-out in NDB, probably caused by deadlock
Retried transaction 10 times.
Last error266: Time-out in NDB, probably caused by deadlock
...Unable to recover from errors. Exiting...
Strangely, sometimes I can simply rerun all 6 backups and it finishes successfully.
I'm hoping someone knows what kind of tweaks I can make to my configuration to optimize this process. Here are my version numbers and configs:
mysql-5.6.22 ndb-7.3.8
My mgm configuration file:
######################
#MGM CONFIG
######################
[ndbd default]
# Options affecting ndbd processes on all data nodes:
NoOfReplicas=2 # Number of replicas
DataMemory=8144M # How much memory to allocate for data storage
IndexMemory=8144M # 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.
[ndb_mgmd]
# Management process options:
hostname=192.168.207.133 # Hostname or IP address of MGM node
NodeId=1
[ndb_mgmd]
# Management process options:
hostname=192.168.207.45 # Hostname or IP address of MGM node
NodeId=2
[ndbd]
# Options for data node "A":
hostname=192.168.207.135 # Hostname or IP address
NodeId=3
[ndbd]
# Options for data node "B":
hostname=192.168.207.171 # Hostname or IP address
NodeId=4
[ndbd]
# Options for data node "C":
hostname=192.168.207.174 # Hostname or IP address
NodeId=5
[ndbd]
# Options for data node "D":
hostname=192.168.207.27 # Hostname or IP address
NodeId=6
[ndbd]
# Options for data node "E":
hostname=192.168.207.169 # Hostname or IP address
NodeId=7
[ndbd]
# Options for data node "F":
hostname=192.168.207.178 # Hostname or IP address
NodeId=8
[mysqld]
hostname=192.168.207.177
NodeId=10
[mysqld]
hostname=192.168.207.35
NodeId=11
[mysqld]
hostname=192.168.207.148
NodeId=12
My mysqld and ndb node config
######################
#API AND NDB CONFIG
######################
[mysqld]
ndbcluster
[mysql_cluster]
ndb-connectstring=192.168.207.133,192.168.207.45 # location of management server
Really hope someone can help. I've been at this for a month. We use data blobs quite extensively and I understand that this can cause these time-outs, but I'm most curious to find out why the 6-node restore sometimes succeeds and sometimes doesn't, and how I can go about ensuring the restore is successful every time.
I'm very open to try things and repost. I'm new to mysql cluster and have learned piles in the past few months, but am eager to learn more.
Thanks in advance,
GT

SQL Node not connected in a mysql cluster

I am trying to deploy a mysql cluster (4 machines) with 1 node manager, 1 sql node, and 2 data nodes. I am following these tutorials which are complimentary (first part, second part, third part, fourth part) from the official mysql website. However I have a problem with the SQL Node which is always not connected, as you can see here in the node manager:
$ sudo ndb_mgm -e show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=2 #10.31.35.40 (mysql-5.6.23 ndb-7.4.5, starting, Nodegroup: 0)
id=3 #10.31.35.42 (mysql-5.6.23 ndb-7.4.5, starting, Nodegroup: 0)
[ndb_mgmd(MGM)] 1 node(s)
id=1 #10.31.37.108 (mysql-5.6.23 ndb-7.4.5)
[mysqld(API)] 1 node(s)
id=4 (not connected, accepting connect from 10.31.35.41)
I don't know why the SQL node is not connected to the management node !! I looked for similar problems in google but I still can't resolve my problem !
I tried several times to do:
/etc/init.d/mysql.server stop
and
/etc/init.d/mysql.server start
but in vain.
Here is also the output of mysqld in verbose mode which mentions a problem I don't know what its cause:
ubuntu#10-31-35-41:/usr/local/mysql/bin$ sudo mysqld --verbose --help
150404 5:26:00 [Note] Plugin 'FEDERATED' is disabled.
150404 5:26:00 [ERROR] mysqld: unknown option '--ndbcluster'
......
Also when I try to see the location of the mysqld_safe (which I think is not normal since as you can see in the first part of the tutorial the folder was put in /usr/local/mysql (and I am supposed to use the mysql.server, isn't it ?)), I have
$ which mysqld_safe
/usr/bin/mysqld_safe
Moreover, I don't know if there is a conflict with the previous installed package of mysql
This is /etc/mysql/my.cnf (in the sql node, which is the same in the working data nodes):
[mysqld]
# Options for mysqld process:
ndbcluster # run NDB storage engine
[mysql_cluster]
# Options for MySQL Cluster processes:
ndb-connectstring=10.31.37.108 # location of management server
This is the config.ini file in the ndb_mgm:
[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.
[tcp default]
# TCP/IP options:
portnumber=2202 # This the default; however, you can use any
# port that is free for all the hosts in the cluster
# Note: It is recommended that you do not specify the port
# number at all and simply allow the default value to be used
# instead
[ndb_mgmd]
# Management process options:
hostname=10.31.37.108 # Hostname or IP address of MGM node
datadir=/var/lib/mysql-cluster # Directory for MGM node log files
[ndbd]
# Options for data node "A":
# (one [ndbd] section per data node)
hostname=10.31.35.40 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's data files
[ndbd]
# Options for data node "B":
hostname=10.31.35.42 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's data files
[mysqld]
# SQL node options:
hostname=10.31.35.41 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
Thank you very much in advance for your help !!
To resolve the problem I changed the permissions on the /usr/local/mysql/data directory as follows:
sudo chown -R ubuntu data/
so now instead of:
$ /usr/local/mysql/support-files/mysql.server restart
* MySQL server PID file could not be found!
Starting MySQL
. * The server quit without updating PID file (/usr/local/mysql/data/ip-172-31-46-103.pid).
I get now:
$ /usr/local/mysql/support-files/mysql.server restart
Shutting down MySQL
.. *
Starting MySQL
. *

Mysql cluster Insert Stalls TCROLLBACKREQ

I have a mysql cluster with 4 data nodes. I am trying to do an insert of 8 million rows, using load data infile in chunks of 50k to keep transactions small. Like clockwork, after every 1 million rows inserted into the table, the insert stalls for nearly 20 minutes before starting again. I also get this error in the logs.
2014-07-17 22:34:59 [NdbApi] ERROR -- Sending TCROLLBACKREQ with Bad flag
I'm assuming I am in need of a configuration change
[ndbd default]
# Options affecting ndbd processes on all data nodes:
NoOfReplicas=2 # Number of replicas
DataMemory=90G # How much memory to allocate for data storage
IndexMemory=10G # 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.
NoOfFragmentLogFiles=20
MaxNoOfOrderedIndexes=1000
MaxNoOfAttributes=10000
MaxBufferedEpochs=10000
MaxNoOfConcurrentTransactions=1000000
MaxNoOfConcurrentOperations=10000000
MaxNoOfLocalOperations=11000000
[tcp default]
# TCP/IP options:
#portnumber=2202 # This the default; however, you can use any
# port that is free for all the hosts in the cluster
# Note: It is recommended that you do not specify the port
# number at all and simply allow the default value to be used
# instead
[ndb_mgmd]
# Management process options:
hostname=########.173 # Hostname or IP address of MGM node
datadir=/var/lib/mysql-cluster # Directory for MGM node log files
nodeId=1
[ndbd]
# Options for data node "A":
hostname=########.173 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's data files
ServerPort=50501
nodeId=2
MaxNoOfExecutionThreads=4
[ndbd]
# Options for data node "B":
hostname=########.174 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's data files
ServerPort=50502
nodeId=3
MaxNoOfExecutionThreads=4
[ndbd]
# Options for data node "C":
hostname=########.175 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's data files
ServerPort=50503
nodeId=5
MaxNoOfExecutionThreads=4
[ndbd]
# Options for data node "D":
hostname=########.176 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's data files
ServerPort=50504
nodeId=6
MaxNoOfExecutionThreads=4
#[ndbd]
# Options for data node "E":
#hostname=########.177 # Hostname or IP address
#datadir=/usr/local/mysql/data # Directory for this data node's data files
#ServerPort=50505
#nodeId=7
#MaxNoOfExecutionThreads=4
[mysqld]
# SQL node options:
nodeId=4
hostname=########.174 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
[mysqld]
# SQL node options:
nodeId=7
hostname=########.177 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
[mysqld]
# SQL node options:
nodeId=8
hostname=########.177 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
[mysqld]
# SQL node options:
nodeId=9
hostname=########.177 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
[mysqld]
# SQL node options:
nodeId=10
hostname=########.177 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
[mysqld]
# SQL node options:
nodeId=11
hostname=########.177 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
[mysqld]
# SQL node options:
nodeId=12
hostname=########.177 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
[mysqld]
# SQL node options:
nodeId=13
hostname=########.177 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
[mysqld]
# SQL node options:
nodeId=14
hostname=########.177 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
Changing my configuration to this solved the problem
[TCP DEFAULT]
SendBufferMemory=8M
ReceiveBufferMemory=8M
[NDB_MGMD DEFAULT]
PortNumber=1186
Datadir=/data/mysqlcluster/
[NDB_MGMD]
NodeId=1
Hostname=vacnode6.mc.vanderbilt.edu
LogDestination=FILE:filename=ndb_1_cluster.log,maxsize=10000000,maxfiles=6
ArbitrationRank=1
[NDBD DEFAULT]
NoOfReplicas=2
ServerPort=2200
Datadir=/data/mysqlcluster/
FileSystemPathDD=/data/mysqlcluster/
BackupDataDir=/data/mysqlcluster//backup/
#FileSystemPathUndoFiles=/data/mysqlcluster/
#FileSystemPathDataFiles=/data/mysqlcluster/
DataMemory=95695M
IndexMemory=11962M
LockPagesInMainMemory=1
MaxNoOfConcurrentOperations=100000
MaxNoOfConcurrentTransactions=16384
StringMemory=25
MaxNoOfTables=4096
MaxNoOfOrderedIndexes=2048
MaxNoOfUniqueHashIndexes=512
MaxNoOfAttributes=24576
MaxNoOfTriggers=14336
### Params for REDO LOG
FragmentLogFileSize=256M
InitFragmentLogFiles=SPARSE
NoOfFragmentLogFiles=374
RedoBuffer=64M
TransactionBufferMemory=8M
TimeBetweenGlobalCheckpoints=1000
TimeBetweenEpochs=100
TimeBetweenEpochsTimeout=0
### Params for LCP
DiskCheckpointSpeedInRestart=100M
DiskCheckpointSpeed=10M
TimeBetweenLocalCheckpoints=20
### Heartbeating
HeartbeatIntervalDbDb=15000
HeartbeatIntervalDbApi=15000
### Params for setting logging
MemReportFrequency=30
BackupReportFrequency=10
LogLevelStartup=15
LogLevelShutdown=15
LogLevelCheckpoint=8
LogLevelNodeRestart=15
### Params for BACKUP
BackupMaxWriteSize=1M
BackupDataBufferSize=24M
BackupLogBufferSize=16M
BackupMemory=40M
### Params for ODIRECT
#Reports indicates that odirect=1 can cause io errors (os err code 5) on some systems. You must test.
#ODirect=1
### Watchdog
TimeBetweenWatchdogCheckInitial=60000
### TransactionInactiveTimeout - should be enabled in Production
TransactionInactiveTimeout=60000
### New 7.1.10 redo logging parameters
RedoOverCommitCounter=3
RedoOverCommitLimit=20
### REALTIME EXTENSIONS
#RealTimeScheduler=1
### REALTIME EXTENSIONS FOR 6.3 ONLY
#SchedulerExecutionTimer=80
#SchedulerSpinTimer=40
### DISK DATA
SharedGlobalMemory=20M
DiskPageBufferMemory=64M
### Multithreading
MaxNoOfExecutionThreads=8
NoOfFragmentLogParts=4
### Increasing the LongMessageBuffer b/c of a bug (20090903)
LongMessageBuffer=32M
BatchSizePerLocalScan=512
[NDBD]
NodeId=2
Hostname=vacnode1.mc.vanderbilt.edu
### REALTIME ASPECTS - THREAD BINDING
### READ http://johanandersson.blogspot.com/2008/02/mysql-cluster-features-what-they-are.html#realtime
#LockExecuteThreadToCPU=X
#LockMaintThreadsToCPU=Y
[NDBD]
NodeId=3
Hostname=vacnode2.mc.vanderbilt.edu
### REALTIME ASPECTS - THREAD BINDING
### READ http://johanandersson.blogspot.com/2008/02/mysql-cluster-features-what-they-are.html#realtime
#LockExecuteThreadToCPU=X
#LockMaintThreadsToCPU=Y
[NDBD]
NodeId=4
Hostname=vacnode3.mc.vanderbilt.edu
### REALTIME ASPECTS - THREAD BINDING
### READ http://johanandersson.blogspot.com/2008/02/mysql-cluster-features-what-they-are.html#realtime
#LockExecuteThreadToCPU=X
#LockMaintThreadsToCPU=Y
[NDBD]
NodeId=5
Hostname=vacnode4.mc.vanderbilt.edu
### REALTIME ASPECTS - THREAD BINDING
### READ http://johanandersson.blogspot.com/2008/02/mysql-cluster-features-what-they-are.html#realtime
#LockExecuteThreadToCPU=X
#LockMaintThreadsToCPU=Y
[MYSQLD DEFAULT]
DefaultOperationRedoProblemAction=QUEUE
BatchSize=512
#BatchByteSize=2048K
#MaxScanBatchSize=2048K
[MYSQLD]
NodeId=6
[MYSQLD]
NodeId=7
[MYSQLD]
NodeId=8
[MYSQLD]
NodeId=9
[MYSQLD]
NodeId=10
[MYSQLD]
NodeId=11
[MYSQLD]
NodeId=12
[MYSQLD]
NodeId=13
[MYSQLD]
NodeId=14
[MYSQLD]
NodeId=15
[MYSQLD]
NodeId=16
[MYSQLD]
NodeId=17
[MYSQLD]
NodeId=18
[MYSQLD]
NodeId=19
[MYSQLD]
NodeId=20
[MYSQLD]
NodeId=21
[MYSQLD]
NodeId=22
[MYSQLD]
NodeId=23
[MYSQLD]
NodeId=24
[MYSQLD]
NodeId=25
[MYSQLD]
NodeId=26
[MYSQLD]
NodeId=27
[MYSQLD]
NodeId=28
[MYSQLD]
NodeId=29
[MYSQLD]
NodeId=30
[MYSQLD]
NodeId=31
[MYSQLD]
NodeId=32
[MYSQLD]
NodeId=33
[MYSQLD]
NodeId=34
[MYSQLD]
NodeId=35
[MYSQLD]
NodeId=36
[MYSQLD]
NodeId=37
[MYSQLD]
[MYSQLD]
[MYSQLD]
[MYSQLD]
### SLOTS (one for each ndb_mgmd) FOR HELPER APPLICATIONS SUCH AS ndb_show_tables etc
[MYSQLD]
Hostname=vacnode6.mc.vanderbilt.edu
### SLOT FOR CMON
[MYSQLD]
Hostname=something.mc.vanderbilt.edu

Error starting mysql cluster management node (ndb_mgmd) on Ubuntu

I am having trouble with the initial start up of the mysql-cluster management node and would appreciate any help I can get about this issue. See my two examples of failure below followed by my config.ini file. The first example shows the basic command to start the daemon and the error it produces. The second attempts to skip the process I believe caused the error in the first, but only results in a different error (one that I can find no solution to).
~$ ndb_mgmd -f /var/lib/mysql-cluster/config.ini
MySQL Cluster Management Server mysql - 5.5.25 ndb-7.2.7
2012-07-27 16:44:51 [MgmtSrvr] INFO -- The default config directory '/user/local
/mysql/mysql-cluster' does not exist. Trying to create it...
Failed to create directory '/usr/local/mysql/mysql-cluster', error: 2 2012-07-27 16:44:51
[MgmtSrvr] ERROR -- Could not create directory '/usr/local/mysql/mysql-cluster'.
Either create it manually or specify a different directory with --configdir=
~$ ndb_mgmd --skip-config-cache -f /var/lib/mysql-cluster/config.ini
MySQL Cluster Management Server mysql - 5.5.25 ndb-7.2.7
2012-07-27 16:44:51 [MgmtSrvr] INFO -- Skipping check of config directory since config cache is disabled.
Failed to parse parameters for log handler: 'FILE:filename=/var/lib/mysql-cluster/ndb_1_cluster.log,maxsize=1000000,
maxfiles=6', error:13 '(null)'
/var/lib/mysql-cluster/config.ini:
[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
[tcp default]
# TCP/IP options:
[ndb_mgmd]
# Management process options:
hostname=192.168.0.3 # Hostname or IP address of MGM node
datadir=/var/lib/mysql-cluster # Directory for MGM node log files
NodeId=1
[ndbd]
# Options for data node-1:
# (one [ndbd] section per data node)
hostname=192.168.0.1 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's data files
NodeId=2
[ndbd]
# Options for data node-2:
hostname=192.168.0.2 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's data files
NodeId=3
[mysqld]
# SQL node options:
hostname=192.168.0.4 # Hostname
You should try running that commands with sudo:
~$ sudo ndb_mgmd -f /var/lib/mysql-cluster/config.ini
~$ sudo ndb_mgmd --skip-config-cache -f /var/lib/mysql-cluster/config.ini
Your problem seems to be with permissions, not configuration.