南大通用GBase 8a加载常见错误原因

原文链接:www.gbase.cn/community/p...

更多精彩内容尽在南大通用GBase技术社区,南大通用致力于成为用户最信赖的数据库产品供应商。

常见加载错误及原因

报Login denied uri

用例:

lua 复制代码
gbase> load data infile 'ftp://gbase:gbase123@172.16.128.11//home/gbase/*.tbl'  into table test.tmp_lxj_1212_test data_format 3;
ERROR 1733 (HY000): (GBA-01EX-700) Gbase general error: Expanding wildcard operation failed with error - Login denied uri : ftp://gbase:********@172.16.128.11//home/gbase/%2a.tbl.

错误原因:gbase用户密码错误

报Couldn't connect to server

用例:

vbnet 复制代码
gbase> load data infile 'ftp://gbase:gbase@172.16.128.11//home/gbase/1.txt'  into table test.tmp_lxj_1212_test data_format 3;
ERROR 1733 (HY000): (GBA-01EX-700) Gbase general error: I/O operation on ftp://gbase:*****@172.16.128.11//home/gbase/1.txt failed with error - Couldn't connect to server, File name ftp://gbase:*****@172.16.128.11//home/gbase/1.txt

报错原因:ip地址错误或者vsftpd服务没有启动

报failed to get table distribution information.

用例:

lua 复制代码
gbase> load data infile 'ftp://gbase:gbase@172.16.128.11//home/gbase/1.txt'  into table test.tmp_lxj_0621_test data_format 3;
ERROR 1733 (HY000): (GBA-01EX-700) Gbase general error: failed to get table distribution information.

报错原因:所涉及加载表不存在

报550 Could not get file size.

用例:

sql 复制代码
gbase> load data infile 'ftp://gbase:gbase@172.16.128.11//home/gbase/4.txt'  into table test.tmp_lxj_1212_test data_format 3;
ERROR 1733 (HY000): (GBA-01EX-700) Gbase general error: I/O operation on ftp://gbase:*****@172.16.128.11//home/gbase/4.txt failed with error - 550 Could not get file size., File name ftp://gbase:*****@172.16.128.11//home/gbase/4.txt

错误原因:/home/gbase/4.txt 这个文件不存在

报Remote file not found uri

用例:

lua 复制代码
gbase> load data infile 'ftp://gbase:gbase@172.16.128.11//home/gbase/*.tbl'  into table test.tmp_lxj_1212_test data_format 3;
ERROR 1733 (HY000): (GBA-01EX-700) Gbase general error: Expanding wildcard operation failed with error - Remote file not found uri : ftp://gbase:*****@172.16.128.11//home/gbase/%2a.tbl.

