Simplified version of commonly used commands for GBase 8a database cluster operation and maintenance inspection

The GBase 8a database cluster provides a variety of commands for operation and maintenance monitoring to check whether the current cluster running status is abnormal. It also provides a simple import and export program. This article summarizes the commands most frequently used by field operation and maintenance personnel.

Simplified version of commonly used commands for GBase 8a cluster operation and maintenance 
======================================= === 
Latest version http://www.gbase8.cn/657 
Official forum http://www.gbase8a.com 
Private website http://www.gbase8.cn 
============ =============================== 
1. Check if the cluster is normal 
1.1 Check cluster status 
gcadmin 
1.2 Check cluster data inconsistency 
gcadmin showdmlevent 
gcadmin showddlevent 
gcadmin showdmlstorageevent 
2. Cluster command line, used to execute SQL commands 
su- 
gbase interactive mode gccli -uUsername -pPassword -hIP 
simple execution gccli -uUsername -pPassword -hIP -e "show processlist" 
batch file gccli -uUsername -pPassword -hIP <allSQL.txt 
3. View the SQL 
3.1 designated nodes running in the cluster 
Simple show processlist 
complete show full processlist 
detailed show detail processlist
3.2 所有节点
select COORDINATOR_NAME, ID, user, host, command, start_time, time, state, substring(info,0,100) info from information_schema.COORDINATORS_TASK_INFORMATION where command='query' and time >=0 order by time desc;
4、导出数据
rmt:select * from ac08 where btime between '2020-01-01' and '2020-02-01' into outfile '/opt/ac08.txt' fields terminated by ',' ENCLOSED BY '"' null_value '\N'
5、加载数据
load data infile 'ftp://gbase:[email protected]//opt/ac08.txt' into table ac08 NULL_VALUE '\N' fields terminated by ',' ENCLOSED BY '"' DATETIME FORMAT ‘%Y-%m-%d %H:%i:%s’
6. Check the current loading progress
带毫秒的日期
load data infile 'ftp://gbase:[email protected]//opt/ac08.txt' into table ac08 NULL_VALUE '\N' fields terminated by ',' ENCLOSED BY '"' DATETIME FORMAT ‘%Y-%m-%d %H:%i:%s.%f’
select db_name,tb_name,IP,state,start_time,progress,total_size,loaded_size,loaded_records,skipped_records from information_schema.load_status order by db_name,tb_name;
7、查看历史加载结果
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>'2020-07-26' order by start_time;
8、查看表、存储过程、函数
show tables;
show tables like '%XXX%' ;
show function status;
show procedure status;
show create table mytablename;
9. View the structure of tables, functions, and stored procedures
show create procedure myProc; 
show create function myFunc; 10.View 
variables 
show variables like'%XXXX%'; 
view status 
show status like'%meminfo%'; 
12. View the space occupied by a table
select * from information_schema.cluster_tables a where table_schema='testdb' and table_name='t1'; 
view the space of each 
shard select * from information_schema.CLUSTER_TABLE_SEGMENTS a where table_schema='testdb' and table_name='t1'; 
13, each 
Types of log locations 
Service process name Default log location gcware corosync 
service start and stop log, only 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 Detailed log, detailed start and 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 
installation directory/gcluster/log/gcluster/system.log start and stop log 
installation directory/gcluster/log/gcluster/express.log engine log 
installation directory/gcluster/log/gcluster/gclusterd.log general log, record executable SQL command 
installation directory/ gcluster/log/gcluster/gclusterd-audit.log Audit log, record all command execution results 
gnode gbased installation directory /gnode/log/gbase/ system.log start and stop log 
installation directory /gnode/log/gbase/ express.log engine log 
syncserver gc_sync_server 
installation directory 
/gnode/log/gbase/ syncserver.log service log installation directory/gnode/log/gbase/ syncclient_XXXX.log client log 
gcrecover 
installation directory/gclusger/log/gcluster/ gc_recover.log scheduling log 
installation directory/gclusger /log/gcluster/gcrecover_taskrecord.log Synchronization record 
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 monitoring

Guess you like

Origin blog.csdn.net/java2000_net/article/details/108641542