我正在尝试在 CentOS 中配置一个 mysql 集群,但我遇到了一些我不知道如何解决的问题,我非常感谢一些帮助。
mysql集群环境:
DB1 - 192.168.50.101 - Management Server (MGM) node.
DB2 - 192.168.50.102 - Storage Server (NDBD) node 1.
DB3 - 192.168.50.103 - Storage Server (NDBD) node 2.
我配置整个集群的步骤:
- 配置管理服务器节点 (192.168.50.101)
1.1 安装mysql服务器并启动它:
# yum install mysql mysql-server
# chkconfig --levels 235 mysqld on
# /etc/init.d/mysqld start
1.2 安装集群包:
# rpm -ivh MySQL-ndb-management-5.0.90-1.glibc23.i386.rpm
# rpm -ivh MySQL-ndb-tools-5.0.90-1.glibc23.i386.rpm
1.3 创建集群目录和config.ini文件
# mkdir /var/lib/mysql-cluster
# cd /var/lib/mysql-cluster
# vi config.ini
1.4 在config.ini中写入集群配置内容
[NDBD DEFAULT]
NoOfReplicas=2
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.
[MYSQLD DEFAULT]
[NDB_MGMD DEFAULT]
[TCP DEFAULT]
# Management Section (MGM)
[NDB_MGMD]
#NodeId = 1
# IP address of the management node
HostName=192.168.50.101
# Storage Server Section (NDBD)
[NDBD]
#NodeId = 2
# IP address of the Storage Server (NDBD) node 1
HostName=192.168.50.102
DataDir=/var/lib/mysql
BackupDataDir=/var/lib/backup
DataMemory=100M
[NDBD]
#NodeId = 3
# IP address of the Storage Server (NDBD) node 2
HostName=192.168.50.103
DataDir=/var/lib/mysql
BackupDataDir=/var/lib/backup
DataMemory=100M
# one [MYSQLD] per storage node
# 2 Clients MySQL
[MYSQLD]
#NodeId = 5
[MYSQLD]
#NodeId = 6
1.5 启动管理服务
# ndb_mgmd
1.6 进入管理控制台
# ndb_mgm
1.7 使用命令 SHOW 查看节点状态
ndb_mgm> show
Connected to Managemente Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 nodes
id=2 (not connected, accepting connect from 192.168.50.102)
id=3 (not connected, accepting connect from 192.168.50.103)
[ndb_mgmd(MGM)] 1 node
id=1 @192.168.50.101 (Version: 5.0.95)
[mysqld(API)] 2 nodes
id=5 (not connected, accepting connect from any host)
id=6 (not connected, accepting connect from any host)
- 管理节点配置OK,我们配置一个Storage Server节点(192.168.50.102)。
2.1 安装 mysql 服务器,如步骤 1.1 。
2.2 从“ http://dev.mysql.com/downloads/cluster/ ”下载MYSQL集群
2.3 提取内容并将文件ndb复制到/usr/bin/。
2.4 将存储服务器节点连接到管理服务器。
ndbd --connect-string=192.168.50.101 --initial -n
这就是问题所在。在 Management Server 中,将显示下一个错误:
ndb_mgm > Node 2: Forced node shutdown completed. Ocurred during startphase 0.
Caused by error 2350: 'Invalid configuration received from Management
Server(Configuration error). Permanent error, external action needed'.
在 Storage Server 节点中,显示的警告是:
[ndbd] INFO -- Angel connected to '102.168.50.101:1186'
[ndbd] INFO -- Angel allocated nodeid: 2
[ndbd] WARNING -- Configuration didn't contain generation (likely old ndb_mgmd
有人知道我应该怎么做才能解决这个问题吗?
谢谢!