目录
一、安装包准备
环境 : GP 4.3
下载速度比较慢,可在以下地址下载。
https://mp.csdn.net/console/upDetailed
二、安装过程
2.1 直接按照正常软件安装一样的方法,安装完成后如下图。
进入bin目录,一会启动服务的时候就是用gpfdist可执行文件来启动gpfdist。
需要依赖python 环境,版本要求如图。
gploader应该就是python写的脚本。
三、启动gpfdist服务
这里主要有两个参数 -p 指定启动端口,默认是8080,
-d 指要通过gpfdist程序写入数据库的文件,格式不限于csv,txt...etc,其他的参数如下,有兴趣自行学习。
gpfdist -- file distribution web server
usage: gpfdist [--ssl ] [--sslclean ] [-d ] [-p ] [-l ] [-t ] [-v | -V | -s] [-m ] [-w ][-c file]
gpfdist [-? | --help] | --version
-?, --help : print this screen
-v : verbose mode
-V : more verbose
-s : simplified minimum log
-p port : port to serve HTTP(S), default is 8080
-d dir : serve files under the specified directory, default is '.'
-l logfn : log filename
-t tm : timeout in seconds
-m maxlen : max data row length expected, in bytes. default is 32768
-S : open the file for synchronous I/O with the O_SYNC flag
--ssl dir : start HTTPS server. Use the certificates from the specified directory
--sslclean time : define the time to wait until cleanup the SSL resources, default is 0
-c file : configuration file for transformations
--version : print version information
-w timeout : timeout in seconds before close target file
针对window平台,按照如下方式即可启动
1、C:\Program Files (x86)\Greenplum\greenplum-loaders-4.3.27.0\bin>
cd \Program Files (x86)\Greenplum\greenplum-loaders-4.3.27.0\bin
2、
C:\Program Files (x86)\Greenplum\greenplum-loaders-4.3.27.0\bin>gpfdist.exe -p 8080 -d E:\aplog\data
启动成功后会显示如下:
四、常见问题
1、加载数据时这种报错是gpfdist启动有问题。
qmstst=# select * from extlocaltest;
ERROR: connection with gpfdist failed for gpfdist://10.**.**.**:8080/localtest.txt. effective url: http://10.**.**.**:8080/localtest.txt. error code = 111 (Connection refused) (seg2 slice1 P1TST01:40002 pid=21667)
qmstst=#