南大通用GBase 8a 当event很多时,筛选过滤指定表或指定IP的event

GBase 8a 数据库集群通过gcadmin命令对集群状态进行维护,当集群出现event时,通过show命令查看。但如果event已经积压很多,或者只关心某个表的event,可以通过新版本集群的参数来实现筛选。

确认版本是否支持

执行gcadmin ,看是否在showdmlevent等后面提供了更多的参数。如下面8.6.2Build43版本是支持的。

[gbase@localhost ~]$ gcadmin --help

        Usage: gcadmin <command> [arg1[, arg2...]]

        1.  gcadmin distribution <gcChangeInfo.xml> <p num> [d num] [pattern 1|2] [db_root_pwd password]  : generate distribution, db_root_pwd shall input
                                                                                                            if changed and new distribution data nodes more
                                                                                                            than old distribution
        2.  gcadmin rmdistribution [ID]                                                                   : remove distribution
        3.  gcadmin addnodes gcChangeInfo.xml                                                             : add nodes to cluster
        4.  gcadmin rmnodes gcChangeInfo.xml                                                              : remove nodes from cluster
        5.  gcadmin showdistribution [node | f]                                                           : show cluster distribution, or segments on nodes when
                                                                                                            use parameter [node]
        6.  gcadmin switchmode <mode>                                                                     : switch cluster mode, mode take value in
                                                                                                            [ normal | readonly | recovery ]
        7.  gcadmin showlock [f]                                                                          : show current cluster lock information,
                                                                                                            include lock name, lock owner ip address, etc
        8.  gcadmin showddlevent [<tablename segname nodeip> | <tablename nodeip> | <max_fevent_num>] [f] : show cluster ddl fail event,
                                                                                                            replicated table segname is [n0]
        9.  gcadmin showdmlevent [<tablename segname nodeip> | <max_fevent_num>] [f]                      : show current cluster dml fail event,                                                                                                                                        replicated table segname is [n0]
        10. gcadmin showdmlstorageevent [table ID segname nodeip] | <max_fevent_num>] [f]                 : show current cluster dml storage fail event,
                                                                                                            replicated table segname is [n0]
        11. gcadmin showcluster [c | d | f]                                                               : show current cluster information, include all nodes,
                                                                                                            cluster state and cluster node information
        12. gcadmin getdistribution <ID> <distribution_info.xml>                                          : get distribution information
        13. gcadmin setnodestate ip <state>                                                               : set one node state,state take value in: failure unavailable normal
        14. gcadmin showfailover [f]                                                                      : show failover information
        15. gcadmin showfailoverdetail <commitId> [xml_file_name]                                         : write failover information to file xml_file_name
        16. gcadmin --help                                                                                : show help info
        17. gcadmin -V,--version                                                                          : show version info

命令样例

命令提供了几种写法和参数,中间用竖线分割的。比如

DMLEVENT
[gbase@localhost ~]$ gcadmin showdmlevent testdb.t1 n1 10.0.2.107
Event count:0

DDLEVENT
[gbase@localhost ~]$ gcadmin showddlevent testdb.t1 10.0.2.107
Event count:0

testdb.t1 库名.表名
n1 分片,对应segname
10.0.2.107 对应nodeip