GBase 8a加载错误数据收集参数gbase_loader_logs_collect

GBase 8a通过load加载时,是由数据节点做最终的实质操作,如果出现错误数据,日志也是记录在数据节点。当节点数量很多时,不方便排查。通过gbase_loader_logs_collect参数,可以将错误数据自动收集到连接节点的gcluster大的log目录下。

参数

gbase_loader_logs_collect

默认值

1

使用样例

默认打开的效果

[gbase@rh6-1 ~]$ gccli testdb

GBase client 8.6.2.43-R30.124361. Copyright (c) 2004-2020, GBase.  All Rights Reserved.

gbase> set global gbase_loader_logs_collect=1;
Query OK, 0 rows affected (Elapsed: 00:00:00.02)

gbase> show variables like '%collect%';
+---------------------------+-------+
| Variable_name             | Value |
+---------------------------+-------+
| gbase_loader_logs_collect | ON    |
+---------------------------+-------+
1 row in set (Elapsed: 00:00:00.00)

gbase> load data infile 'sftp://gbase:gbase1234@10.0.2.201/home/gbase/1.txt' into table t1;
Query OK, 0 rows affected (Elapsed: 00:00:00.67)
Task 2686986 finished, Loaded 0 records, Skipped 11 records

gbase> ^CAborted
[gbase@rh6-1 ~]$ ll /opt/gcluster/log/gcluster/loader_logs/2686986/
total 12
-rw------- 1 gbase gbase 209 Dec 28 15:24 2686986_loader_result.log
-rw------- 1 gbase gbase 108 Dec 28 15:24 2686986_testdb_t1_n1_::ffff:10.0.2.202_20201228152453.err
-rw------- 1 gbase gbase 886 Dec 28 15:24 2686986_testdb_t1_n1_::ffff:10.0.2.202_20201228152453.trc
[gbase@rh6-1 ~]$

参数关掉后的效果

[gbase@rh6-1 ~]$ gccli testdb

GBase client 8.6.2.43-R30.124361. Copyright (c) 2004-2020, GBase.  All Rights Reserved.

gbase> show variables like '%collect%';
+---------------------------+-------+
| Variable_name             | Value |
+---------------------------+-------+
| gbase_loader_logs_collect | ON    |
+---------------------------+-------+
1 row in set (Elapsed: 00:00:00.00)

gbase> set gbase_loader_logs_collect=0;
ERROR 1229 (HY000): Variable 'gbase_loader_logs_collect' is a GLOBAL variable and should be set with SET GLOBAL
gbase> set global gbase_loader_logs_collect=0;
Query OK, 0 rows affected (Elapsed: 00:00:00.01)

gbase>
gbase>
gbase>
gbase>
gbase> use testdb;
Query OK, 0 rows affected (Elapsed: 00:00:00.00)

gbase> desc t1;
+-------+---------+------+-----+---------+-------+
| Field | Type    | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| id    | int(11) | YES  |     | NULL    |       |
+-------+---------+------+-----+---------+-------+
1 row in set (Elapsed: 00:00:00.00)

gbase> load data infile 'sftp://gbase:gbase1234@10.0.2.201/home/gbase/1.txt' into table t1;
Query OK, 0 rows affected (Elapsed: 00:00:00.70)
Task 2686984 finished, Loaded 0 records, Skipped 11 records

gbase> ^CAborted
[gbase@rh6-1 ~]$ ll /opt/gnode/log/gbase/loader_logs/
total 8
-rw------- 1 gbase gbase 108 Dec 28 14:58 2686984_testdb_t1_n1_::ffff:10.0.2.201_20201228145807.err
-rw------- 1 gbase gbase 886 Dec 28 14:58 2686984_testdb_t1_n1_::ffff:10.0.2.201_20201228145807.trc
[gbase@rh6-1 ~]$ gncli

发表评论

您的电子邮箱地址不会被公开。