Mysql Cluster data ndoe can not start to connecto management node - mysql

Now, every config is ok , but when I use
./ndbd --initial
on data node , it will ouput log :
ndb_mgm :
Forced node shutdown completed. Occured during startphase 0. Caused by error 2350: 'Invalid configuration received from Management Server(Configuration error). Permanent error, external action needed'.
ndbd :
2018-05-10 13:54:43 [ndbd] INFO -- Angel pid: 14533 started child: 14534
2018-05-10 13:54:43 [ndbd] INFO -- Initial start of data node, ignoring any info on disk
2018-05-10 13:54:43 [ndbd] INFO -- Configuration fetched from '172.19.16.170:1186', generation: 1
2018-05-10 13:54:43 [ndbd] INFO -- Changing directory to '/var/lib/mysql-cluster'
2018-05-10 13:54:43 [ndbd] INFO -- Invalid configuration fetched
2018-05-10 13:54:43 [ndbd] INFO -- ConfigParam: 113 not found
2018-05-10 13:54:43 [ndbd] INFO -- Error handler shutting down system
2018-05-10 13:54:43 [ndbd] INFO -- Error handler shutdown completed - exiting
2018-05-10 13:54:43 [ndbd] ALERT -- Node 2: Forced node shutdown completed. Occured during startphase 0. Caused by error 2350: 'Invalid configuration received from Management Server(Configuration error). Permanent error, external action needed'.
Now, the ndbd log tell me , it fetch configuration from server error, but I dont know where is the error.
Thsi is my management node configuration :
[ndbd default]
NoOfReplicas= 1
[mysqld default]
[ndb_mgmd default]
[tcp default]
[ndb_mgmd]
HostName= 172.19.16.170
[ndbd]
NodeId=2
HostName= 172.19.16.166
DataDir= /var/lib/mysql-cluster
[ndbd]
NodeId=3
HostName= 172.19.16.167
DataDir= /var/lib/mysql-cluster
[mysqld]
[mysqld]
[mysqld]

This is an upgrade issue. The error only occurs in ndbd up to
version 7.5. But it is only the ndb_mgmd from version 7.6 that
can set IndexMemory to 0. ConfigParam: 113 is IndexMemory which
is deprecated in 7.6. So probably you are running a ndb_mgmd from
version 7.6 and ndbd from version 7.5.

Related

Mysql NDB Cluster with multiple Mysqld Nodes ( Master-Master)

I want to make Active-Active / Master-Master NDB cluster using 2 server.
1 Server is configured as NDB Manager with below config :
[ndbd default]
# Options affecting ndbd processes on all data nodes:
NoOfReplicas=1 # Number of replicas
[ndb_mgmd]
# Management process options:
hostname=172.24.114.202 # Hostname of the manager
datadir=/var/lib/mysql-cluster # Directory for the log files
NodeId=1
[ndbd]
hostname=172.24.117.30 # Hostname/IP of the first data node
NodeId=2 # Node ID for this data node
datadir=/usr/local/mysql/data # Remote directory for the data files
[mysqld]
# SQL node options:
hostname=172.24.114.202 # In our case the MySQL server/client is on the same Droplet as the cluster manager
NodeId=3
[mysqld]
hostname=172.24.117.30
NodeId=4
172.24.114.20 >> Is the NDB Manager Server IP which also mysql Server installed on it.
172.24.117.30 >> Is the NDB Data Node and Also MySQL Server installed on it.
But, I got below error :
root#rstest1:/var/lib/mysql-cluster# service ndb_mgmd restart
root#rstest1:/var/lib/mysql-cluster# tail -f ndb_1_cluster.log
Node removed
2022-11-22 12:59:59 [MgmtSrvr] INFO -- Starting configuration change, generation: 3
2022-11-22 12:59:59 [MgmtSrvr] INFO -- Configuration 4 commited
2022-11-22 12:59:59 [MgmtSrvr] INFO -- Config change completed! New generation: 4
2022-11-22 12:59:59 [MgmtSrvr] INFO -- Node 1: Node 2 Connected
2022-11-22 13:00:00 [MgmtSrvr] INFO -- Node 2: Started arbitrator node 1 [ticket=067f000700524b50]
2022-11-22 13:00:00 [MgmtSrvr] WARNING -- Unable to allocate nodeid for API at 172.24.117.30. Returned error: 'No free node id found for mysqld(API).'
2022-11-22 13:00:03 [MgmtSrvr] WARNING -- Unable to allocate nodeid for API at 172.24.117.30. Returned error: 'No free node id found for mysqld(API).' - Repeated 2 times
2022-11-22 13:00:06 [MgmtSrvr] WARNING -- Unable to allocate nodeid for API at 172.24.117.30. Returned error: 'No free node id found for mysqld(API).' - Repeated 2 times
2022-11-22 13:00:09 [MgmtSrvr] WARNING -- Unable to allocate nodeid for API at 172.24.117.30. Returned error: 'No free node id found for mysqld(API).'
2022-11-22 13:00:12 [MgmtSrvr] WARNING -- Unable to allocate nodeid for API at 172.24.117.30. Returned error: 'No free node id found for mysqld(API).' - Repeated 2 times
2022-11-22 13:00:15 [MgmtSrvr] WARNING -- Unable to allocate nodeid for API at
Below is MySQLD config on Node 172.24.117.30
[mysqld]
# Options for mysqld process:
ndbcluster # run NDB storage engine
[mysql_cluster]
# Options for NDB Cluster processes:
ndb-connectstring=172.24.114.202 # location of management server
Also, below is NDB data node config on the same node
[mysql_cluster]
# Options for NDB Cluster processes:
ndb-connectstring=172.24.114.202 # location of cluster manager
MySQLd config on First node (172.24.114.202)
[mysqld]
# Options for mysqld process:
ndbcluster # run NDB storage engine
[mysql_cluster]
# Options for NDB Cluster processes:
ndb-connectstring=172.24.114.202 #
I am not sure what's wrong with the configuration, also I have set nodeid for every node.

