安装包链接
https://soyuan-qhjd.oss-cn-beijing.aliyuncs.com/kettle.tar.gz
Phoenix表初始化
https://gitee.com/szszy/bigdata/blob/master/tangwx/HBase/QHJD.sql
kettle安装部署
- 解压后的目录结构
- 打开 kettle.properties 修改sqlite_db_path(即QHJD.db的绝对路径)和phoenix_url(修改hdp03)
Basepath=/Users/twx/Documents/QHJD-Kettle
server_url=http://172.26.1.123:3000/api/services/app/Qhjd/Download
sqlite_host=localhost
sqlite_db_path=/home/admin/QHJD.db
phoenix_url=jdbc:phoenix:hdp03
regions=3
保存后将kettle.properties拷贝到用户目录下的 ~/.kettle/kettle.properties (需要创建.kettle目录)
- 使用vim 打开 data-integration/lib/webservice-test-1.0-SNAPSHOT.jar
光标移动到config.properties,回车,然后修改wsdl地址
退出:q :q
- 连接sqlite3
sqlite3 db文件路径
[admin@kettle kettle]$ sqlite3 QHJD.db
SQLite version 3.7.17 2013-05-20 00:56:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .tables
CONSTANT QHJD TB_XDRY_JBXX
sqlite> select * from CONSTANT;
1|yunnan| | |2019101064853123|123456|172.26.1.123|李四|1111111111111111|xx省|10.1.1.3|application/x-www-form-urlencoded|11111
table|CONSTANT|CONSTANT|9|CREATE TABLE "CONSTANT" (
"c_id" integer NOT NULL,
"id" text,
"mingxsjc" TEXT,
"maxgxsjc" TEXT,
"timeStamp" text,
"password" TEXT,
"ip" TEXT,
"operate_xm" TEXT,
"operate_sfzh" TEXT,
"operate_dwmc" TEXT,
"operate_ip" TEXT,
"Content-Type" TEXT,
"rid" TEXT,
PRIMARY KEY ("c_id")
)
更新请求信息:UPDATE CONSTANT SET id="yunnan1",password="12345",ip="10.10.1.1",operate_xm="",operate_ip="10.10.1.1"
根据现场用户提供的用户名、密码、ip等修改。
退出 .quit
- 数据接入文件在data-integration/QHJD目录下
运行命令,cd data-integration:
./kitchen.sh -file QHJD/TB_XDRY_JBXX.kjb -level Debug
此条命令指定接入吸毒人员基本信息表,如果此命令运行后最后结果是true,那么运行总的7张表的数据脚本
./kitchen.sh -file QHJD/QHJD.kjb