日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

基于【CentOS-7+ Ambari 2.7.0 + HDP 3.0】HAWQ数据仓库 使用之 gpfdist协议

發布時間:2025/7/14 编程问答 20 豆豆
生活随笔 收集整理的這篇文章主要介紹了 基于【CentOS-7+ Ambari 2.7.0 + HDP 3.0】HAWQ数据仓库 使用之 gpfdist协议 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一、HAWQ基本安裝自帶gpfdist協議

gpfdist是HAWQ支持的外部表訪問協議之一,這是hawq自帶的一個簡單的集成http服務命令。

在我的前述安裝hawq之后,gpfdist命令位于hawq的bin目錄之中。/opt/gpadmin/apache-hawq/bin/gpfdist

gpfdist使用說明很簡單,且看:

[root@ep-bd01 ~]# /opt/gpadmin/apache-hawq/bin/gpfdist --help gpfdist -- file distribution web serverusage: gpfdist [--ssl <certificates_directory>] [-d <directory>] [-p <http(s)_port>] [-l <log_file>] [-t <timeout>] [-v | -V] [-m <maxlen>][-c file]gpfdist [-? | --help] | --version-?, --help : print this screen-v : verbose mode-V : more verbose-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--ssl dir : start HTTPS server. Use the certificates from the specified directory-c file : configuration file for transformations--version : print version information

這里我只關心-d和-p兩個命令行參數

二、gpfdist服務簡單使用

1,啟動gpfdist服務

gpfdist不像pxf協議那么麻煩,由于他只是服務于本機目錄,所以只要在數據目錄所在的主機上啟動gpfdist,hawq即可訪問了。

[root@ep-bd01 ~]# /opt/gpadmin/apache-hawq/bin/gpfdist -p8809 -d/var/data/ext Serving HTTP on port 8809, directory /var/data/ext

2,準備數據文件

1)建立本地路徑/var/data/ext/yxbw

2)路徑放置從hdfs文件系統中復制過來的用sqoop從其他數據庫系統的數據表導入的數據文件,并且導入時啟用了--compress參數,所以數據文件是gz壓縮格式,這個gpfdist協議可以直接訪問。

[root@ep-bd01 pxf]# hdfs dfs -copyToLocal /var/data/ext/table1/* /var/data/ext/table1/. [root@ep-bd01 pxf]# ll /var/data/ext/table1/ 總用量 152 -rw-r--r--. 1 root root 69503 9月 10 09:45 part-m-00000.gz -rw-r--r--. 1 root root 41334 9月 10 09:45 part-m-00001.gz -rw-r--r--. 1 root root 24035 9月 10 09:45 part-m-00002.gz -rw-r--r--. 1 root root 14345 9月 10 09:45 part-m-00003.gz -rw-r--r--. 1 root root 0 9月 10 09:45 _SUCCESS

?

3,建立hawq外部表

注意,gpfdist路徑中的table1路徑是相對于gpfdist服務啟動時通過參數"-d"指定的數據路徑的。

create external table ext.table1 (occur_time date, ......) location ('gpfdist://ep-bd01:8081/table1') format 'text'(delimiter ',' null '');

4,訪問外部表

epbd=> select count(*) from ext.table1;count -------6288 (1 row)Time: 258.015 ms

?

總結

以上是生活随笔為你收集整理的基于【CentOS-7+ Ambari 2.7.0 + HDP 3.0】HAWQ数据仓库 使用之 gpfdist协议的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。