目前,我正在尝试将AWS EMR与Talend集成。
我的目的是在AWS EMR上运行Talend作业(由Talend studio导出)。我已经尝试过“将步骤添加为自定义jar”,但似乎Talend作业也通过使用导出的lib
文件夹和脚本来运行。
我想用胖子 jar 来运行它,但是这个问题表明我们不能这样做,因为缺少将JAR文件导出为胖子 jar 的功能。 -> how to export talend job as single fat jar
有什么好的方法可以将Talend Job与Amazon EMR集成在一起?
最佳答案
最后,我通过使用AWS提供的script-runner.jar
解决了这个问题。
Run a Script in a Cluster
我创建了Lambda脚本来启动EMR集群。然后附加HadoopJarStep
。
这使我们可以使用一些Shell脚本来下载并启动Talend作业Shell脚本。
'HadoopJarStep': {
'Jar': 's3://ap-northeast-1.elasticmapreduce/libs/script-runner/script-runner.jar',
'Args': [
's3://your/bucket/name.../talend_run.sh'
]
}
talend_run.sh
如下所示(可惜shellscript)#!/bin/bash
echo "Start, Talend!!"
# here is exported talend job ( contains bootstrap shellscript )
ZIP_NAME=talend-batch-zipped.zip
DIR_NAME=talend-batch-zipped/kicker
SHELL_NAME=kicker_run.sh
# update package because EMR servers don't have unzip command
sudo yum update -y
sudo yum install -y wget unzip
rm -rf ${ZIP_NAME}
wget https://your.using.s3.host.name/${ZIP_NAME} -P `pwd`/
# unzip the zipped job file into the EMR server
unzip ${ZIP_NAME}
cd ${DIR_NAME}
# pass parameters to talend job
bash ./${SHELL_NAME} "$@"
启动AWS Lambda函数后,将创建EMR集群。之后,EMR服务器处理一个步骤( shell 之上)。
关于hadoop - 有什么好的方法可以将Talend作业与Amazon EMR集成在一起?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/43581447/