准备研究一下Pentaho的产品如何同Hadoop协同工作。从简单的开始,今天实验了一下Kettle连接Hadoop集群。

实验目的:
配置Kettle连接Hadoop集群的HDFS。

实验环境:
4台CentOS release 6.4虚拟机,IP地址为
192.168.56.101
192.168.56.102
192.168.56.103
192.168.56.104

192.168.56.101是Hadoop集群的主,运行NameNode进程。
192.168.56.102、192.168.56.103是Hadoop的从,运行DataNode进程。
192.168.56.104安装Pentaho的PDI,安装目录为/root/data-integration。

Hadoop版本:2.7.2
PDI版本:6.0

Hadoop集群的安装配置参考http://blog.csdn.net/wzy0623/article/details/50681554

配置步骤:
1. 启动Hadoop的hdfs
在192.168.56.101上执行以下命令
start-dfs.sh

2. 拷贝Hadoop的配置文件到PDI的相应目录下
在192.168.56.101上执行以下命令
scp /home/grid/hadoop/etc/hadoop/hdfs-site.xml [email protected]:/root/data-integration/plugins/pentaho-big-data-plugin/hadoop-configurations/cdh54/
scp /home/grid/hadoop/etc/hadoop/core-site.xml [email protected]:/root/data-integration/plugins/pentaho-big-data-plugin/hadoop-configurations/cdh54/

下面的配置均在192.168.56.104上执行
3. 在安装PDI的主机上建立访问Hadoop集群的用户
我的Hadoop集群的属主是grid,所以执行以下命令建立相同的用户
useradd -d /home/grid -m grid
usermod -G root grid

4. 修改PDI安装目录的属主为grid
mv /root/data-integration /home/grid/
chown -R grid:root /home/grid/data-integration

5. 编辑相关配置文件
cd /home/grid/data-integration/plugins/pentaho-big-data-plugin/hadoop-configurations/cdh54/
在config.properties文件中添加如下一行
authentication.superuser.provider=NO_AUTH
把hdfs-site.xml、core-site.xml文件中的主机名换成相应的IP 
修改后的config.properties、hdfs-site.xml、core-site.xml文件分别如图1、图2、图3所示。

Pentaho Work with Big Data(一)—— Kettle连接Hadoop集群

图1

Pentaho Work with Big Data(一)—— Kettle连接Hadoop集群

图2

Pentaho Work with Big Data(一)—— Kettle连接Hadoop集群

图3


6. 在Kettle中选择一个支持的Shim
选择菜单“工具”->“Hadoop Distribution...”,在弹窗中选择Cloudera CDH 5.4,如图4所示。

Pentaho Work with Big Data(一)—— Kettle连接Hadoop集群

图4


7. 重启Kettle

8. 新建一个转换,在“主对象树”中选择“Hadoop cluster”,点击右键选择“New Cluster”,填写相关信息,如图5所示

Pentaho Work with Big Data(一)—— Kettle连接Hadoop集群

图5


9. 点击“测试”,结果如图6所示,连接HDFS成功

Pentaho Work with Big Data(一)—— Kettle连接Hadoop集群

图6


参考:
http://help.pentaho.com/Documentation/6.0/0L0/040/025
http://help.pentaho.com/Documentation/6.0/0H0/070/030/010

相关文章:

  • 2021-07-09
  • 2022-12-23
  • 2021-04-22
  • 2021-10-06
  • 2021-07-25
  • 2021-12-24
  • 2021-11-24
  • 2021-06-16
猜你喜欢
  • 2021-04-26
  • 2021-06-23
  • 2022-12-23
  • 2021-08-28
相关资源
相似解决方案