メモ
■Cluster状態確認
show status like ‘wsrep_%’;
show status like ‘wsrep_%’;
■現在の接続数
show global status like ‘Threads_connected’;
show global status like ‘Threads_connected’;
■最大接続数設定(上限)
show global variables like ‘max_connections’;
show global variables like ‘max_connections’;
■起動してからの累積接続数
show global status like ‘Connections’;
show global status like ‘Connections’;
■接続プロセスのタイムアウトの確認
show global variables like ‘wait_timeout%’;
show global variables like ‘wait_timeout%’;
■Too many connectionsが発生する
show processlist; ←を超えたとき
show processlist; ←を超えたとき
■オンラインで接続数を変更する
SET GLOBAL max_connections=250;
SET GLOBAL max_connections=250;
■データベースの容量 全体
select round(sum(data_length)/1024/1024) as ‘data_volume(MB)’ from information_schema.tables;
select round(sum(data_length)/1024/1024) as ‘data_volume(MB)’ from information_schema.tables;
■データベースの容量 個別DB
select round(sum(data_length)/1024/1024) as ‘data_volume(MB)’ from information_schema.tables where table_schema = ‘DM_Name’;
select round(sum(data_length)/1024/1024) as ‘data_volume(MB)’ from information_schema.tables where table_schema = ‘DM_Name’;