| 
 | 
2#
 
 
 楼主 |
发表于 2010-2-25 09:05:44
|
只看该作者
 
 
 
------------------------------------- 
 
 
6. start cluster: 
6.1 start management node: 
sunws05:/etc/mysql# ndb_mgmd -f /etc/mysql/config.ini 
2010-02-12 13:15:42 [MgmtSrvr] INFO -- NDB Cluster Management Server. mysql-5.1.39 ndb-7.0.9b 
2010-02-12 13:15:43 [MgmtSrvr] INFO -- Reading cluster configuration from '/etc/mysql/config.ini' 
2010-02-12 13:15:43 [MgmtSrvr] WARNING -- at line 20: Cluster configuration warning: 
arbitrator with id 1 and db node with id 2 on same host 10.80.1.15 
Running arbitrator on the same host as a database node may cause complete cluster shutdown in case of host failure. 
2010-02-12 13:15:44 [MgmtSrvr] INFO -- Reading cluster configuration from '/etc/mysql/config.ini' 
2010-02-12 13:15:44 [MgmtSrvr] WARNING -- at line 20: Cluster configuration warning: 
arbitrator with id 1 and db node with id 2 on same host 10.80.1.15 
Running arbitrator on the same host as a database node may cause complete cluster shutdown in case of host failure. 
sunws05:/etc/mysql# 
 
6.1.1 show cluster file/dir info: 
a) 
sunws05:/etc/mysql# cd /export/mysql/mysql-cluster 
sunws05:/export/mysql/mysql-cluster# ls 
ndb_1.pid ndb_1_cluster.log ndb_1_out.log 
b) 
sunws05:/export/mysql/mysql-cluster# cd /opt/mysql/mysql/mysql-cluster 
sunws05:/opt/mysql/mysql/mysql-cluster# ls 
ndb_1_config.bin.1 
 
6.1.2 show cluster process info: 
a) 
sunws05:/opt/mysql/mysql/mysql-cluster# ps -ef | grep mysql 
root 12694 22979 0 13:23:18 pts/3 0:00 grep mysql 
root 12163 1 0 13:15:44 ? 0:04 ndb_mgmd -f /etc/mysql/config.ini 
 
b) 
sunws05:/opt/mysql/mysql/mysql-cluster# ps -ef | grep ndb 
root 9622 1 0 17:47:15 ? 0:00 ndbd 
root 12696 22979 0 13:23:24 pts/3 0:00 grep ndb 
root 9623 9622 1 17:47:15 ? 20:33 ndbd 
root 12163 1 0 13:15:44 ? 0:04 ndb_mgmd -f /etc/mysql/config.ini 
 
6.1.3 cluster info: 
 
sunws05:/opt/mysql/mysql/mysql-cluster# ndb_mgm 
-- NDB Cluster -- Management Client -- 
ndb_mgm> show 
Connected to Management Server at: 10.80.1.15:1186 
Cluster Configuration 
--------------------- 
[ndbd(NDB)] 2 node(s) 
id=2 @10.80.1.15 (mysql-5.1.39 ndb-7.0.9, starting, Nodegroup: 0) 
id=3 (not connected, accepting connect from 10.80.1.16) 
 
[ndb_mgmd(MGM)] 1 node(s) 
id=1 @10.80.1.15 (mysql-5.1.39 ndb-7.0.9) 
 
[mysqld(API)] 2 node(s) 
id=4 (not connected, accepting connect from 10.80.1.15) 
id=5 (not connected, accepting connect from any host) 
 
ndb_mgm> 
 
 
6.2 start data node: 
sunws05:/# ndbd 
2010-02-12 13:51:52 [ndbd] INFO -- Configuration fetched from '10.80.1.15:1186', generation: 1 
 
6.2.1 show data node info: 
sunws05:/# ndb_mgm 
-- NDB Cluster -- Management Client -- 
ndb_mgm> show 
Connected to Management Server at: 10.80.1.15:1186 
Cluster Configuration 
--------------------- 
[ndbd(NDB)] 2 node(s) 
id=2 @10.80.1.15 (mysql-5.1.39 ndb-7.0.9, starting, Nodegroup: 0) 
id=3 (not connected, accepting connect from 10.80.1.16) 
 
[ndb_mgmd(MGM)] 1 node(s) 
id=1 @10.80.1.15 (mysql-5.1.39 ndb-7.0.9) 
 
