mysql cluster管理节点无法连接sql节点,搞了好久还是没连上,有大牛帮忙看下吗

yunweigege 2015-03-10 04:12:40

-----------------------------------------------------
10.0.0.21 sql1节点、NDB1节点
节点启动方式:/var/lib/mysql/sbin/ndbd --initial
启动状态:正常
mysql启动方式:./bin/mysqld_safe &
启动状态:正常
-------------------------------------------------------

-------------------------------------------------------
10.0.0.22 sql2节点、NDB2节点
节点启动方式:/var/lib/mysql/sbin/ndbd --initial
启动状态:正常
mysql启动方式:./bin/mysqld_safe &
启动状态:正常
--------------------------------------------------------

--------------------------------------------------------
10.0.0.24 管理节点
节点启动方式:
./ndb_mgmd -f /var/lib/mysql-cluster/config.ini --initial
启动状态:正常
---------------------------------------------------------
问题:管理节点无法连接sql节点,如下:
报错日志
[root@localhost bin]# ./ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=2 (not connected, accepting connect from 10.0.0.21)
id=3 (not connected, accepting connect from 10.0.0.22)

<b>sql1的my.cnf配置:</b>
[client]
[mysqld]
port = 3306
basedir=/var/lib/mysql
datadir=/var/lib/data/mysql
socket=/var/lib/data/mysql/mysql.sock
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M


old_passwords=1
default-storage-engine=ndbcluster
ndbcluster
ndb-connectstring=10.0.0.24
[ndbd]
connect-string=10.0.0.24
[ndb_mgm]
connect-string=10.0.0.24
[ndb_mgmd]
config-file=/var/lib/mysql-cluster/config.ini
[mysql_cluster]
ndb-connectstring=10.0.0.24
[mysql.server]
user=mysql
[mysqld_safe]
log-error=/var/log/mysqld.log

#pid-file=/var/run/mysqld/mysqld.pid
[mysql]
# #socket=/usr/local/var/mysql.sock
[mysqladmin]
# #socket=/usr/local/var/mysql.sock
[ndb_restore default]
#


log-bin=mysql-bin

# binary logging format - mixed recommended
binlog_format=mixed

server-id = 1

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

<b>sql2的my.cnf配置:</b>


# The following options will be passed to all MySQL clients
[client]
#password = your_password
# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port = 3306
basedir=/var/lib/mysql
datadir=/var/lib/data/mysql
socket = /var/lib/data/mysql/mysql.sock
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

old_passwords=1
default-storage-engine=ndbcluster
ndbcluster
ndb-connectstring=10.0.0.24
[ndbd]
connect-string=10.0.0.24
[ndb_mgm]
connect-string=10.0.0.24
[ndb_mgmd]
config-file=/var/lib/mysql-cluster/config.ini
[mysql_cluster]
ndb-connectstring=10.0.0.24
[mysql.server]
user=mysql
[mysqld_safe]
log-error=/var/log/mysqld.log

#pid-file=/var/run/mysqld/mysqld.pid
[mysql]
#socket=/usr/local/var/mysql.sock
[mysqladmin]
#socket=/usr/local/var/mysql.sock
[ndb_restore default]



# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin

# binary logging format - mixed recommended
binlog_format=mixed


server-id = 1


[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

<b>管理节点服务器上config.ini配置:</b>
[ndbd default]
NoOfReplicas= 2
MaxNoOfConcurrentOperations= 500000
MaxNoOfLocalOperations=500000
MaxNoOfConcurrentTransactions=500000
MaxNoOfConcurrentIndexOperations=50000
# Amount of memory required=(SizeofDatabase * NumberOfReplicas * 1.1 ) / NumberOfDataNodes
DataMemory= 49152M
IndexMemory= 6144M
TimeBetweenWatchDogCheck= 30000
DataDir=/var/lib/mysql/data
MaxNoOfAttributes=500000
MaxNoOfTables=1000
MaxNoOfOrderedIndexes= 512
#StartPartialTimeout=100
#StartPartitionedTimeout=100
#ArbitrationTimeout=5000
#MaxNoOfFiredTriggers=8000
#TransactionBufferMemory=5M
TransactionDeadlockDetectionTimeout=90000
HeartbeatIntervalDbDb=5000


#StopOnError=1


[ndb_mgmd default]
DataDir=/var/lib/mysql/data
[ndb_mgmd]
NodeId=1
HostName= 10.0.0.24
[ndbd]
NodeId= 2
HostName= 10.0.0.21
[ndbd]
NodeId= 3
HostName= 10.0.0.22
[mysqld]
ArbitrationRank=2
[mysqld]
ArbitrationRank=2
[tcp default]
portnumber=3306
...全文
912 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
RUN_1991 2018-07-30
  • 打赏
  • 举报
回复
我的是因为虚拟机中ubuntu设置了静态ip的原因
RUN_1991 2018-07-30
  • 打赏
  • 举报
回复
手动阿斯顿发送到发都是
qwsazxwh 2016-03-23
  • 打赏
  • 举报
回复
楼主分享快点出来分享啦!
玉麟龙 2016-03-05
  • 打赏
  • 举报
回复
楼主好人,分享一下了!
dongmingguoji 2015-04-27
  • 打赏
  • 举报
回复
怎么解决的 楼主分享一下嘛!我也遇到同样的问题
yunweigege 2015-03-14
  • 打赏
  • 举报
回复
自己解决了ha

18,773

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 专题技术讨论区
社区管理员
  • 专题技术讨论区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