Linux下实现kettle 自动同步数据
1.安装jdk tar -zxvf jdk-7u25-linux-x64.tar.gz -C /usr/share
2.配置java环境 vim /etc/profile 在末尾添加如下
export JAVA_HOME=/usr/share/jdk1.7.0_25 export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
3.验证Java环境
3.1重新登录
3.2
[root@localhost jdk1.7.0_25]# java -version
java version "1.7.0_25" Java(TM) SE Runtime Environment (build 1.7.0_25-b15) Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
4. Linux下部署kettle root执行: tar -zxvf pdi-ce-4.2.1-stable.zip -C /home/mysql
chown -R mysql:mysql /home/mysql/data-integration cd /home/mysql/data-integration chmod +x *.sh
验证kettle,出现帮助信息为正确: /home/mysql/data-integration/kitchen.sh
5.建立作业及转换
mkdir /home/kettle/
chown -R mysql:mysql /home/kettle/
5.2 将Windows下建好的作业(a2ins.kjb)和转换(tableget0411.ktr)拷贝到/home/kettle/下
5.3 vim a2ins.kjb 将转换路径修改为Linux下路径
原: <filename>f:elt_all ableget0411.ktr</filename>
改: <filename>/home/kettle/tableget0411.ktr</filename>
5.4 新建start.sh
vim start.sh /home/mysql/data-integration/kitchen.sh -file=/home/kettle/a2ins.kjb -level=Detailed -logfile = /home/kettle/log.log
6.制定计划任务定时执行
crontab -e */1 * * * * sh /home/kettle/start.sh >>/home/kettle/test.log