源码:
远程执行Trans:
public static void main(String[] args){
String filename="E:\\Work\\JOB\\tag更新\\temp_tag2customer.ktr";
try{
KettleEnvironment.init();
SlaveServer slaveServer = new SlaveServer("222i159","10.22.125.159"
,"8081","cluster","cluster");
TransMeta transMeta = new TransMeta(filename);
TransExecutionConfiguration transExecutionConfiguration = new TransExecutionConfiguration();
transExecutionConfiguration.setRemoteServer(slaveServer);
String s = Trans.sendToSlaveServer(transMeta,transExecutionConfiguration,null,null);
System.out.println(s);
}catch (Exception e){
e.printStackTrace();
}
}
远程执行Job:
public static void main(String[] args){
String filename="E:\\Work\\JOB\\tag更新\\temp_tag2customer.kjb";
try{
KettleEnvironment.init();
SlaveServer slaveServer = new SlaveServer("womai159","10.6.105.159"
,"8081","cluster","cluster");
JobMeta transMeta = new JobMeta(filename,null);
JobExecutionConfiguration jobExecutionConfiguration = new JobExecutionConfiguration();
jobExecutionConfiguration.setRemoteServer(slaveServer);
String s = Job.sendToSlaveServer(transMeta,jobExecutionConfiguration,null,null);
System.out.println(s);
}catch (Exception e){
e.printStackTrace();
}
}
在spoon界面显示为:
其中远程机器: