1. 在kettle中设置hive相关配置
首先在Hive的安装目录里(/usr/hdp/2.6.4.0-91/hive2/jdbc)找到Hive的jdbc的jar文件,
复制这个jar文件到Kettle的lib目录下(D:\data-integration\lib),
重启Kettle。
修改plugin.properties文件(D:\data-integration\plugins\pentaho-big-data-plugin)
active.hadoop.configuration=hdp25
2. 在kettle中添加hive的DB连接
3. 在kettle中添加数据库及表(使用xshell)
xshell连接信息:192.168.10.151 root 123456
任务 | 执行 |
进入hive | hive |
创建数据库 | create database test; |
使用数据库 | use test; |
创建表 | create table a(a int,b int) row format delimited fields terminated by ','; |
从文件写入 | load data local inpath '/home/hive/hive_test.txt' into table a; |
查询数据 | select * from a; |
ps:修改本地host文件,使用域名访问
C:\Windows\System32\drivers\etc hosts
192.168.10.151 hdp1.bdsoft.com hdp1
192.168.10.152 hdp2.bdsoft.com hdp2
192.168.10.153 hdp3.bdsoft.com hdp3