来自文档 https://oozie.apache.org/docs/4.1.0/WorkflowFunctionalSpec.html#a4_Parameterization_of_Workflows, config-default.xml
必须出现在工作流程工作区中。
- /workflow.xml
- /config-default.xml
|
- /lib/ (*.jar;*.so)
问题
我创建了一个自定义 Oozie 操作并尝试添加默认值retry-max
and retry-interval
到所有自定义操作。
所以我的workflow.xml
看起来像这样:
<workflow-app xmlns="uri:oozie:workflow:0.3" name="wf-name">
<action name="custom-action" retry-max="${default_retry_max}" retry-interval="${default_retry_interval}">
</action>
config-default.xml
文件包含的值default_retry_max
and default_retry_interval
.
我尝试过的
Putting config-default.xml
到每个工作流程工作区。这可行,但问题是到处都会有这个文件。
Setting oozie.service.LiteWorkflowStoreService.user.retry.max
and oozie.service.LiteWorkflowStoreService.user.retry.inteval
也有效,但它会影响所有操作类型。
我也看过全局配置 https://oozie.apache.org/docs/4.1.0/WorkflowFunctionalSpec.html#a19_Global_Configurations,但这并不能解决这个问题。
我认为应该有一种方法config-default.xml
to oozie.libpath
并且只有那些使用此功能的工作流程libpath
会受到影响。
AFAIK,不幸的是没有干净的方法来做到这一点。
您可能对这个最近创建的功能请求感兴趣:https://issues.apache.org/jira/browse/OOZIE-3179 https://issues.apache.org/jira/browse/OOZIE-3179
唯一对我有用的是使用存储在 hdfs 中的脚本的 shell 步骤开始工作流程。该脚本保存集中配置。该脚本如下所示:
#!/bin/sh
echo "oozie.use.system.libpath=true"
echo "hbase_zookeeper_quorum=localhost"
.. etc other system or custom variables ..
是的,脚本只是将变量打印到标准输出。
假设 shell 步骤操作名为“global_config”。以下所有步骤都可以使用以下语法获取变量:
${wf:actionData('global_config')['hbase_zookeeper_quorum']}
HTH...
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)