1.使用kettle 连接mysql导出数据到hive

添加 mysql connection

database connection右键-->new

添加 hive connection

database connection右键-->new

kettle etl mysql to hive/to hdfs

 

 创建 table input和table output

table input关联mysql connection

table putput关联hive connection

建立input到output的箭头(选中后shift箭拖动)

kettle etl mysql to hive/to hdfs

 

 填入表名称(可以是不存在的,会自动新建),点击SQL

kettle etl mysql to hive/to hdfs

 

 点击执行

kettle etl mysql to hive/to hdfs

 

 

hue中查看hive 中表kettle-test中有数据了,导入成功。

 

2.使用kettle 连接mysql导出数据到hdfs

添加 mysql connection

kettle etl mysql to hive/to hdfs

 

 需要先拷贝mysql的jdbc连接驱动到kettle的目录:

C:\data-integration\plugins\pentaho-big-data-plugin\hadoop-configurations\cdh61\lib\pmr
C:\data-integration\lib

 

添加hadoop cluster 连接

kettle etl mysql to hive/to hdfs

 

 hadoop cluster右键-->add driver

kettle etl mysql to hive/to hdfs

 

 点击browser,选择合适的版本,我的CDH是6.3.2,这儿选择cdh61也可以

 kettle etl mysql to hive/to hdfs

 

 hadoop cluster右键-->new cluster

先将CDH的配置文件下载拷贝到kettle目录 

登录cloudera management-->HDFS-->Action -->Download Client Configuration

kettle etl mysql to hive/to hdfs

 

 解压配置文件拷贝hdfs-site.xml和core-site.xml到C:\data-integration\plugins\pentaho-big-data-plugin\hadoop-configurations\cdh61中去

hadoop cluster右键-->new cluster

kettle etl mysql to hive/to hdfs

 

 IP填真实地址,密码可以不填,端口不要变,是固定的。

kettle etl mysql to hive/to hdfs

 

 点击next

kettle etl mysql to hive/to hdfs

 

 view result

 得到下面结果即可,其他报错不影响使用

kettle etl mysql to hive/to hdfs

 

 创建下面流程的组件

kettle etl mysql to hive/to hdfs

 

 table input -->edit

kettle etl mysql to hive/to hdfs

 

 hadoop output-->edit

kettle etl mysql to hive/to hdfs

 

 kettle etl mysql to hive/to hdfs

 

 kettle etl mysql to hive/to hdfs

 

 点击table input按住shift按键拖动到hadoop output,形成箭头

点击run即可看见成功信息

kettle etl mysql to hive/to hdfs

 

 查看HDFS生成文件:

kettle etl mysql to hive/to hdfs

 

相关文章:

  • 2021-08-15
  • 2021-06-17
  • 2021-10-15
  • 2021-11-02
  • 2022-12-23
  • 2021-07-14
  • 2022-12-23
  • 2021-09-10
猜你喜欢
  • 2022-01-16
  • 2021-04-17
  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
  • 2021-04-23
  • 2021-04-12
相关资源
相似解决方案