반응형

Slice

 

Xpand는 기본적으로 node개수 만큼 테이블, PK, index를 나누어서 저장한다 (hash_dist_min_slices =0)

이때 동등한 크기를 가질 수 있도록 "사이즈"를 기준으로 나누어서 저장한다. (분산 쿼리가 용이 하도록)

슬라이스 개수는 node개수보다 작으면 안 된다. (분산처리의 의미가 없어 지므로...)

 

테이블의 데이터가 작고, 변경이 없는 테이블 (코드성)이면서 조인에 많이 사용 된다면, 해당 테이블의 데이터는 slice 하지 않고, 모든 노드에서 가지고 있을 수 있도록 생성하는 것이 좋다. (CREATE TABLE ...REPLICAS=ALLNODES) 

 

하나의 슬라이스는 하나의 node에만 저장되며, 하나의 슬라이스가 커지게 되면(기본 8G), 해당 슬라이스를 리발란서가 다시 split 하게 된다. (rebalancer_split_threshold_kb = 8G 기본 값)

 

테이블 별로 슬라이스 max 크기를 지정해 줄 수도 있다.( split_threshold_kb)

    ALTER TABLE tbl_name   [SLICES = n]  [ , INDEX index_name  [SLICES = n] [split_threshold_kb = n]]

 

Name Description
hash_dist_min_slices Controls how data is sliced. If set to 0, (the default),
Xpand will create new representations with the number of slices equal to the number of nodes currently in the cluster.
At least one slice of the table or index is placed on each node. If set to a specific integer, that number of slices will be created for each new table and index instead.
rebalancer_split_threshold_kb Default size at which the rebalancer splits slices.
task_rebalancer_reprotect_interval_ms Defines how frequently the Rebalancer will assess if additional slices are needed. Specify 0 to disable slice splitting.

 

 

-- 초기 설치 진행 후

[root@xpand3 clustrix]# clx status
Cluster Name:    cl36c9aa23ff872a40
Cluster Version: 5.3.14
Cluster Status:   OK
Cluster Size:    3 nodes - 8 CPUs per Node
Current Node:    xpand3 - nid 2

nid | Hostname | Status |   IP Address  | TPS |      Used      | Total
----+----------+--------+---------------+-----+----------------+-------
  1 |   xpand1 |    OK  |  10.70.101.51 |   0 |  20.8M (0.06%) |  31.9G
  2 |   xpand3 |    OK  |  10.70.101.53 |   0 |  19.9M (0.06%) |  31.9G
  3 |   xpand2 |    OK  |  10.70.101.52 |   0 |  20.2M (0.06%) |  31.9G
----+----------+--------+---------------+-----+----------------+-------
                                            0 |  60.9M (0.06%) |  95.6G

[root@xpand3 clustrix]# clx space
nid | Hostname | Status |       Undo      |      Perm      |    Temp    |      Used      | DB Total | FS Free
----+----------+--------+-----------------+----------------+------------+----------------+----------+--------
  1 |   xpand1 |    OK  |  256.0K (0.00%) |  24.7M (0.08%) |  0 (0.00%) |  25.2M (0.08%) |    31.9G |    5.5G
  2 |   xpand3 |    OK  |  256.0K (0.00%) |  24.0M (0.07%) |  0 (0.00%) |  24.3M (0.07%) |    31.9G |    5.5G
  3 |   xpand2 |    OK  |  256.0K (0.00%) |  24.4M (0.07%) |  0 (0.00%) |  24.8M (0.08%) |    31.9G |    5.5G
----+----------+--------+-----------------+----------------+------------+----------------+----------+--------
                           768.0K (0.00%) |  73.1M (0.07%) |  0 (0.00%) |  74.3M (0.08%) |    95.6G |   16.5G

데이터를 넣지 않은 초기 상태임에도 DB Total Size가 각 노드 마다 31.9G를 차지 함.
(테이블 스페이스 처럼 미리 생성된 공간이라 보면 됨)



-- tpcc 데이터 생성 후

MySQL [(none)]> use system
Database changed

MySQL [system]> select * from TABLE_SIZES where database = 'tpcc' ;  
-- 여기서 나오는 size (bytes) 슬라이스 Replica 합이다.


+----------+------------+-----------+

| Database | Table      | Bytes     |
+----------+------------+-----------+
| tpcc     | customer   | 461733888 |
| tpcc     | new_order  |   8060928 |
| tpcc     | order_line | 522682368 |
| tpcc     | item       |  22216704 |
| tpcc     | orders     |  85557248 |
| tpcc     | district   |    393216 |
| tpcc     | history    |  58785792 |
| tpcc     | stock      | 686718976 |
| tpcc     | warehouse  |    393216 |
+----------+------------+-----------+
9 rows in set (0.04 sec)

MySQL [system]> select * from TABLE_slices where database = 'tpcc'  order by 'table' , 'index'  ;
+----------+------------+---------------------------+---------------------+
| Database | Table      | Index                     | slice               |
+----------+------------+---------------------------+---------------------+
| tpcc     | customer   | __idx_customer__PRIMARY   | 7067205827858997249 |
| tpcc     | customer   | __idx_customer__PRIMARY   | 7067205827858998273 |
| tpcc     | customer   | __idx_customer__PRIMARY   | 7067205827858999297 |
| tpcc     | customer   | c_w_id                    | 7067205827863643137 |
| tpcc     | customer   | c_w_id                    | 7067205827863644161 |
| tpcc     | customer   | c_w_id                    | 7067205827863645185 |
| tpcc     | district   | __idx_district__PRIMARY   | 7067205827979982849 |
| tpcc     | district   | __idx_district__PRIMARY   | 7067205827979983873 |
| tpcc     | district   | __idx_district__PRIMARY   | 7067205827979984897 |
| tpcc     | history    | __base_history            | 7067205828073042945 |
| tpcc     | history    | __base_history            | 7067205828073043969 |
| tpcc     | history    | __base_history            | 7067205828073044993 |
| tpcc     | item       | __idx_item__PRIMARY       | 7067205828170768385 |
| tpcc     | item       | __idx_item__PRIMARY       | 7067205828170769409 |
| tpcc     | item       | __idx_item__PRIMARY       | 7067205828170770433 |
| tpcc     | new_order  | __idx_new_order__PRIMARY  | 7067205828259182593 |
| tpcc     | new_order  | __idx_new_order__PRIMARY  | 7067205828259183617 |
| tpcc     | new_order  | __idx_new_order__PRIMARY  | 7067205828259184641 |
| tpcc     | orders     | __idx_orders__PRIMARY     | 7067205828366210049 |
| tpcc     | orders     | __idx_orders__PRIMARY     | 7067205828366211073 |
| tpcc     | orders     | __idx_orders__PRIMARY     | 7067205828366212097 |
| tpcc     | orders     | o_w_id                    | 7067205828366220289 |
| tpcc     | orders     | o_w_id                    | 7067205828366221313 |
| tpcc     | orders     | o_w_id                    | 7067205828366222337 |
| tpcc     | order_line | __idx_order_line__PRIMARY | 7067205828477888513 |
| tpcc     | order_line | __idx_order_line__PRIMARY | 7067205828477889537 |
| tpcc     | order_line | __idx_order_line__PRIMARY | 7067205828477890561 |
| tpcc     | stock      | __idx_stock__PRIMARY      | 7067205828584907777 |
| tpcc     | stock      | __idx_stock__PRIMARY      | 7067205828584908801 |
| tpcc     | stock      | __idx_stock__PRIMARY      | 7067205828584909825 |
| tpcc     | warehouse  | __idx_warehouse__PRIMARY  | 7067205828670395393 |
| tpcc     | warehouse  | __idx_warehouse__PRIMARY  | 7067205828670396417 |
| tpcc     | warehouse  | __idx_warehouse__PRIMARY  | 7067205828670397441 |
+----------+------------+---------------------------+---------------------+
33 rows in set (0.01 sec)

MySQL [system]> select * from table_replicas where slice in ( select slice from table_slices where database = 'tpcc') order by 'table', nodeid , rank ;
+----------+------------+---------------------------+---------------------+---------------------+--------+------+--------+-----------+
| Database | Table      | Index                     | slice               | replica             | nodeid | rank | status | bytes     |
+----------+------------+---------------------------+---------------------+---------------------+--------+------+--------+-----------+
| tpcc     | customer   | __idx_customer__PRIMARY   | 7067205827858999297 | 7067205827858991105 |      1 |    0 |      1 |  56492032 |
| tpcc     | district   | __idx_district__PRIMARY   | 7067205827979983873 | 7067205827979978753 |      1 |    0 |      1 |     65536 |
| tpcc     | customer   | c_w_id                    | 7067205827863644161 | 7067205827863639041 |      1 |    0 |      1 |   5865472 |
| tpcc     | history    | __base_history            | 7067205828073042945 | 7067205828073040897 |      1 |    0 |      1 |  10321920 |
| tpcc     | orders     | __idx_orders__PRIMARY     | 7067205828366211073 | 7067205828366205953 |      1 |    0 |      1 |   3964928 |
| tpcc     | new_order  | __idx_new_order__PRIMARY  | 7067205828259184641 | 7067205828259176449 |      1 |    0 |      1 |   1179648 |
| tpcc     | item       | __idx_item__PRIMARY       | 7067205828170769409 | 7067205828170764289 |      1 |    0 |      1 |   3702784 |
| tpcc     | order_line | __idx_order_line__PRIMARY | 7067205828477890561 | 7067205828477882369 |      1 |    0 |      1 |  77496320 |
| tpcc     | orders     | o_w_id                    | 7067205828366221313 | 7067205828366216193 |      1 |    0 |      1 |   5734400 |
| tpcc     | stock      | __idx_stock__PRIMARY      | 7067205828584907777 | 7067205828584905729 |      1 |    0 |      1 | 163250176 |
| tpcc     | warehouse  | __idx_warehouse__PRIMARY  | 7067205828670396417 | 7067205828670391297 |      1 |    0 |      1 |     65536 |
| tpcc     | district   | __idx_district__PRIMARY   | 7067205827979982849 | 7067205827979981825 |      1 |    1 |      1 |     65536 |
| tpcc     | customer   | __idx_customer__PRIMARY   | 7067205827858998273 | 7067205827858994177 |      1 |    1 |      1 |  35749888 |
| tpcc     | customer   | c_w_id                    | 7067205827863643137 | 7067205827863642113 |      1 |    1 |      1 |  14909440 |
| tpcc     | history    | __base_history            | 7067205828073044993 | 7067205828073037825 |      1 |    1 |      1 |  10649600 |
| tpcc     | new_order  | __idx_new_order__PRIMARY  | 7067205828259183617 | 7067205828259179521 |      1 |    1 |      1 |    851968 |
| tpcc     | orders     | __idx_orders__PRIMARY     | 7067205828366210049 | 7067205828366209025 |      1 |    1 |      1 |   9764864 |
| tpcc     | item       | __idx_item__PRIMARY       | 7067205828170768385 | 7067205828170767361 |      1 |    1 |      1 |   3702784 |
| tpcc     | stock      | __idx_stock__PRIMARY      | 7067205828584909825 | 7067205828584902657 |      1 |    1 |      1 | 114196480 |
| tpcc     | order_line | __idx_order_line__PRIMARY | 7067205828477889537 | 7067205828477885441 |      1 |    1 |      1 |  48005120 |
| tpcc     | orders     | o_w_id                    | 7067205828366220289 | 7067205828366219265 |      1 |    1 |      1 |  11829248 |
| tpcc     | warehouse  | __idx_warehouse__PRIMARY  | 7067205828670395393 | 7067205828670394369 |      1 |    1 |      1 |     65536 |
| tpcc     | customer   | __idx_customer__PRIMARY   | 7067205827858997249 | 7067205827858995201 |      2 |    0 |      1 | 105906176 |
| tpcc     | customer   | c_w_id                    | 7067205827863643137 | 7067205827863641089 |      2 |    0 |      1 |  14909440 |
| tpcc     | history    | __base_history            | 7067205828073044993 | 7067205828073036801 |      2 |    0 |      1 |   9338880 |
| tpcc     | district   | __idx_district__PRIMARY   | 7067205827979984897 | 7067205827979976705 |      2 |    0 |      1 |     65536 |
| tpcc     | orders     | __idx_orders__PRIMARY     | 7067205828366212097 | 7067205828366203905 |      2 |    0 |      1 |   5898240 |
| tpcc     | new_order  | __idx_new_order__PRIMARY  | 7067205828259182593 | 7067205828259180545 |      2 |    0 |      1 |   1998848 |
| tpcc     | item       | __idx_item__PRIMARY       | 7067205828170768385 | 7067205828170766337 |      2 |    0 |      1 |   3702784 |
| tpcc     | stock      | __idx_stock__PRIMARY      | 7067205828584909825 | 7067205828584901633 |      2 |    0 |      1 |  97976320 |
| tpcc     | orders     | o_w_id                    | 7067205828366222337 | 7067205828366214145 |      2 |    0 |      1 |   5439488 |
| tpcc     | order_line | __idx_order_line__PRIMARY | 7067205828477888513 | 7067205828477886465 |      2 |    0 |      1 | 135823360 |
| tpcc     | warehouse  | __idx_warehouse__PRIMARY  | 7067205828670397441 | 7067205828670389249 |      2 |    0 |      1 |     65536 |
| tpcc     | district   | __idx_district__PRIMARY   | 7067205827979983873 | 7067205827979979777 |      2 |    1 |      1 |     65536 |
| tpcc     | customer   | __idx_customer__PRIMARY   | 7067205827858999297 | 7067205827858992129 |      2 |    1 |      1 |  56492032 |
| tpcc     | customer   | c_w_id                    | 7067205827863645185 | 7067205827863638017 |      2 |    1 |      1 |   8650752 |
| tpcc     | history    | __base_history            | 7067205828073043969 | 7067205828073039873 |      2 |    1 |      1 |   9371648 |
| tpcc     | item       | __idx_item__PRIMARY       | 7067205828170770433 | 7067205828170763265 |      2 |    1 |      1 |   3702784 |
| tpcc     | new_order  | __idx_new_order__PRIMARY  | 7067205828259184641 | 7067205828259177473 |      2 |    1 |      1 |   1179648 |
| tpcc     | orders     | __idx_orders__PRIMARY     | 7067205828366211073 | 7067205828366206977 |      2 |    1 |      1 |   3964928 |
| tpcc     | stock      | __idx_stock__PRIMARY      | 7067205828584908801 | 7067205828584904705 |      2 |    1 |      1 |  74022912 |
| tpcc     | order_line | __idx_order_line__PRIMARY | 7067205828477890561 | 7067205828477883393 |      2 |    1 |      1 |  77496320 |
| tpcc     | orders     | o_w_id                    | 7067205828366221313 | 7067205828366217217 |      2 |    1 |      1 |   5734400 |
| tpcc     | warehouse  | __idx_warehouse__PRIMARY  | 7067205828670396417 | 7067205828670392321 |      2 |    1 |      1 |     65536 |
| tpcc     | customer   | __idx_customer__PRIMARY   | 7067205827858998273 | 7067205827858993153 |      3 |    0 |      1 |  35749888 |
| tpcc     | customer   | c_w_id                    | 7067205827863645185 | 7067205827863636993 |      3 |    0 |      1 |   8650752 |
| tpcc     | district   | __idx_district__PRIMARY   | 7067205827979982849 | 7067205827979980801 |      3 |    0 |      1 |     65536 |
| tpcc     | history    | __base_history            | 7067205828073043969 | 7067205828073038849 |      3 |    0 |      1 |   9568256 |
| tpcc     | item       | __idx_item__PRIMARY       | 7067205828170770433 | 7067205828170762241 |      3 |    0 |      1 |   3702784 |
| tpcc     | orders     | __idx_orders__PRIMARY     | 7067205828366210049 | 7067205828366208001 |      3 |    0 |      1 |   9764864 |
| tpcc     | new_order  | __idx_new_order__PRIMARY  | 7067205828259183617 | 7067205828259178497 |      3 |    0 |      1 |    851968 |
| tpcc     | stock      | __idx_stock__PRIMARY      | 7067205828584908801 | 7067205828584903681 |      3 |    0 |      1 |  74022912 |
| tpcc     | orders     | o_w_id                    | 7067205828366220289 | 7067205828366218241 |      3 |    0 |      1 |  12124160 |
| tpcc     | warehouse  | __idx_warehouse__PRIMARY  | 7067205828670395393 | 7067205828670393345 |      3 |    0 |      1 |     65536 |
| tpcc     | order_line | __idx_order_line__PRIMARY | 7067205828477889537 | 7067205828477884417 |      3 |    0 |      1 |  48005120 |
| tpcc     | customer   | __idx_customer__PRIMARY   | 7067205827858997249 | 7067205827858996225 |      3 |    1 |      1 | 112492544 |
| tpcc     | customer   | c_w_id                    | 7067205827863644161 | 7067205827863640065 |      3 |    1 |      1 |   5865472 |
| tpcc     | district   | __idx_district__PRIMARY   | 7067205827979984897 | 7067205827979977729 |      3 |    1 |      1 |     65536 |
| tpcc     | history    | __base_history            | 7067205828073042945 | 7067205828073041921 |      3 |    1 |      1 |   9535488 |
| tpcc     | new_order  | __idx_new_order__PRIMARY  | 7067205828259182593 | 7067205828259181569 |      3 |    1 |      1 |   1998848 |
| tpcc     | orders     | __idx_orders__PRIMARY     | 7067205828366212097 | 7067205828366204929 |      3 |    1 |      1 |   5898240 |
| tpcc     | item       | __idx_item__PRIMARY       | 7067205828170769409 | 7067205828170765313 |      3 |    1 |      1 |   3702784 |
| tpcc     | orders     | o_w_id                    | 7067205828366222337 | 7067205828366215169 |      3 |    1 |      1 |   5439488 |
| tpcc     | order_line | __idx_order_line__PRIMARY | 7067205828477888513 | 7067205828477887489 |      3 |    1 |      1 | 135856128 |
| tpcc     | stock      | __idx_stock__PRIMARY      | 7067205828584907777 | 7067205828584906753 |      3 |    1 |      1 | 163250176 |
| tpcc     | warehouse  | __idx_warehouse__PRIMARY  | 7067205828670397441 | 7067205828670390273 |      3 |    1 |      1 |     65536 |
+----------+------------+---------------------------+---------------------+---------------------+--------+------+--------+-----------+
66 rows in set (0.03 sec)


