我正在 EMR 上创建集群并配置 Zeppelin 以从 S3 读取笔记本。为此,我使用一个 json 对象,如下所示:
[
{
"Classification": "zeppelin-env",
"Properties": {
},
"Configurations": [
{
"Classification": "export",
"Properties": {
"ZEPPELIN_NOTEBOOK_STORAGE":"org.apache.zeppelin.notebook.repo.S3NotebookRepo",
"ZEPPELIN_NOTEBOOK_S3_BUCKET":"hs-zeppelin-notebooks",
"ZEPPELIN_NOTEBOOK_USER":"user"
},
"Configurations": [
]
}
]
}
]
I am pasting this object in the Stoftware configuration page of EMR:
My question is, how/where I can configure the Spark interpreter directly without the need to manually configure it from Zeppelin each time I start a cluster?
这有点复杂,您需要做两件事:
- 编辑Zeppelin的interpreter.json
- 重新启动解释器
因此,您需要做的是编写一个 shell 脚本,然后向运行此 shell 脚本的 EMR 集群配置添加一个额外的步骤。
Zeppelin的配置是json格式的,你可以使用jq(一个工具)来操作json。我不知道你到底想改变什么,但这里有一个添加(神秘失踪)DepInterpreter 的示例:
#!/bin/bash
# 1 edit the Spark interpreter
set -e
cat /etc/zeppelin/conf/interpreter.json | jq '.interpreterSettings."2ANGGHHMQ".interpreterGroup |= .+ [{"class":"org.apache.zeppelin.spark.DepInterpreter", "name":"dep"}]' | sudo -u zeppelin tee /etc/zeppelin/conf/interpreter.json
# Trigger restart of Spark interpreter
curl -X PUT http://localhost:8890/api/interpreter/setting/restart/2ANGGHHMQ
将此 shell 脚本放入 s3 存储桶中。
然后启动您的 EMR 集群
--steps Type=CUSTOM_JAR,Name=CustomJAR,ActionOnFailure=CONTINUE,Jar=s3://eu-west-1.elasticmapreduce/libs/script-runner/script-runner.jar,Args=[s3://mybucket/script.sh]
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)