Kettle集群搭建与配置

1、环境准备

1.1、环境信息

1.1.1、操作系统

版本:

名称环境Ip
kettle(主)Windows172.16.16.119
kettle(从)Centos 7(64 位)172.16.16.127
kettle(从)Centos 7(64 位)172.16.16.128

1.2、软件信息

1.2.1、版本信息

版本:

名称版本
jdk-8u411-windows-x64.exe1.8.4
pdi-ce-9.2.0.0-290.zip9.2.0
jdk-8u411-linux-x64.tar.gz1.8.4
webkitgtk-2.4.9-1.el7.x86_64.rpm2.4.9
mysql-connector-java-8.0.25.jar8.0.25

1.3、软件获取

1.3.1、获取途径

百度网盘连接:链接:https://pan.baidu.com/s/1LqEhGNFTK4ptOl4ebd1f8w 
提取码:uhbj 

2、环境搭建

2.1、主机搭建

2.1.1、主机信息

2.1.2、Windows安装jdk

安装请参考:windows-jdk安装与配置_jdk-8u411-windows-x64.exe-CSDN博客

2.1.3、Windows安装kettle

安装请参考:windows-kettle安装与配置_pdi-ce-9.2.0.0-290-CSDN博客

按照2.1.2与2.1.3步骤安装完成,自此主机搭建成功。

2.2、从机搭建

2.2.1、从机信息

2.2.2、linux安装jdk

安装请参考:linux-java1.8安装与配置_linux 安装java1.8-CSDN博客

2.2.3、linux安装kettle

安装请参考:linux-kettle环境搭建与配置-CSDN博客

从机172.16.16.127按照2.2.2与2.2.3步骤安装完成,自此从机172.16.16.127搭建成功。

从机172.16.16.128按照2.2.2与2.2.3步骤安装完成,自此从机172.16.16.128搭建成功。

3、集群配置

3.1、主机配置

3.1.1、主机信息

3.1.2、配置内容

进入pwd目录,配置carte-config-master-8080.xml。

##172.16.16.119

<slave_config>
  <!-- 
     Document description...
     
     - masters: You can list the slave servers to which this slave has to report back to.
                If this is a master, we will contact the other masters to get a list of all the slaves in the cluster.

     - report_to_masters : send a message to the defined masters to let them know we exist (Y/N)

     - slaveserver : specify the slave server details of this carte instance.
                     IMPORTANT : the username and password specified here are used by the master instances to connect to this slave.

  --> 

  <slaveserver>
    <name>80</name>
    <hostname>172.16.16.119</hostname>
    <port>8081</port>
    <master>Y</master>
  </slaveserver>


</slave_config>

3.2、从机配置

3.2.1、从机信息

3.2.2、配置内容

##172.16.16.127

<slave_config>
  <!--
     Document description...

     - masters: You can list the slave servers to which this slave has to report back to.
                If this is a master, we will contact the other masters to get a list of all the slaves in the cluster.

     - report_to_masters : send a message to the defined masters to let them know we exist (Y/N)

     - slaveserver : specify the slave server details of this carte instance.
                     IMPORTANT : the username and password specified here are used by the master instances to connect to this slave.

  -->

  <masters>

    <slaveserver>
      <name>80</name>
      <hostname>172.16.16.119</hostname>
      <port>8081</port>
      <username>cluster</username>
      <password>cluster</password>
      <master>Y</master>
    </slaveserver>

  </masters>

  <report_to_masters>Y</report_to_masters>

  <slaveserver>
    <name>81</name>
    <hostname>172.16.16.127</hostname>
    <port>8082</port>
    <username>cluster01</username>
    <password>cluster01</password>
    <master>N</master>
  </slaveserver>


</slave_config>
##172.16.16.128

<slave_config>
  <!--
     Document description...

     - masters: You can list the slave servers to which this slave has to report back to.
                If this is a master, we will contact the other masters to get a list of all the slaves in the cluster.

     - report_to_masters : send a message to the defined masters to let them know we exist (Y/N)

     - slaveserver : specify the slave server details of this carte instance.
                     IMPORTANT : the username and password specified here are used by the master instances to connect to this slave.

  -->

  <masters>

    <slaveserver>
      <name>80</name>
      <hostname>172.16.16.119</hostname>
      <port>8081</port>
      <username>cluster</username>
      <password>cluster</password>
      <master>Y</master>
    </slaveserver>

  </masters>

  <report_to_masters>Y</report_to_masters>

  <slaveserver>
    <name>82</name>
    <hostname>172.16.16.128</hostname>
    <port>8083</port>
    <username>cluster03</username>
    <password>cluster03</password>
    <master>N</master>
  </slaveserver>


</slave_config>

3.3、启动配置

3.3.1、主机信息

3.3.2、主机启动

进入data-integration目录,打开cmd,执行如下命令启动主机,显示如下则配置成功。

Carte.bat ./pwd/carte-config-master-8080.xml

3.3.3、从机信息

3.3.4、从机配置

分别开放两台从机的端口,命令如下:

#172.16.16.127
firewall-cmd --zone=public --add-port=8082/tcp --permanent
firewall-cmd --zone=public --add-port=40000/tcp --permanent
firewall-cmd --reload

#172.16.16.128
firewall-cmd --zone=public --add-port=8083/tcp --permanent
firewall-cmd --zone=public --add-port=40000/tcp --permanent
firewall-cmd --reload

#查看
firewall-cmd --list-ports

分别进入data-integration目录,执行如下命令启动从机,显示如下则配置成功。

#172.16.16.127
./carte.sh pwd/carte-config-8081.xml

#172.16.16.128
./carte.sh pwd/carte-config-8082.xml

4、案例测试

4.1、服务信息

4.1.1、填写服务信息

主机执行spoon.bat,创建一个转换,在主对象树中创建子服务器,分别填写主机与两台从机的相关信息。

4.1.2、配置schemas

配置schemas,选中Kettle集群schemas,右击新建,填写相关内容如下。

4.1.3、集群运行配置

创建集群运行配置,点击run configuration新建,填写name,engine,选择location即可。

4.2、案例

4.2.1、创建案例

在核心对象中,在输入选项中选择文本文件输入,在输出选项中选择文本文件输出,方向选择从输入->输出,在输出中点击右击选择集群。

4.3、运行测试

4.3.1、01运行

点击运行,选择集群方式。

结果如下,则证明集群搭建测试并成功

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值