[root@xpand3 ~]# clx status
Cluster Name:    cl36c9aa23ff872a40
Cluster Version: 5.3.14
Cluster Status:   OK
Cluster Size:    3 nodes - 8 CPUs per Node
Current Node:    xpand3 - nid 2

nid | Hostname | Status |   IP Address  | TPS |       Used      | Total
----+----------+--------+---------------+-----+-----------------+-------
  1 |   xpand1 |    OK  |  10.70.101.51 |   0 |  651.9M (2.00%) |  31.9G
  2 |   xpand3 |    OK  |  10.70.101.53 |   0 |  571.5M (1.75%) |  31.9G
  3 |   xpand2 |    OK  |  10.70.101.52 |   0 |  571.6M (1.75%) |  31.9G
----+----------+--------+---------------+-----+-----------------+-------
                                            0 |    1.8G (1.83%) |  95.6G

[root@xpand3 ~]# clx space

nid | Hostname | Status |       Undo      |       Perm      |    Temp    |       Used      | DB Total | FS Free
----+----------+--------+-----------------+-----------------+------------+-----------------+----------+--------
  1 |   xpand1 |    OK  |  256.0K (0.00%) |  651.2M (2.00%) |  0 (0.00%) |  652.0M (2.00%) |    31.9G |    5.3G
  2 |   xpand3 |    OK  |  256.0K (0.00%) |  571.0M (1.75%) |  0 (0.00%) |  571.8M (1.75%) |    31.9G |    5.5G
  3 |   xpand2 |    OK  |  256.0K (0.00%) |  571.2M (1.75%) |  0 (0.00%) |  571.9M (1.75%) |    31.9G |    5.5G
