[SOLVED] MySQL API won't connect to the Cluster
I've read a few threads on this already and searched the net far and wide with no
luck solving the problem.
For now I only have 2 servers to work with so one of the servers is also running the cluster mgmt daemon as well as NDBD and mysql. I'm not sure if this is the problem or what but I would think that would work just fine for testing purposes.
Basically, I start up my mgmt service, startup NDBD and then start up mysqld like so:
ndb_mgmd -f /var/lib/mysql-cluster/config.ini
ndbd
/etc/init.d/mysql start
and doing a show shows:
ndb_mgm> show
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=2 @10.10.254.22 (Version: 5.0.21, Nodegroup: 0, Master)
id=3 @10.10.254.25 (Version: 5.0.21, Nodegroup: 0)
[ndb_mgmd(MGM)] 1 node(s)
id=1 @10.10.254.22 (Version: 5.0.21)
[mysqld(API)] 2 node(s)
id=4 (not connected, accepting connect from any host)
id=5 (not connected, accepting connect from any host)
and
# ps ax | egrep "mysql|ndb"
17941 ? Ssl 0:00 /usr/sbin/ndb_mgmd -f /var/lib/mysql-cluster/config.ini
18011 ? Ss 0:00 /usr/sbin/ndbd
18012 ? Sl 0:00 /usr/sbin/ndbd
18986 pts/4 S 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/mustang.pid
19017 pts/4 Sl 0:00 /usr/sbin/mysqld-max --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/mustang.pid --skip-locking --socket=/var/lib/mysql/mysql.sock
19166 pts/4 S+ 0:00 egrep mysql|ndb
Now before I post configs etc, I just think its weird that when I netstat this, I get the following:
# netstat -punta| grep 1186 | egrep -v "127.0.0.1|0.0.0.0" |gawk '// {print $4 "\t" $5 "\t" $6 "\t" $7}'
10.10.254.22:1186 10.10.254.22:35588 ESTABLISHED 17941/ndb_mgmd
10.10.254.22:35588 10.10.254.22:1186 ESTABLISHED 18157/mysqld-max
10.10.254.22:58277 10.10.254.22:1186 ESTABLISHED 18012/ndbd
10.10.254.22:1186 10.10.254.22:45435 CLOSE_WAIT 17941/ndb_mgmd
10.10.254.22:1186 10.10.254.22:58277 ESTABLISHED 17941/ndb_mgmd
10.10.254.22:1186 10.10.254.25:36653 ESTABLISHED 17941/ndb_mgmd
As you can see both ndbd and mysqld-max have an established connection to ndb_mgmd on port 1186. So I don't understand how it can say that mysql is not connected. And the logs say nothing of it even trying to connect.
Anyway on to config files.
/var/lib/mysql-cluster/config.ini:
[NDBD DEFAULT]
NoOfReplicas=2
[MYSQLD DEFAULT]
[NDB_MGMD DEFAULT]
[TCP DEFAULT]
[NDB_MGMD]
HostName=10.10.254.22
[NDBD]
HostName=10.10.254.22
DataDir= /var/lib/mysql-cluster
[NDBD]
HostName=10.10.254.25
DataDir= /var/lib/mysql-cluster
[MYSQLD]
[MYSQLD]
And I have tried actually assigning IPs to the MYSQLD portions as well and the same result so I've left it open to any hosts for now.
/etc/my.cnf:
[mysqld]
ndbcluster
ndb-connectstring=10.10.254.22
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
[mysql_cluster]
ndb-connectstring=10.10.254.22
[ndbd]
connect-string=10.10.254.22
[ndb_mgm]
connect-string=10.10.254.22
[ndb_mgmd]
config-file=/var/lib/mysql-cluster/config.ini
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
[mysql.server]
user=mysql
basedir=/var/lib
[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
And the second IP has a similar my.cnf config but whether I add that to the mix or not, MySQL still doesn't seem to connect up even though netstat shows it doing so.
Also in MySQL:
SHOW ENGINES includes:
NDBCLUSTER = YES
NDB = YES
SHOW VARIABLES LIKE 'have%' includes:
have_ndbcluster = YES
Any help appreciated. Thanks
EDIT:
Versions of things are:
Linux = CentOS Linux 2.6.9 kernel x86_64
MySQL = 4.1.19 (client, server, shared, and max)
NDB 5.0.21 (mgmt, storage, tools, and extra)
Edited 3 time(s). Last edit at 05/10/2006 10:11AM by Jeremy Truax.
Subject
Views
Written By
Posted
[SOLVED] MySQL API won't connect to the Cluster
3301
May 09, 2006 05:26PM
1664
May 09, 2006 07:56PM
1535
May 10, 2006 10:10AM
1382
May 10, 2006 11:02PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.