问题现象
GBase 8a MPP Cluster 导出到 Hadoop 无响应。
原因分析
webhdfs 导出没有超时控制, HDFS 无响应时导出长时间卡住。
解决方法
增加导出超时参数 gbase_export_write_timeout 解决 HDFS 导出卡住问题。
使用 gcdump 指定参数 ignore-table 不导出指定的
表或视图
问题现象
use testdb;
create table t2(id int,name varchar(20),type int);
create view v2 as select * from t2;
create table t1(id int,name varchar(20),type int);
create view v1 as select * from t1;
alter table t1 drop column type;
alter table t2 drop column type;
create table t3(id int,name varchar(20),type int);
gcdump 导出报错
# /opt/gcluster/server/bin/gcdump -B testdb
DROP DATABASE IF EXISTS `testdb`;
CREATE DATABASE IF NOT EXISTS `testdb` DEFAULT CHARACTER
SET utf8;
USE `testdb`;
...
use testdb;
DROP TABLE IF EXISTS `t3`;
CREATE TABLE `t3` (
`id` int(11) DEFAULT NULL,
`name` varchar(20) DEFAULT NULL, GBase 8a MPP Cluster FAQ FAQ
文档版本(2021-04-02) 南大通用数据技术股份有限公司
98
`type` int(11) DEFAULT NULL
) ENGINE=EXPRESS DEFAULT CHARSET=utf8 TABLESPACE='sys_tables
pace';
2017-11-23 14:51:04.086 gcdump: Couldn't execute 'show create table `v1`':
View 'testdb.v1' references invalid table(s) or column(s) or function(s) or def
iner/invoker of view lack rights to use them (1356)
解决方法
如果需要忽略报错,不导出有问题的视图,可以加 --ignore-table 参数。
$$GCLUSTER_BASE/server/bin/gcdump -B testdb --ignore-table=testdb.v
1 --ignore-table=testdb.v2
DROP DATABASE IF EXISTS `testdb`;
CREATE DATABASE IF NOT EXISTS `testdb` DEFAULT CHARACTER
SET utf8;
...
use testdb;
DROP TABLE IF EXISTS `t3`;
CREATE TABLE `t3` (
`id` int(11) DEFAULT NULL,
`name` varchar(20) DEFAULT NULL,
`type` int(11) DEFAULT NULL
) ENGINE=EXPRESS DEFAULT CHARSET=utf8 TABLESPACE='sys_tables
pace';
前提是需要事先知道哪些表或视图不需要导出,并且一个 --ignore-table 参数后面只
能设置一个表。