1、环境预备
1.1、环境信息
1.1.1、使用系统
版本:
名称环境Ipkettle(主)Windows172.16.16.119kettle(从)Centos 7(64 位)172.16.16.127kettle(从)Centos 7(64 位)172.16.16.128 1.2、软件信息
1.2.1、版本信息
版本:
名称版本jdk-8u411-windows-x64.exe1.8.4pdi-ce-9.2.0.0-290.zip9.2.0jdk-8u411-linux-x64.tar.gz1.8.4webkitgtk-2.4.9-1.el7.x86_64.rpm2.4.9mysql-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运行
点击运行,选择集群方式。
结果如下,则证明集群搭建测试并乐成
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |