Is there a way to use config-default.xml globally in Oozie?

梦想的初衷 提交于 2019-12-24 01:27:56

问题


From the documentation, config-default.xml must be presented in the workflow workspace.

- /workflow.xml
- /config-default.xml
|
- /lib/ (*.jar;*.so)

The problem

I've created a custom Oozie action and try to add default values for retry-max and retry-interval to all the custom actions. So my workflow.xml will look like this:

<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 file contains the values of default_retry_max and default_retry_interval.

What I've tried

  1. Putting config-default.xml to every workflow workspace. This works, but the problem is there will be this file everywhere.

  2. Setting oozie.service.LiteWorkflowStoreService.user.retry.max and oozie.service.LiteWorkflowStoreService.user.retry.inteval also works, but it would affect all action types.

  3. I've also looked at Global Configurations, but it doesn't solve this problem.

I think there should be a way to put config-default.xml to oozie.libpath and only those workflows that use this libpath will be affected.


回答1:


AFAIK, there is unfortunately no clean way to do it.

You might be interested in this recently created feature request: https://issues.apache.org/jira/browse/OOZIE-3179

The only thing that worked for me was to begin the workflow with a shell step that uses a script stored in hdfs. This script holds the centralized configuration. The script would look like this:

#!/bin/sh
echo "oozie.use.system.libpath=true"
echo "hbase_zookeeper_quorum=localhost"
.. etc other system or custom variables ..

Yes, the script simply prints the variables to the stdout. Let's say the shell step action is called "global_config". All following steps are able to get the variables using following syntax:

${wf:actionData('global_config')['hbase_zookeeper_quorum']}

HTH...



来源:https://stackoverflow.com/questions/46220293/is-there-a-way-to-use-config-default-xml-globally-in-oozie

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!