本人在搭建MySQL cluster(版本7.2), 管理节点的配置如下:[ndbd default]
NoOfReplicas=1
DataMemory=200M
IndexMemory=20M
[ndb_mgmd]
NodeId=1
hostname=172.3.200.156
datadir=/var/lib/mysql-cluster/
[ndbd]
NodeId=5
hostname=172.3.200.161
datadir=/usr/local/mysql/ndbdata/
[ndbd]
NodeId=6
hostname=172.3.200.162
datadir=/usr/local/mysql/ndbdata/
[ndbd]
NodeId=7
hostname=172.3.200.163
datadir=/usr/local/mysql/ndbdata/
[ndbd]
NodeId=8
hostname=172.3.200.164
datadir=/usr/local/mysql/ndbdata/
[mysqld]
hostname=172.3.200.158
[mysqld]
hostname=172.3.200.160
[mysqld]
[mysqld]
数据节点的配置如下:
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-external-locking
key_buffer_size = 256M
max_allowed_packet = 1M
table_open_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
ndbcluster
ndb-connectstring = 172.3.200.156
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
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 = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
[mysql_cluster]
ndb-connectstring = 172.3.200.156
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid启动数据节点: ndbd --initial
报错如下:
Unable to connect with connect string: nodeid=0,172.3.200.156:1186
Retrying every 5 seconds. Attempts left: 12 11 10 9 8 7 6 5 4 3 2 1, failed.
2014-12-03 15:34:15 [ndbd] ERROR -- Could not connect to management server, error: ''
本人ping管理节点,可以ping通,到底是什么原因了???
上面的错误该如何解决了?
NoOfReplicas=1
DataMemory=200M
IndexMemory=20M
[ndb_mgmd]
NodeId=1
hostname=172.3.200.156
datadir=/var/lib/mysql-cluster/
[ndbd]
NodeId=5
hostname=172.3.200.161
datadir=/usr/local/mysql/ndbdata/
[ndbd]
NodeId=6
hostname=172.3.200.162
datadir=/usr/local/mysql/ndbdata/
[ndbd]
NodeId=7
hostname=172.3.200.163
datadir=/usr/local/mysql/ndbdata/
[ndbd]
NodeId=8
hostname=172.3.200.164
datadir=/usr/local/mysql/ndbdata/
[mysqld]
hostname=172.3.200.158
[mysqld]
hostname=172.3.200.160
[mysqld]
[mysqld]
数据节点的配置如下:
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-external-locking
key_buffer_size = 256M
max_allowed_packet = 1M
table_open_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
ndbcluster
ndb-connectstring = 172.3.200.156
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
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 = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
[mysql_cluster]
ndb-connectstring = 172.3.200.156
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid启动数据节点: ndbd --initial
报错如下:
Unable to connect with connect string: nodeid=0,172.3.200.156:1186
Retrying every 5 seconds. Attempts left: 12 11 10 9 8 7 6 5 4 3 2 1, failed.
2014-12-03 15:34:15 [ndbd] ERROR -- Could not connect to management server, error: ''
本人ping管理节点,可以ping通,到底是什么原因了???
上面的错误该如何解决了?
互相ping,能ping通,没有任何问题啊!到底是什么原因了?
好奇怪啊,今天竟然正常了。但是又有一个新的问题出现了:
在 SQL 节点1 上插入数据报错:
mysql> create table IRtable(id int)engine=ndb;
ERROR 157 (HY000): Could not connect to storage engine
我到 管理节点去查看配置文件:
ndb_mgm> show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 4 node(s)
id=2 (not connected, accepting connect from 172.3.200.161)
id=3 @172.3.200.162 (mysql-5.5.40 ndb-7.2.18, starting, Nodegroup: 0)
id=4 (not connected, accepting connect from 172.3.200.163)
id=5 (not connected, accepting connect from 172.3.200.164)
[ndb_mgmd(MGM)] 1 node(s)
id=1 @172.3.200.156 (mysql-5.5.40 ndb-7.2.18)
[mysqld(API)] 5 node(s)
id=8 (not connected, accepting connect from 172.3.200.158)
id=9 (not connected, accepting connect from 172.3.200.159)
id=10 (not connected, accepting connect from 172.3.200.160)
id=11 (not connected, accepting connect from any host)
id=12 (not connected, accepting connect from any host)