MySQL Clusterã®ã¨ã©ã¼ã«ã¤ãã¦èª¿ã¹ã¦ã¿ã
è¨å®èªä½ã¯çµæ§åã«çµãã£ã¦ããã ãã©ãæ¹ãã¦ã¨ã©ã¼ã«ã¤ãã¦èª¿ã¹ã¦ã¿ãã
ã©ããã¦ã¨ã©ã¼ãåºãã®ããä½ãã©ãããã°ã¨ã©ã¼ãåºãªããªãã®ããã®è¾ºãã
éç¨ä¸ã®ã¨ã©ã¼ã¯ã¾ã åºãäºããªãã
ä»ã¾ã§è¦ãäºã®ããã¨ã©ã¼ã¯ããã§å
¨é¨ã
ãã¨ã¯è¨å®ã®ç¢ºèªæ¹æ³ã
ã
NDBãèµ·ååºæ¥ãªã
ndb_mgm> Node 11: Forced node shutdown completed. Occured during startphase 5. Caused by error 2355: 'Failure to restore schema(Resource configuration error). Permanent error, external action needed'.
ã
config.iniã§è¨å®ããã¦ãããªã½ã¼ã¹ã®å²ãå½ã¦ã§ã¯NDBãèµ·ååºæ¥ãªãã
MaxNoOfOrderedIndexesã¨ããä¸ããå¿
è¦ãããããã
service ndbd restartããå´ã§ã¯OKã¨åºããã©ãå®ã¯èµ·å失æãã¦ããã¿ã¼ã³ã
ã
SQLãå®è¡åºæ¥ãªã
errno: 136
ERROR 1005 (HY000) at line 651: Can't create table 'test_db.test_51' (errno: 136)
ã
MaxNoOfOrderedIndexesã®å¤ã大ããããã
ããã©ã«ãã®å¤ã¯128ã
ä¸ããããã¨ã¡ã¢ãªãè¶³ããªãã¦å¤§å¤ãªäºã«ãªãã
ã
errno: 708
ERROR 1005 (HY000) at line 833: Can't create table 'test_db.test_65' (errno: 708)
ã
MaxNoOfAttributesã®å¤ã大ããããã
ããã©ã«ãã®å¤ã¯1000ã§ã32ã4294967039ã§æå®ããã
ä¸ããããã¨ã¡ã¢ãªãè¶³ããªãã¦å¤§å¤ãªäºã«ãªãã
ã
ãã¥ã¼ãã³ã°ããæã«ç¢ºèªããã¹ãç®æ
ã»Dataãã¼ããæä½1å°ã¯èµ·åãã¦ãããã
ã»Dataãã¼ãã®service ndbd restartã®åºåã
ã»ç®¡çãã¼ãã®ndb_mgmã®åºåã
ã»Dataãã¼ãã®xvc0ã®åºåã(ã¡ã¢ãªã®ã¨ã©ã¼ãåºã¦ãªãã)
ã
è¨å®ç¢ºèª
管çãã¼ãããndb_mgmã§èµ·åç¶æ³ã確èª
# ndb_mgm -- NDB Cluster -- Management Client -- ndb_mgm> show Connected to Management Server at: 192.168.0.80:1186 Cluster Configuration --------------------- [ndbd(NDB)] 2 node(s) id=11 @192.168.0.81 (mysql-5.1.47 ndb-7.1.5, Nodegroup: 0, Master) id=12 @192.168.0.82 (mysql-5.1.47 ndb-7.1.5, Nodegroup: 0) [ndb_mgmd(MGM)] 1 node(s) id=1 @192.168.0.80 (mysql-5.1.47 ndb-7.1.5) [mysqld(API)] 2 node(s) id=21 @192.168.0.81 (mysql-5.1.47 ndb-7.1.5) id=22 @192.168.0.82 (mysql-5.1.47 ndb-7.1.5)
ã
管çãã¼ãããndb_configã§è¨å®ã確èª
queryãã©ã¡ã¼ã¿ã¯ãconfig.iniã§è¨å®ãããã¼ã¨åãã
ã
å
¨ä½ã®ç¢ºèªã
# ndb_config --query=id,type,HostName --fields=", " --rows="\n" 1, ndb_mgmd, 192.168.0.80 21, mysqld, 192.168.0.81 22, mysqld, 192.168.0.82 11, ndbd, 192.168.0.81 12, ndbd, 192.168.0.82
ã
管çãã¼ãã®ç¢ºèªã
# ndb_config --type=ndb_mgmd --query=id,type,HostName,PortNumber,DataDir --fields=", " --rows="\n" 1, ndb_mgmd, 192.168.0.80, 1186, /var/lib/mysql-cluster
ã
Dataãã¼ãã®ç¢ºèªã
# ndb_config --type=ndbd --query=id,type,HostName,NoOfReplicas,DataMemory,IndexMemory,StringMemory,DataDir,FileSystemPath,BackupDataDir --fields=", " --rows="\n" 11, ndbd, 192.168.0.81, 2, 167772160, 37748736, 25, /usr/local/mysql/data, /usr/local/mysql/data, /usr/local/mysql/data 12, ndbd, 192.168.0.82, 2, 167772160, 37748736, 25, /usr/local/mysql/data, /usr/local/mysql/data, /usr/local/mysql/data
ã
SQLãã¼ãã®ç¢ºèªã
# ndb_config --type=mysqld --query=id,type,HostName,BatchByteSize,BatchSize,MaxScanBatchSize --fields=", " --rows="\n" 21, mysqld, 192.168.0.81, 32768, 64, 262144 22, mysqld, 192.168.0.82, 32768, 64, 262144
ã
SQLãã¼ãããMySQL Clusterã®è¨å®ã確èª
$ mysql -h192.168.0.81 -uxxx -pxxx Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 26 Server version: 5.1.47-ndb-7.1.5-cluster-gpl MySQL Cluster Server (GPL) Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> SHOW STATUS LIKE 'ndb%'; +--------------------------------+--------------+ | Variable_name | Value | +--------------------------------+--------------+ | Ndb_cluster_node_id | 21 | | Ndb_config_from_host | 192.168.0.80 | | Ndb_config_from_port | 1186 | | Ndb_number_of_data_nodes | 2 | | Ndb_number_of_ready_data_nodes | 2 | | Ndb_connect_count | 1 | | Ndb_execute_count | 48 | | Ndb_scan_count | 48 | | Ndb_pruned_scan_count | 0 | | Ndb_cluster_connection_pool | 1 | | Ndb_conflict_fn_max | 0 | | Ndb_conflict_fn_old | 0 | +--------------------------------+--------------+ 12 rows in set (0.00 sec)
ã
åèURL
MySQL :: MySQL 5.1 ãªãã¡ã¬ã³ã¹ããã¥ã¢ã« :: 14.4.4.4 ããã¸ã¡ã³ã ãµã¼ãã¼ã®å®ç¾©
http://dev.mysql.com/doc/refman/5.1/ja/mysql-cluster-mgm-definition.html
ã
MySQL :: MySQL 5.1 ãªãã¡ã¬ã³ã¹ããã¥ã¢ã« :: 14.4.4.5 Defining Data Nodes
http://dev.mysql.com/doc/refman/5.1/ja/mysql-cluster-ndbd-definition.html
ã
MySQL :: MySQL 5.1 ãªãã¡ã¬ã³ã¹ããã¥ã¢ã« :: 14.4.4.6 SQL ããã³ä»ã® API ãã¼ãã®å®ç¾©
http://dev.mysql.com/doc/refman/5.1/ja/mysql-cluster-api-definition.html
ã
MySQL :: MySQL 5.1 ãªãã¡ã¬ã³ã¹ããã¥ã¢ã« :: 14.9.1 ndb_config - NDB è¨å®æ
å ±ã®æ½åº
http://dev.mysql.com/doc/refman/5.1/ja/mysql-cluster-utilities-ndb-config.html