----+----------+--------+-----------------+-----------------+------------+-----------------+----------+--------
                           768.0K (0.00%) |    1.8G (1.83%) |  0 (0.00%) |    1.8G (1.83%) |    95.6G |   16.3G

 

Replicas

 

고 가용성을 위하여 하나의 슬라이스는 1개 이상의 물리적 replicas를 가지게 된다. (즉 기본 2개)

동일한 노드에 동인한 슬라이스의 Replica가 존재 하지 않는다.

Write 발생 시에는 동일 슬라이스의 Replicas(2개)에 동시에 Write가 발생 되지만, Read시에는 우선 순위가 있는 하나의 슬라이스를 읽게 된다.

 

max_failures 글로벌 변수의 값이 기본적으로 생성되는 replica의 개수 이다.

 

show variables like 'max_failures' ;
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| max_failures  | 1     |
+---------------+-------+

 

테이블 생성 시 REPLICAS 옵션으로 따로 지정 가능 (CREATE TABLE ... REPLICAS=n / ALTER TABLE .... REPLICAS=n)

 

작은 테이블이면서 변경 사항이 거의 없고, 조인에 자주 사용되는 테이블이라면 REPLICAS = ALLNODES 옵션을 주고 모든 노드에 데이터가 있을 수 있게 해 주자.

 

작은 테이블 :

    10M 보다 작은 테이블, Write가 1K 미만으로 발생, 다른 테이블과 조인하는데 많이 사용

 

Rebalancer

 

노드간 슬라이스의 최적 분포 유지

큰 슬라이스를 작은 슬라이스들로 분할 (rebalancer_split_threshold_kb, split_threshold_kb)

노드 추가 또는 제거 시 슬라이스 이동 담당

노드 사용률이 과도할 때 슬라이스 이동 (워크로드 핫스팟 제거)

노드장애가 발생해도 Xpand 내에서 복제 본 자동 생성 및 유지

가용 영역(AZ) 인식 데이터 분산 복제로 특정 AZ 전체 장애에도 서비스 유지 가능

 

파라미터 :

rebalancer_split_threshold_kb  : Default size at which the rebalancer splits slices
rebalancer_global_task_limit   : specifies the number of concurrent rebalancer actions, applicable to all rebalancer actions.
task_rebalancer_%_interval_ms  : defines the interval time of when a particular rebalancer task is initiated.
rebalancer_rebalance_task_limit: controls the number of concurrent rebalancing tasks.
rebalancer_vdev_task_limit     : limits the number of concurrent rebalancer actions that touch a single device.

 

현재 Rebalancer가 동작 중일 경우, rebalancer_activity_targets , rebalancer_copy_activity 테이블에서 조회 가능

지난 Rebalancer 동작은 rebalancer_activity_log 테이블에서 조회 가능

 

MySQL [(none)]> use system
Database changed

MySQL [system]> select * from rebalancer_activity_targets ;
Empty set (0.01 sec)

MySQL [system]> select * from rebalancer_copy_activity ;
Empty set (0.00 sec)