错误原因:/home/gbase/*.tbl 没有匹配到文件,通配符文件不存在

报Access denied to remote resource

用例:

vbnet 复制代码
gbase> load data infile 'ftp://gbase:gbase@172.16.128.11/home/gbase/2.txt'  into table test.tmp_lxj_1212_test data_format 3 max_bad_records 0;
ERROR 1733 (HY000): (GBA-01EX-700) Gbase general error: I/O operation on ftp://gbase:*****@172.16.128.11/home/gbase/2.txt failed with error - Access denied to remote resource, File name ftp://gbase:*****@172.16.128.11/home/gbase/2.txt

错误原因:/home/gbase/2.txt路径错误

报Too many bad records

用例:

vbnet 复制代码
load data infile 'ftp://gbase:gbase@172.16.128.11//home/gbase/2.txt'  
into table test.tmp_lxj_1212_test data_format 3 max_bad_records 0;
ERROR 1733 (HY000): (GBA-01EX-700) Gbase general error: Task 262162 failed, [172.16.128.12:5050](GBA-02AD-0005)Failed to query in gnode:
DETAIL: (GBA-01-600) Gbase internal error: Task 262162, Too many bad records!

错误原因:错误数据行数超过max_bad_records指定值

报read operation timeout

用例:

less 复制代码
2016-12-15 14:52:47.253 [SQLDISP][ERROR][S:83876][Q:696407]:Query failed, THD(0x4b9f6000) HOST(10.17.6.52:5050->50885) reason: (GBA-01-600) Gbase internal error: I/O operation on ftp://doubass:*********@10.255.219.24//data3/asiainfo/interface/12300/data/s_12300_BAS_04002_20161214_011_00_016.dat failed with error - read operation timeout

错误原因:如果填充一个数据块(8M)的时间超过gbase_loader_read_timeout参数值,加载任务将报错停止

报Timeout was reached

用例:

less 复制代码
2016-12-15 15:49:52.221 [SQLDISP][ERROR][S:191527][Q:1487078]:
Query failed, THD(0x429ae000) HOST(10.17.6.95:5050->110938) reason: (GBA-01-600) 
Gbase internal error: Task 622072, I/O operation on 
ftp://doubass:*********@10.255.219.26//data6/asiainfo/interface/12900/data/a_12900_BAS_01002_20161214_00.verf failed with error - Timeout was reached

错误原因:ftp服务器端超时

报Unsupport local file for loader

用例:

lua 复制代码
gbase> load data infile '//home/gbase/1.txt'  into table test.tmp_lxj_1212_test data_format 3;
ERROR 1733 (HY000): (GBA-01EX-700) Gbase general error: Unsupport local file for loader

错误原因:不支持本地文件加载,即file_list参数部分必须填写ip地址和登录用户信息

报Line length is more than gbase_loader_max_line_lengt

用例:

vbnet 复制代码
gbase> load data infile 'ftp://gbase:gbase@172.16.128.11//home/gbase/024123_0'  into table test.tmp_lxj_1220_test data_format 3;
ERROR 1733 (HY000): (GBA-01EX-700) Gbase general error: Task 393223 failed, [172.16.128.12:5050](GBA-02AD-0005)Failed to query in gnode:
DETAIL: (GBA-01-600) Gbase internal error: Line length 8388608 is more than gbase_loader_max_line_length ( 4194304 ) in file 'ftp://gbase:*****@172.16.128.11//home/gbase/024123_0'
1024*1024

错误原因:行长度超过参数gbase_loader_max_line_length值。

报validate error

用例1:字符串加载到数字类型字段

1数据内容:

root@Node1 gbase# cat 1.txt

1

2

3

a

2表结构:create table tmp_lxj_1212_test(id int);

3加载sql:

sql 复制代码
gbase> load data infile 'ftp://gbase:gbase@172.16.128.11//home/gbase/1.txt'  into table test.tmp_lxj_1212_test data_format 3;
Query OK, 3 rows affected (Elapsed: 00:00:01.32)
Task 393224 finished, Loaded 3 records, Skipped 1 records

4存在一条skip数据,查看trc日志:

markdown 复制代码
[root@Node1 gbase]# cexecs "ls -lrt /opt/gnode/log/gbase/loader_logs/393224*"
************************ coor  ************************
--------- 172.16.128.11---------
-rw-rw---- 1 gbase gbase 146 12月 20 04:43 /opt/gnode/log/gbase/loader_logs/393224_test_tmp_lxj_1212_test_n1_172.16.128.11_20161220044343.trc
-rw-rw---- 1 gbase gbase   2 12月 20 04:43 /opt/gnode/log/gbase/loader_logs/393224_test_tmp_lxj_1212_test_n1_172.16.128.11_20161220044343.err
--------- 172.16.128.12---------
ls: 无法访问/opt/gnode/log/gbase/loader_logs/393224*: 没有那个文件或目录
[root@Node1 gbase]# cat 
/opt/gnode/log/gbase/loader_logs/393224_test_tmp_lxj_1212_test_n1_172.16.128.11_20161220044343.trc
file_name    |   file_offset    |   record_len   |   column    |    reason
ftp://gbase:*****@172.16.128.11//home/gbase/1.txt|6|2|1|validate error

用例2:yyyymmdd日期格式数据加载到date字段

1数据内容

root@Node1 gbase# cat date.txt

20161212

2表结构:create table tmp_lxj_1212_date_test(v_date date);

3加载sql:

vbnet 复制代码
gbase> load data infile 'ftp://gbase:gbase@172.16.128.11//home/gbase/date.txt'  into table test.tmp_lxj_1220_date_test data_format 3 max_bad_records 0;
ERROR 1733 (HY000): (GBA-01EX-700) Gbase general error: Task 393227 failed, [172.16.128.11:5050](GBA-02AD-0005)Failed to query in gnode:
DETAIL: (GBA-01-600) Gbase internal error: Task 393227, Too many bad records!

4 查看trc日志:

perl 复制代码
[root@Node2 ~]# cat /opt/gnode/log/gbase/loader_logs/393226_test_tmp_lxj_1220_date_test_n1_172.16.128.12_20161220225132.trc
file_name    |   file_offset    |   record_len   |   column    |    reason
ftp://gbase:*****@172.16.128.11//home/gbase/date.txt|0|9|1|validate error

报text parser error

用例:表列数与文件列数不一致,文件列数多于表列数

1数据内容:

root@Node1 gbase# cat 1212.txt

1,2

2表结构:create table tmp_lxj_1212_test(id int);

3加载sql:

sql 复制代码
gbase> load data infile 'ftp://gbase:gbase@172.16.128.11//home/gbase/1212.txt'  into table test.tmp_lxj_1212_test data_format 3 fields terminated by ',';
Query OK, 0 rows affected (Elapsed: 00:00:00.63)
Task 393231 finished, Loaded 0 records, Skipped 1 records

4存在一条skip数据,查看trc日志:

markdown 复制代码
[root@Node1 gbase]# cexec "ls -lrt /opt/gnode/log/gbase/loader_logs/393231*"
************************* coor *************************
--------- 172.16.128.11---------
ls: 无法访问/opt/gnode/log/gbase/loader_logs/393231*: 没有那个文件或目录
--------- 172.16.128.12---------
-rw-rw---- 1 gbase gbase 152 12月 20 23:40 /opt/gnode/log/gbase/loader_logs/393231_test_tmp_lxj_1212_test_n1_172.16.128.12_20161220234049.trc
-rw-rw---- 1 gbase gbase   4 12月 20 23:40 /opt/gnode/log/gbase/loader_logs/393231_test_tmp_lxj_1212_test_n1_172.16.128.12_20161220234049.err
[root@Node2 ~]# cat /opt/gnode/log/gbase/loader_logs/393231_test_tmp_lxj_1212_test_n1_172.16.128.12_20161220234049.trc
file_name    |   file_offset    |   record_len   |   column    |    reason
ftp://gbase:*****@172.16.128.11//home/gbase/1212.txt|0|4|2|text parser error

报data column size less than defined size

用例:表列数与文件列数不一致,文件列数少于表列数

1数据内容:

root@Node1 gbase# cat 1.txt

1

2表结构:create table tmp_lxj_1212_test1(id int,name varchar(10));

3加载sql:

sql 复制代码
gbase> load data infile 'ftp://gbase:gbase@172.16.128.11//home/gbase/1.txt'  into table test.tmp_lxj_1212_test1 data_format 3;
Query OK, 0 rows affected (Elapsed: 00:00:00.38)
Task 393233 finished, Loaded 0 records, Skipped 4 records

4存在4条skip数据

markdown 复制代码
[root@Node1 gbase]# cexecs "ls -lrt /opt/gnode/log/gbase/loader_logs/393233*"
************************ coor  ************************
--------- 172.16.128.11---------
ls: 无法访问/opt/gnode/log/gbase/loader_logs/393233*: 没有那个文件或目录
--------- 172.16.128.12---------
-rw-rw---- 1 gbase gbase 459 12月 20 23:47 /opt/gnode/log/gbase/loader_logs/393233_test_tmp_lxj_1212_test1_n1_172.16.128.12_20161220234703.trc
-rw-rw---- 1 gbase gbase   8 12月 20 23:47 /opt/gnode/log/gbase/loader_logs/393233_test_tmp_lxj_1212_test1_n1_172.16.128.12_20161220234703.err
[root@Node2 ~]# cat 
/opt/gnode/log/gbase/loader_logs/393233_test_tmp_lxj_1212_test1_n1_172.16.128.12_20161220234703.trc
file_name    |   file_offset    |   record_len   |   column    |    reason
ftp://gbase:*****@172.16.128.11//home/gbase/1.txt|0|2|1|data column size less than defined size

原文链接:www.gbase.cn/community/p...

更多精彩内容尽在南大通用GBase技术社区,南大通用致力于成为用户最信赖的数据库产品供应商。

相关推荐
这个DBA有点耶31 分钟前
分布式数据库到底该不该上?从判断标准到架构选型的实战思考
数据库·架构·dba
01_ice1 小时前
MySQL库和表的操作
数据库·mysql
布莱克6052 小时前
数据库索引分类:数据结构、物理存储与逻辑角度详解
数据结构·数据库
SelectDB2 小时前
DeepSeek Harness 接入 Litefuse:完善 Agent 可观测与评估能力
数据库
这个DBA有点耶3 小时前
从库延迟的“二次放大”效应:一次大事务,拖垮整个读写分离
数据库·mysql·架构
LearnYard3 小时前
自然语言驱动的数据图表生成:几款工具功能对比实践
数据库·百度·powerpoint
一个有温度的技术博主3 小时前
MySQL 三大日志协同机制:redo log、undo log 与 binlog 的联合运作
数据库·mysql·oracle
ltl4 小时前
ClickHouse 与 DuckDB 选型:不是同一类列存
数据库
ltl4 小时前
RocksDB WAL 与 WriteBatch:持久化与原子批写
数据库
ltl4 小时前
流批一体与增量视图:Materialize、RisingWave 与 DBSP
数据库