Failed to allocate nodeid for API at <sql_node_ipaddr>. Returned error: 'No free node id found for mysqld(API).'

OS and mysql cluster version
OS: Linux centos7
mysql cluster: mysql-cluster-community-7.5.8-1.el7.x86_64
Server list
192.168.1.101 ndbd node1
192.168.1.102 ndbd node2
192.168.1.103 ndb_mgmd
192.168.1.104 mysql(api) node1
192.168.1.105 mysql(api) node2
The two data node(ndbd) is OK,but sql node(mysql) cannot connect to ndb_mgmd.The network is OK. SElinux and firewall is disabled.
My config
mgmd config(/var/lib/mysql-cluster/config.ini)
[ndbd default]
NoOfReplicas=2
DataMemory=80M
IndexMemory=18M
ServerPort=2202
[ndb_mgmd]
HostName=192.168.1.103
DataDir=/var/lib/mysql-cluster
[ndbd]
HostName=192.168.1.101
NodeId=2
DataDir=/opt/mysql/data
[ndbd]
HostName=192.168.1.102
NodeId=3
DataDir=/opt/mysql/data
[mysqld]
HostName=192.168.1.104
mysql config(/etc/config.ini)
[mysqld]
user=mysql
ndbcluster
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0
default-storage-engine=NDBCLUSTER
ndb-connectstring=192.168.1.103
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[mysql_cluster]
ndb-connectstring=192.168.1.103
Error log
mgmd log
2017-11-27 20:28:35 [MgmtSrvr] WARNING -- Failed to allocate nodeid for API at 192.168.1.104. Returned error: 'No free node id found for mysqld(API).'
2017-11-27 20:28:36 [MgmtSrvr] INFO -- Alloc node id 4 failed, no new president yet
sql node log(mysqld)
2017-11-28T03:18:43.565265Z 4 [Warning] NDB: Failed to acquire global schema lock, error: (4009)Cluster Failure
2017-11-28T03:18:43.566664Z 4 [Warning] NDB: Failed to acquire global schema lock, error: (4009)Cluster Failure
1) You started the management server fromt he wrong node, it is started
from 192.168.1.104, but in config it says it should be in
192.168.1.103.
2) You are missing a mysqld section for the second MySQL server at
192.168.1.105
Some recommendations:
1) Assign node ids to all nodes
2) Add an API node as well to enable running some NDB tools as well

Remote data node starting issue in MySQL Cluster

I'm playing with MySql Cluster and faced a problem with not common configuration. The most of tutorials describes configuration where data node and MySQL Server node residing on the same PC. But I'm trying to put management node and MySQL server node to PC 'A' and data node to PC 'B'. Unfortunately when I'm trying to run data node ndbd.exe shutting down immediately and leaves the following message in Windows Event Viewer: "Failed to allocate nodeid, error: 'Error: Could not alloc node id at pcA.ip.address port 1186: Connection done from wrong host ip pcB.ip.address'.".
My configuration files are following:
PC 'A' config.ini:
[ndbd default]
noofreplicas=2
[ndbd]
hostname=pcB.ip.address
nodeid=2
[ndb_mgmd]
nodeid = 1
hostname=pcA.ip.address
[mysqld]
nodeid=4
hostname=pcA.ip.address
my.cnf used by mysqld on PC 'A':
[mysqld]
ndb-nodeid=4
ndbcluster
datadir="D:\ProgramData\MySQL\MySQL Cluster 7.3\data4"
port=3306
server-id=3306
my.cnf on PC 'B':
[ndbd]
connect-string="pcA.ip.address"
Can someone say what is wrong with these files above? As I said I couldn't find tutorirals for such cluster configuration.
Thanks in advance.
In your setup, you're declaring to replicas, but you have only one:
[ndbd default]
noofreplicas=2
Node configuration looks fine, but you could try using a empty ndbd definition, then reloading ndb_mgmd daemon to ensure it's applied
[ndbd]

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.

MySql Cluster - Management node wont start

Cant start the management node on MySQL Cluster.
I am issuing the ff command.
ndb_mgmd -f /var/lib/mysql-cluster/config.ini --initial
--configdir=/var/lib/mysql-cluster/ --ndb-nodeid=1
And I am getting the ff error:
MySQL Cluster Management Server mysql-5.5.22 ndb-7.2.6 2012-07-05
02:45:24 [MgmtSrvr] ERROR -- The hostname this node should have
according to theconfiguration does not match a local interface.
Attempt to bind '192.168.177.134' failed with error: 99 'Cannot assign
requested address'
config.ini
[ndbd default]
NoOfReplicas=2
[ndb_mgmd]
hostname=192.186.177.134
datadir=/var/lib/mysql-cluster
[ndbd]
hostname=192.168.177.132
datadir=/usr/local/mysql/data
[ndbd]
hostname=192.186.177.133
datadir=/usr/local/mysql/data
[mysqld]
hostname=192.168.177.131
In config.ini, sometimes you have 192.168 and sometimes 192.186. In particular:
[ndb_mgmd]
hostname=192.186.177.134
datadir=/var/lib/mysql-cluster
Should be:
[ndb_mgmd]
hostname=192.168.177.134
datadir=/var/lib/mysql-cluster
The hostname will then match that to which ndb_mgmd was attempting to bind, as described in the error message. You should also correct the hostname in the [ndbd] section.