MySQL [system]> select * from rebalancer_activity_log order by started desc limit 10 ;
+---------------------+--------+----------------+----------------+-----------------+------------------------------+---------+-----------------------+-----------------------+-------+
| id                  | op     | reason         | database       | relation        | representation               | bytes   | started               | finished              | error |
+---------------------+--------+----------------+----------------+-----------------+------------------------------+---------+-----------------------+-----------------------+-------+
| 7068132967950466052 | rerank | read imbalance | clustrix_statd | statd_history   | timestamp                    | 1605632 | 2022-02-24 04:45:48.4 | 2022-02-24 04:45:48.4 | NULL  |
| 7068132967690024964 | rerank | read imbalance | clustrix_statd | hotness_history | timestamp                    | 1212416 | 2022-02-24 04:45:48.3 | 2022-02-24 04:45:48.3 | NULL  |
| 7068129102182178819 | rerank | read imbalance | clustrix_statd | hotness_history | timestamp                    | 1179648 | 2022-02-24 04:30:48.3 | 2022-02-24 04:30:48.3 | NULL  |
| 7068112351699359747 | rerank | read imbalance | clustrix_statd | qpc_current     | rank                         |   32768 | 2022-02-24 03:25:48.3 | 2022-02-24 03:25:48.3 | NULL  |
| 7068111063191710723 | rerank | read imbalance | clustrix_statd | statd_current   | __idx_statd_current__PRIMARY |   98304 | 2022-02-24 03:20:48.3 | 2022-02-24 03:20:48.3 | NULL  |
| 7068111063423661059 | rerank | read imbalance | clustrix_statd | qpc_history     | is_rollup                    |   98304 | 2022-02-24 03:20:48.3 | 2022-02-24 03:20:48.4 | NULL  |
| 7068107197687549955 | rerank | read imbalance | clustrix_statd | qpc_history     | timestamp                    |  163840 | 2022-02-24 03:05:48.3 | 2022-02-24 03:05:48.3 | NULL  |
| 7068098178212108292 | rerank | read imbalance | clustrix_statd | hotness_history | timestamp                    | 1081344 | 2022-02-24 02:30:48.2 | 2022-02-24 02:30:48.3 | NULL  |
| 7068098178208885763 | rerank | read imbalance | clustrix_statd | statd_history   | timestamp                    |  655360 | 2022-02-24 02:30:48.2 | 2022-02-24 02:30:48.3 | NULL  |
| 7068096889714079747 | rerank | read imbalance | clustrix_statd | hotness_history | timestamp                    | 1081344 | 2022-02-24 02:25:48.2 | 2022-02-24 02:25:48.3 | NULL  |
+---------------------+--------+----------------+----------------+-----------------+------------------------------+---------+-----------------------+-----------------------+-------+
10 rows in set (0.03 sec)

MySQL [system]> select * from rebalancer_activity_log where database = 'tpcc' order by started desc limit 10 ;
+---------------------+--------+-----------------------------+----------+------------+---------------------------+-----------+-----------------------+-----------------------+-------+
| id                  | op     | reason                      | database | relation   | representation            | bytes     | started               | finished              | error |
+---------------------+--------+-----------------------------+----------+------------+---------------------------+-----------+-----------------------+-----------------------+-------+
| 7068073270641507332 | rerank | read imbalance              | tpcc     | district   | __idx_district__PRIMARY   |     65536 | 2022-02-24 00:54:09.0 | 2022-02-24 00:54:09.0 | NULL  |
| 7068072842083033089 | rerank | read imbalance              | tpcc     | stock      | __idx_stock__PRIMARY      |  97976320 | 2022-02-24 00:52:29.2 | 2022-02-24 00:52:29.3 | NULL  |
| 7068072562021957634 | move   | distribution load imbalance | tpcc     | district   | __idx_district__PRIMARY   |     98304 | 2022-02-24 00:51:24.0 | 2022-02-24 00:51:29.2 | NULL  |
| 7068072410880482307 | rerank | read imbalance              | tpcc     | order_line | __idx_order_line__PRIMARY |  63275008 | 2022-02-24 00:50:48.8 | 2022-02-24 00:50:48.9 | NULL  |
| 7068071981426684932 | rerank | read imbalance              | tpcc     | stock      | __idx_stock__PRIMARY      | 163250176 | 2022-02-24 00:49:08.8 | 2022-02-24 00:49:08.9 | NULL  |
| 7068071917789839362 | move   | distribution load imbalance | tpcc     | warehouse  | __idx_warehouse__PRIMARY  |     98304 | 2022-02-24 00:48:54.0 | 2022-02-24 00:48:59.2 | NULL  |
| 7068071553761810435 | rerank | distribution read imbalance | tpcc     | history    | __base_history            |   6422528 | 2022-02-24 00:47:29.3 | 2022-02-24 00:47:29.3 | NULL  |
| 7068071553523448835 | rerank | read imbalance              | tpcc     | stock      | __idx_stock__PRIMARY      | 163282944 | 2022-02-24 00:47:29.2 | 2022-02-24 00:47:29.2 | NULL  |
| 7068071122410363908 | rerank | read imbalance              | tpcc     | stock      | __idx_stock__PRIMARY      | 163250176 | 2022-02-24 00:45:48.8 | 2022-02-24 00:45:48.9 | NULL  |
| 7068070692896357379 | rerank | read imbalance              | tpcc     | stock      | __idx_stock__PRIMARY      | 163282944 | 2022-02-24 00:44:08.8 | 2022-02-24 00:44:08.9 | NULL  |
+---------------------+--------+-----------------------------+----------+------------+---------------------------+-----------+-----------------------+-----------------------+-------+

 