[mysqld(API)] 2 node(s) 
id=4 (not connected, accepting connect from 10.80.1.15) 
id=5 (not connected, accepting connect from any host) 
 
ndb_mgm> 
 
6.3 start SQL node: 
sunws05:/# mysqld_safe & 
 
6.3.1 show error file: 
sunws05:/var/lib/mysql/mysql# vi /var/lib/mysql/sunws05.err 
"/var/lib/mysql/sunws05.err" 25 lines, 1682 characters 
100212 13:53:43 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 
100212 13:53:43 [Note] Plugin 'FEDERATED' is disabled. 
InnoDB: The first specified data file ./ibdata1 did not exist: 
InnoDB: a new database to be created! 
100212 13:53:43 InnoDB: Setting file ./ibdata1 size to 10 MB 
InnoDB: Database physically writes the file full: wait... 
100212 13:53:44 InnoDB: Log file ./ib_logfile0 did not exist: new to be created 
InnoDB: Setting log file ./ib_logfile0 size to 5 MB 
InnoDB: Database physically writes the file full: wait... 
100212 13:53:44 InnoDB: Log file ./ib_logfile1 did not exist: new to be created 
InnoDB: Setting log file ./ib_logfile1 size to 5 MB 
InnoDB: Database physically writes the file full: wait... 
InnoDB: Doublewrite buffer not found: creating new 
InnoDB: Doublewrite buffer created 
InnoDB: Creating foreign key constraint system tables 
InnoDB: Foreign key constraint system tables created 
100212 13:53:45 InnoDB: Started; log sequence number 0 0 
100212 13:53:45 [Note] NDB: NodeID is 4, management server '10.80.1.15:1186' 
100212 13:53:46 [Note] NDB[0]: NodeID: 4, no storage nodes connected (timed out) 
100212 13:53:46 [Warning] NDB: server id set to zero will cause any other mysqld with bin log to log with wrong server id 
100212 13:53:46 [Note] Starting Cluster Binlog Thread 
100212 13:53:46 [Note] Event Scheduler: Loaded 0 events 
100212 13:54:01 [Warning] NDB : Tables not available after 15 seconds. Consider increasing --ndb-wait-setup value 
100212 13:54:01 [Note] /opt/mysql/mysql/bin/mysqld: ready for connections. 
Version: '5.1.39-ndb-7.0.9-cluster-gpl' socket: '/tmp/mysql.sock' port: 3306 MySQL Cluster Server (GPL) 
~~~~~~~~we can see that mysqld is stared!!! but it does NOT work, i'll show you later. 
 
6.3.2 show cluster info: 
sunws05:/# ndb_mgm 
-- NDB Cluster -- Management Client -- 
ndb_mgm> show 
Connected to Management Server at: 10.80.1.15:1186 
Cluster Configuration 
--------------------- 
[ndbd(NDB)] 2 node(s) 
id=2 @10.80.1.15 (mysql-5.1.39 ndb-7.0.9, starting, Nodegroup: 0) 
id=3 (not connected, accepting connect from 10.80.1.16) 
 
[ndb_mgmd(MGM)] 1 node(s) 
id=1 @10.80.1.15 (mysql-5.1.39 ndb-7.0.9) 
 
[mysqld(API)] 2 node(s) 
id=4 (not connected, accepting connect from 10.80.1.15) 
id=5 (not connected, accepting connect from any host) 
 
ndb_mgm> 
 
~~~~~~we can see, SQL node does NOT join the mysql cluster!!! 
 
 
6.3.3 Now, let's see the error file[/var/lib/mysql/sunws05.err] again, i find that below contents are added: 
100212 14:00:12 [Warning] NDB: Could not acquire global schema lock (4009)Cluster Failure 
100212 14:03:15 [Warning] NDB: Could not acquire global schema lock (4009)Cluster Failure 
100212 14:03:53 [Warning] NDB: Could not acquire global schema lock (4009)Cluster Failure 
 
6.3.4 create DB: 
mysql> CREATE TABLE Persons( 
-> Id_P int, 
-> LastName varchar(255), 
-> FirstName varchar(255), 
-> Address varchar(255), 
-> City varchar(255) 
-> )ENGINE=NDBCLUSTER; 
ERROR 1005 (HY000): Can't create table 'genview.Persons' (errno: 157) |   
 
 
 
 |