[root@myqClter2 bin]# ./ndbd --initial
Unable to connect with connect string: nodeid=0,192.168.55.15:1186
Retrying every 5 seconds. Attempts left: 12 11 10 9 8 7 6 5 4 3 2 1, failed.
2015-01-23 15:35:50 [ndbd] ERROR -- Could not connect to management server, error: ''
[root@myqClter2 bin]#
修改防火墙,放开1186端口
[root@myqClter1 bin]# vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 1186 -j ACCEPT
[root@myqClter2 bin]#
[root@myqClter2 bin]# ./ndbd --initial
2015-01-23 15:36:34 [ndbd] INFO -- Angel connected to '192.168.55.15:1186'
2015-01-23 15:36:34 [ndbd] INFO -- Angel allocated nodeid: 3
[root@myqClter2 bin]#
启动sql节点
[root@myqClter1 bin]# ps -ef | grep mysql
root 3749 1 2 15:25 ? 00:00:33 ndb_mgmd -f /var/lib/mysql-cluster/config.ini
root 3920 3629 0 15:44 pts/1 00:00:00 grep mysql
[root@myqClter1 bin]#
[root@myqClter1 bin]# /etc/init.d/mysqld status
ERROR! MySQL is not running
[root@myqClter1 bin]# /etc/init.d/mysqld start
Starting MySQL.......................................... SUCCESS!
[root@myqClter1 bin]#
[root@myqClter1 bin]# ps -ef | grep mysql
root 3749 1 2 15:25 ? 00:00:37 ndb_mgmd -f /var/lib/mysql-cluster/config.ini
root 3935 1 0 15:44 pts/1 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/myqClter1.pid
mysql 4062 3935 1 15:44 pts/1 00:00:01 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/myqClter1.err --pid-file=/usr/local/mysql/data/myqClter1.pid
root 4176 3629 0 15:46 pts/1 00:00:00 grep mysql
[root@myqClter1 bin]#
14
客户端管理使用/usr/local/bin/ndb_mgm
ndb_mgm ndb_mgmd
[root@myqClter1 bin]# ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> help
---------------------------------------------------------------------------
NDB Cluster -- Management Client -- Help
---------------------------------------------------------------------------
HELP Print help text
HELP COMMAND Print detailed help for COMMAND(e.g. SHOW)
SHOW Print information about cluster
CREATE NODEGROUP
DROP NODEGROUP
START BACKUP [NOWAIT | WAIT STARTED | WAIT COMPLETED]
START BACKUP [
START BACKUP [
Start backup (default WAIT COMPLETED,SNAPSHOTEND)
ABORT BACKUP
SHUTDOWN Shutdown all processes in cluster
CLUSTERLOG ON [
CLUSTERLOG OFF [
CLUSTERLOG TOGGLE [
CLUSTERLOG INFO Print cluster log information
ENTER SINGLE USER MODE
EXIT SINGLE USER MODE Exit single user mode
PURGE STALE SESSIONS Reset reserved nodeid's in the mgmt server
CONNECT [
QUIT Quit management client