System Database

 

일반 mysql과 다르게 초기 설치 후에 DB에 접속 후 확인해 보면 information_schema 와 test 데이터 베이스 밖에 보이지 않는다.

 

기본적인 데이터 베이스는 system 데이터베이스 이며, hidden이 true로 되어 있다.

 

MySQL [(none)]> use system
Database changed

MySQL [system]> select * from databases ;

+---------------------+---------------------+--------------------+--------+------+
| db                  | user                | name               | hidden | cscl |
+---------------------+---------------------+--------------------+--------+------+
|                4097 |                4099 | system             |      1 |  518 |
|                4098 |                4099 | _replication       |      1 |  518 |
|                4104 |                4099 | information_schema |      0 |  518 |
|                4105 |                4099 | temporary_tables   |      1 |  518 |
|                4111 |                4099 | _cursors           |      1 |  518 |
| 7067052845912992769 |                4099 | test               |      0 |  518 |
| 7067052937791471617 | 7067052852943940609 | clustrix_statd     |      1 |  518 |
| 7067052948688550913 | 7067052852943940609 | clustrix_dbi       |      1 |  518 |
+---------------------+---------------------+--------------------+--------+------+

MySQL [system]> select * from users ;
+---------------------+------------------+--------------+-------------------------------------------+----------+-----------+-----------------------+
| user                | username         | host         | password                                  | priority | profiling | plugin                |
+---------------------+------------------+--------------+-------------------------------------------+----------+-----------+-----------------------+
|                4099 | root             | 127.0.0.1    | *E6CC90B878B948C35E92B003C792C46C58C4AF40 |        0 |         0 | mysql_native_password |
|                4100 | mysql_slave      |              |                                           |        0 |         0 | mysql_native_password |
|                4110 | clx_maint        | 127.0.0.1    | *845EE408D4B27C5C5A9751D7786FDA7E89B2C02E |        0 |         0 | mysql_native_password |
|                4112 | clx_view_definer | 127.0.0.1    |                                           |        0 |         0 | mysql_native_password |
| 7067052852943940609 | xpand            | localhost    |                                           |        0 |         0 | mysql_native_password |
| 7067052853915312129 | xpandm           | localhost    |                                           |        0 |         0 | mysql_native_password |
| 7067137009741132801 | mxs              | 10.70.101.55 | *E6CC90B878B948C35E92B003C792C46C58C4AF40 |        0 |         0 | mysql_native_password |
| 7067205341296116737 | app              | %            | *E6CC90B878B948C35E92B003C792C46C58C4AF40 |        0 |         0 | mysql_native_password |
+---------------------+------------------+--------------+-------------------------------------------+----------+-----------+-----------------------+

 

system 데이터 베이스가 유용한 정보를 모두 담고 있으므로, 사용하는 모든 쿼리는 system 데이터베이스에서 조회 하면 된다.

반응형

+ Recent posts