Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

mysql cluster测试记录 - 20120905

365 views

Published on

mysql cluster测试记录

Published in: Technology, Health & Medicine
  • Be the first to comment

mysql cluster测试记录 - 20120905

  1. 1. 1. ´´½¨»ùÓÚ´ÅÅ̵ı¾µØ±í¿Õ¼ä CREATE LOGFILE GROUP logfile_group ADD UNDOFILE 'undo_file' [INITIAL_SIZE [=] initial_size] [UNDO_BUFFER_SIZE [=] undo_buffer_size] [REDO_BUFFER_SIZE [=] redo_buffer_size] [NODEGROUP [=] nodegroup_id] [WAIT] [COMMENT [=] comment_text] ENGINE [=] engine_name a) ´´½¨ÈÕÖ¾±í¿Õ¼ä ×¢Ò⣺ 1) Ö»ÄÜÓÐÒ»¸ölogfile group 2) Ò»´ÎÖ»ÄÜÌí¼ÓÒ»¸öundofile 3) ÅäÖÃÎļþÖÐÒѾÉèÖÃredo_buffer_sizeµÄ»°£¬ÃüÁîÐÐÖв»¿ÉÐ޸ĻòÖØÐÂÉ趨 create logfile group NDB_LOGGRP ADD UNDOFILE 'NDB_UNDO_01.dbf' INITIAL_SIZE=1024M ENGINE=NDBCLUSTER; alter logfile group NDB_LOGGRP ADD UNDOFILE 'NDB_UNDO_02.dbf' INITIAL_SIZE=1024M ENGINE=NDBCLUSTER; alter logfile group NDB_LOGGRP ADD UNDOFILE 'NDB_UNDO_03.dbf' INITIAL_SIZE=1024M ENGINE=NDBCLUSTER; 2. ´´½¨Êý¾Ý±í¿Õ¼ä ×¢Ò⣺ 1) ¿ÉÒÔ´´½¨¶à¸öÊý¾Ý±í¿Õ¼äÎļþ 2) ¶à¸öÊý¾Ý±í¿Õ¼ä£¬°üÀ¨ÈÕÖ¾¿Õ¼ä£¬Îļþ²»¿ÉͬÃû 3) ɾ³ýÊý¾Ý±í¿Õ¼äÇ°£¬ÐèÒªÏÈɾ³ýÊý¾ÝÎļþ CREATE TABLESPACE tablespace_name ADD DATAFILE 'file_name' USE LOGFILE GROUP logfile_group [EXTENT_SIZE [=] extent_size] [INITIAL_SIZE [=] initial_size] [AUTOEXTEND_SIZE [=] autoextend_size] [MAX_SIZE [=] max_size] [NODEGROUP [=] nodegroup_id] [WAIT] [COMMENT [=] comment_text] ENGINE [=] engine_name create tablespace NDB_TBSPC_01 ADD DATAFILE 'NDB_TBSPC_01.dbf' USE LOGFILE GROUP NDB_LOGGRP EXTENT_SIZE = 64M INITIAL_SIZE = 1024M AUTOEXTEND_SIZE = 64M ENGINE = NDBCLUSTER; alter tablespace NDB_TBSPC_01 ADD DATAFILE 'NDB_TBSPC_02.dbf' INITIAL_SIZE=1024M ENGINE=NDBCLUSTER; alter tablespace NDB_TBSPC_01 ADD DATAFILE 'NDB_TBSPC_03.dbf' INITIAL_SIZE=1024M ENGINE=NDBCLUSTER; alter tablespace NDB_TBSPC_01 ADD DATAFILE 'NDB_TBSPC_04.dbf' INITIAL_SIZE=1024M ENGINE=NDBCLUSTER; alter tablespace NDB_TBSPC_01 ADD DATAFILE 'NDB_TBSPC_04.dbf' INITIAL_SIZE=1024M ENGINE=NDBCLUSTER; alter tablespace NDB_TBSPC_01 ADD DATAFILE 'NDB_TBSPC_05.dbf' INITIAL_SIZE=1024M ENGINE=NDBCLUSTER; alter tablespace NDB_TBSPC_01 ADD DATAFILE 'NDB_TBSPC_06.dbf'
  2. 2. INITIAL_SIZE=1024M ENGINE=NDBCLUSTER; alter tablespace NDB_TBSPC_01 ADD DATAFILE 'NDB_TBSPC_07.dbf' INITIAL_SIZE=1024M ENGINE=NDBCLUSTER; alter tablespace NDB_TBSPC_01 ADD DATAFILE 'NDB_TBSPC_08.dbf' INITIAL_SIZE=1024M ENGINE=NDBCLUSTER; alter tablespace NDB_TBSPC_01 ADD DATAFILE 'NDB_TBSPC_09.dbf' INITIAL_SIZE=1024M ENGINE=NDBCLUSTER; alter tablespace NDB_TBSPC_01 ADD DATAFILE 'NDB_TBSPC_10.dbf' INITIAL_SIZE=1024M ENGINE=NDBCLUSTER; create tablespace NDB_TBSPC_02 ADD DATAFILE 'NDB_TBSPC_001.dbf' USE LOGFILE GROUP NDB_LOGGRP EXTENT_SIZE = 64M INITIAL_SIZE = 1024M AUTOEXTEND_SIZE = 64M ENGINE = NDBCLUSTER; alter tablespace NDB_TBSPC_02 ADD DATAFILE 'NDB_TBSPC_002.dbf' INITIAL_SIZE=1024M ENGINE=NDBCLUSTER; alter tablespace NDB_TBSPC_02 ADD DATAFILE 'NDB_TBSPC_003.dbf' INITIAL_SIZE=1024M ENGINE=NDBCLUSTER; alter tablespace NDB_TBSPC_02 ADD DATAFILE 'NDB_TBSPC_004.dbf' INITIAL_SIZE=1024M ENGINE=NDBCLUSTER; alter tablespace NDB_TBSPC_02 ADD DATAFILE 'NDB_TBSPC_005.dbf' INITIAL_SIZE=1024M ENGINE=NDBCLUSTER; alter tablespace NDB_TBSPC_02 ADD DATAFILE 'NDB_TBSPC_006.dbf' INITIAL_SIZE=1024M ENGINE=NDBCLUSTER; alter tablespace NDB_TBSPC_02 ADD DATAFILE 'NDB_TBSPC_007.dbf' INITIAL_SIZE=1024M ENGINE=NDBCLUSTER; alter tablespace NDB_TBSPC_02 ADD DATAFILE 'NDB_TBSPC_008.dbf' INITIAL_SIZE=1024M ENGINE=NDBCLUSTER; alter tablespace NDB_TBSPC_02 ADD DATAFILE 'NDB_TBSPC_009.dbf' INITIAL_SIZE=1024M ENGINE=NDBCLUSTER; alter tablespace NDB_TBSPC_02 ADD DATAFILE 'NDB_TBSPC_010.dbf' INITIAL_SIZE=1024M ENGINE=NDBCLUSTER; 4.±í¿Õ¼äµÄ¹ÜÀíÊý¾ÝÎļþµÄ¹ÜÀí SELECT TABLESPACE_NAME, FILE_NAME, EXTENT_SIZE*TOTAL_EXTENTS/1024/1024 AS TOTAL_MB, EXTENT_SIZE*FREE_EXTENTS/1024/1024 AS FREE_MB, EXTRA FROM information_schema.FILES WHERE FILE_TYPE="DATAFILE"; | DATAFILE | | TABLESPACE | | UNDO LOG | SELECT TABLESPACE_NAME, FILE_NAME, EXTENT_SIZE*TOTAL_EXTENTS/1024/1024 AS TOTAL_MB, EXTENT_SIZE*TOTAL_EXTENTS/1024/1024 - EXTENT_SIZE*FREE_EXTENTS/1024/1024 as USED_MB,
  3. 3. EXTENT_SIZE*FREE_EXTENTS/1024/1024 AS FREE_MB, EXTRA FROM information_schema.FILES WHERE FILE_TYPE="DATAFILE"; ¼ÆËã×ܹ²Ê¹ÓÃÂÊ SELECT SUM(EXTENT_SIZE*TOTAL_EXTENTS/1024/1024 - EXTENT_SIZE*FREE_EXTENTS/1024/1024) AS USED_MB, SUM(EXTENT_SIZE*TOTAL_EXTENTS/1024/1024) AS TOTAL_MB FROM information_schema.FILES WHERE FILE_TYPE="DATAFILE" and extra='CLUSTER_NODE=9'; create table orders_dd ( `o_id` int(11) NOT NULL, `o_d_id` tinyint(4) NOT NULL, `o_w_id` smallint(6) NOT NULL, `o_c_id` int(11) DEFAULT NULL, `o_entry_d` datetime DEFAULT NULL, `o_carrier_id` tinyint(4) DEFAULT NULL, `o_ol_cnt` tinyint(4) DEFAULT NULL, `o_all_local` tinyint(4) DEFAULT NULL, PRIMARY KEY (`o_w_id`, `o_d_id`, `o_id`) ) tablespace NDB_TBSPC_01 storage disk engine= ndbcluster; tpcc_load ³õʼ»¯ 10¸öDW ÄÚ´æ±í time ./tpcc_load 10.25.43.6 tpcc tpcc tpcc 10 >> tpcc.log 2>&1 real 82m55.160s user 0m53.644s sys 0m51.201s diskdata ±í time ./tpcc_load 10.25.43.6 tpcc_dd tpcc tpcc 10 >> tpcc.log 2>&1 real 88m39.956s user 0m53.840s sys 0m51.097s 100¸öDW ÄÚ´æ±í£º time ./tpcc_load 10.25.43.6 tpcc tpcc tpcc 100 >> tpcc_load_memtab.log 2>&1 real 826m44.399s user 8m56.636s sys 8m25.012s +------------+------------+---------+------------+----------+---------------- +-------------+-----------------+--------------+-----------+---------------- +-------------+-------------+------------+-------------------+---------- +----------------+---------+ | Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment | +------------+------------+---------+------------+----------+---------------- +-------------+-----------------+--------------+-----------+---------------- +-------------+-------------+------------+-------------------+---------- +----------------+---------+ | customer | ndbcluster | 10 | Dynamic | 3000000 | 124 | 1494810624 | 0 | 0 | 0 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | | | district | ndbcluster | 10 | Dynamic | 1000 | 68 |
  4. 4. 589824 | 0 | 0 | 0 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | | | history | ndbcluster | 10 | Dynamic | 3000000 | 68 | 293437440 | 0 | 0 | 0 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | | | item | ndbcluster | 10 | Dynamic | 100000 | 40 | 11501568 | 0 | 0 | 0 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | | | new_orders | ndbcluster | 10 | Fixed | 900000 | 36 | 32735232 | 0 | 0 | 0 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | | | order_line | ndbcluster | 10 | Fixed | 29997297 | 92 | 2776825856 | 0 | 0 | 0 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | | | orders | ndbcluster | 10 | Fixed | 3000000 | 64 | 192905216 | 0 | 0 | 0 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | | | stock | ndbcluster | 10 | Dynamic | 10000000 | 292 | 3450929152 | 0 | 0 | 0 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | | | warehouse | ndbcluster | 10 | Dynamic | 100 | 60 | 589824 | 0 | 0 | 0 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | | +------------+------------+---------+------------+----------+---------------- +-------------+-----------------+--------------+-----------+---------------- +-------------+-------------+------------+-------------------+---------- +----------------+---------+ DISK±í time ./tpcc_load 10.25.36.166 tpcc_dd tpcc tpcc 100 >> tpcc_load_ddtab_201209181043.log 2>&1 real 888m54.743s user 8m59.293s sys 8m21.223s +------------+------------+---------+------------+----------+---------------- +-------------+-----------------+--------------+-----------+---------------- +-------------+-------------+------------+-------------------+---------- +----------------+---------+ | Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment | +------------+------------+---------+------------+----------+---------------- +-------------+-----------------+--------------+-----------+---------------- +-------------+-------------+------------+-------------------+---------- +----------------+---------+ | customer | ndbcluster | 10 | Dynamic | 3000000 | 48 | 1007124480 | 1207959552 | 0 | 559720704 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | | | district | ndbcluster | 10 | Dynamic | 1000 | 40 | 294912 | 603979776 | 0 | 600824928 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | |
  5. 5. | history | ndbcluster | 10 | Dynamic | 3000000 | 40 | 120586240 | 603979776 | 0 | 372956928 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | | | item | ndbcluster | 10 | Dynamic | 100000 | 36 | 3833856 | 603979776 | 0 | 589598464 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | | | new_orders | ndbcluster | 10 | Fixed | 900000 | 36 | 32735232 | 0 | 0 | 0 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | | | order_line | ndbcluster | 10 | Fixed | 29999148 | 48 | 1445724160 | 2415919104 | 0 | 486536448 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | | | orders | ndbcluster | 10 | Fixed | 3000000 | 44 | 132775936 | 603979776 | 0 | 481620480 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | | | stock | ndbcluster | 10 | Dynamic | 10000000 | 40 | 401702912 | 3623878656 | 0 | 343180800 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | | | warehouse | ndbcluster | 10 | Dynamic | 100 | 36 | 294912 | 603979776 | 0 | 601607680 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | | +------------+------------+---------+------------+----------+---------------- +-------------+-----------------+--------------+-----------+---------------- +-------------+-------------+------------+-------------------+---------- +----------------+---------+
  6. 6. | history | ndbcluster | 10 | Dynamic | 3000000 | 40 | 120586240 | 603979776 | 0 | 372956928 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | | | item | ndbcluster | 10 | Dynamic | 100000 | 36 | 3833856 | 603979776 | 0 | 589598464 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | | | new_orders | ndbcluster | 10 | Fixed | 900000 | 36 | 32735232 | 0 | 0 | 0 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | | | order_line | ndbcluster | 10 | Fixed | 29999148 | 48 | 1445724160 | 2415919104 | 0 | 486536448 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | | | orders | ndbcluster | 10 | Fixed | 3000000 | 44 | 132775936 | 603979776 | 0 | 481620480 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | | | stock | ndbcluster | 10 | Dynamic | 10000000 | 40 | 401702912 | 3623878656 | 0 | 343180800 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | | | warehouse | ndbcluster | 10 | Dynamic | 100 | 36 | 294912 | 603979776 | 0 | 601607680 | NULL | NULL | NULL | NULL | latin1_swedish_ci | NULL | | | +------------+------------+---------+------------+----------+---------------- +-------------+-----------------+--------------+-----------+---------------- +-------------+-------------+------------+-------------------+---------- +----------------+---------+

×