GBase 8 a database cluster, offers a variety of operational monitoring command, used to view the current cluster running state is abnormal, also provides a simple import and export, this article summarizes the operations staff at the scene of the most frequently used commands,
1, check to see if the cluster normal
1.1 check the cluster status
Gcadmin
1.2 check the cluster data inconsistencies, behind the number of optional, is to display the event number, the default 16
Gcadmin showdmlevent [number]
Gcadmin showddlevent [number]
Gcadmin showdmlstorageevent [number]
2, the cluster command line, used to execute SQL command
Su - gbase
Interactive mode gccli - uUsername - pPassword - hIP
Simple implementation gccli - uUsername - pPassword - hIP - e "show the processlist"
Batch file gccli - uUsername - pPassword - hIP & lt; AllSQL. TXT
3, check the cluster operation simple SQL 3.1 specified node show the processlist complete show full details the processlist show the detail the processlist 3.2 all scheduling node select COORDINATOR_NAME, ID, user, host, and command, start_time, time, the state, the substring (0100) the info, the info from information_schema. COORDINATORS_TASK_INFORMATION where the command="query" and time & gt;=0 order by time desc limit 10;
3.3 all data node
Select NODE_NAME, ID, user, host, and command, start_time, time, the state, the substring (0100) the info, the info from information_schema. GNODES_TASK_INFORMATION where the command='query' and the info is not null and info not like '% information_schema. The processlist %' order by time desc limit 10;
4, export data
RMT: select * from ac08 where btime between '2020-01-01' and '2020-02-01 s' into outfile'/opt/ac08. TXT 'fields terminated by', 'ENCLOSED by' "' null_value '\ N'
5, loading data
The load data infile "ftp://gbase:[email protected]//opt/ac08.txt" into table ac08 NULL_VALUE '\ N' fields terminated by ', 'ENCLOSED by' "' the DATETIME FORMAT '% % m - Y H: % d % % I:' % s'
With the date of the millisecond
The load data infile "ftp://gbase:[email protected]//opt/ac08.txt" into table ac08 NULL_VALUE '\ N' fields terminated by ', 'ENCLOSED by' "' the DATETIME FORMAT '% % m - Y H: % d % % I: % s. % f
'6, view the current loading schedule
The select db_name tb_name, IP, the state, start_time, progress, total_size, loaded_size, loaded_records, skipped_records from information_schema. Load_status order by db_name, tb_name;
7, view the history load results
The select task_id db_name, tb_name, user, HOST_IP, start_time, end_time, elapsed_time, total_size, loaded_records, skipped_records from information_schema. Load_result where start_time & gt; '2020-07-26' order by start_time;
8, see table, stored procedure, function
show tables;
Show tables like '% %' XXX;
The show function status.
Show procedure status;
9, see table, function, structure of the stored procedure
Show create table mytablename;
Show create procedure myProc;
Show the create function myFunc;
10, view the variable
Show variables like '% XXXX %';
Check the state of
Meminfo show status like '% %';
12, at the table takes up space
Select * from information_schema. Cluster_tables a where table_schema='testdb' and table_name='t1';
Check each shard of space
Select * from information_schema. CLUSTER_TABLE_SEGMENTS a where table_schema='testdb' and table_name='t1';
13, all kinds of log position
Default log position service process name
Gcware corosync
Service start-stop log, only to start and stop information
V8 version installation directory/gcluster/log/gcluster/corosync_system log
V9 version installation directory/gcluster/log/gcluster/gcware_system log
Service log in detail, detailed start stop information
V8 version/var/log/corosync. Log
V9 version installation directory/gcware/log/gcware log
Gcadmin command execution log
V8 version/var/log/gcware/gcware_XXXX log
V9 version installation directory/gcware liblog/gcware log
Gcluster gclusterd
The installation directory/gcluster/log/gcluster/system. The log start-stop log
The installation directory/gcluster/log/gcluster/express log engine log
The installation directory/gcluster/log/gcluster/gclusterd general log log, recording the executable SQL commands
The installation directory/gcluster/log/gcluster gclusterd - audit. The log audit log to record all command execution results
Gnode gbased installation directory/gnode/log/gbase system. The log start-stop log
The installation directory/gnode/log/gbase/express the log engine log
Syncserver gc_sync_server
The installation directory/gnode/log/gbase/syncserver log service log
The installation directory/gnode/log/gbase/syncclient_XXXX log client log
Gcrecover
The installation directory/gclusger/log/gcluster/gc_recover log operation log
The installation directory/gclusger/log/gcluster/gcrecover_taskrecord synchronous record log
The installation directory/gclusger/log/gcluster/gcrecover_system log start-stop log
Gcmonit installation directory/gclusger/log/gcluster/gcmonit log process monitoring
Gcmmonit installation directory/gclusger/log/gcluster/gcmmonit log process monitoring of monitoring
Text format
GBase 8 a cluster operations command simplified version of the latest version of the https://www.gbase8.cn/657
1, check to see if the cluster normal
1.1 check the cluster status
Gcadmin
1.2 check the cluster data inconsistencies, behind the number of optional, is to display the event number, the default 16
Gcadmin showdmlevent [number]
Gcadmin showddlevent [number]
Gcadmin showdmlstorageevent [number]
2, the cluster command line, used to execute SQL command
Su - gbase
Interactive mode gccli - uUsername - pPassword - hIP
Simple implementation gccli - uUsername - pPassword - hIP - e "show the processlist"
Batch file gccli - uUsername - pPassword - hIP & lt; AllSQL. TXT
3, check the cluster running SQL
3.1 a specified node
Simple show the processlist
Complete the show full the processlist
Detailed show the detail the processlist
3.2 all the scheduling node
Select COORDINATOR_NAME, ID, user, host, and command, start_time, time, the state, the substring (0100) the info, the info from information_schema. COORDINATORS_TASK_INFORMATION where the command="query" and time & gt;=0 order by time desc limit 10;
3.3 all data node
Select NODE_NAME, ID, user, host, and command, start_time, time, the state, the substring (0100) the info, the info from information_schema. GNODES_TASK_INFORMATION where the command="query" and the info is not null and info not like '% information_schema. The processlist %' order by time desc limit 10;
4, export data
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull