Enable Spark actions

While Spark actions are initially disabled, you have the flexibility to enable them at your discretion if you still want to utilize them.

Enabling Spark actions globally

Perform the following steps to enable Spark action globally through Cloudera Manager:
  1. Navigate to Oozie's configuration page in Cloudera Manager.
  2. Search for Oozie Server Advanced Configuration Snippet (Safety Valve) for oozie-site.xml.
  3. Add a new property named oozie.action.spark.enabled with the value true.


  4. Save the modifications.
  5. Allow Cloudera Manager some time to recognize the changes.
  6. Redeploy Oozie.

Enabling Spark actions per workflows

If you do not want to enable Spark actions globally, you can enable them on a per workflow basis. To do so, set the value of the oozie.action.spark.enabled property to true in the global configuration of the specific workflow. For example:
<workflow-app name="spark_workflow" xmlns="uri:oozie:workflow:1.0">
    <global>
        <configuration>
            <property>
                <name>oozie.action.spark.enabled</name>
                <value>true</value>
            </property>
        </configuration>
    </global>
    <start to="spark_action"/>
    <action name="spark_action">
        ...

By following this approach, if your workflow contains multiple Spark actions, all of them will be enabled and operational.

You can also enable Spark actions for a given workflow by specifying the oozie.action.spark.enabled property in your job.properties file.

Enabling a given Spark action only

If you want to further restrict the enablement of a Spark action, you have the option to enable it only for a specific Spark action within a workflow. This can be achieved by utilizing the oozie.action.spark.enabled property in the configuration of that particular action. For example:
<workflow-app name="spark_workflow" xmlns="uri:oozie:workflow:1.0">
    <start to="spark_action"/>
    <action name="spark_action">
        <spark xmlns="uri:oozie:spark-action:1.0">
            <resource-manager>${resourceManager}</resource-manager>
            <name-node>${nameNode}</name-node>
            <configuration>
                <property>
                    <name>oozie.action.spark.enabled</name>
                    <value>true</value>
                </property>
            </configuration>
            ...

The order of precedence for the above options is as follows:

  1. If you have configured the property at the action level, it takes precedence over all other settings, and the remaining configurations are disregarded.

  2. If you have configured the property in the global configuration of the workflow, the value from there is used.

  3. If the setting is not available in either of the previous locations, the value configured in your job.properties file is used instead.

  4. Lastly, the global safety-valve setting comes into effect.