Executing SQL jobs in production mode
As by default the SQL jobs are running in a session cluster, there is a risk in case of a cluster failure that every job is affected within that cluster. However, you can set a per-job production mode in SQL Stream Builder to create a dedicated environment for your production jobs.
Production mode means that the deployed SQL job (Flink job) runs in a separate SQL session
and on a dedicated YARN cluster configured specifically for that particular job. You can set
the execution mode in the Job Settings window, although the YARN
execution target can be overwritten using a SET
statement in the SQL
Editor.
Setting production mode in Job Settings
- Click Job Settings at the SQL Editor.
- Select PROD - Job runs in isolated Cluster at Execution Mode.
- Add a SQL statement to the SQL Editor you want to execute.
- Click Execute.
Setting YARN execution target in SQL Editor
SET
statement, and execute the SQL query after defining
the execution target and properties in the same
window:set 'execution.target' = 'yarn-per-job';
set 'logging.configuration.file' = '/tmp/log4j.properties';
select * from datagen_table_1631781644;
In the above example, the execution target is set to per-job to create a new YARN
application for the job. Setting the execution target to per-job allows you to have an
individual cluster for the specific job. The additional properties that you configure using
the SET
statement overwrites the properties that are configured for the
running session. However, when you set properties for the production mode, the settings of
the session cluster are not affected.
- Set the execution mode to per-job.
set 'execution.target' = 'yarn-per-job';
- Add additional configuration to the production job.
- Add a SQL statement you want to
execute.Example:
set 'execution.target' = 'yarn-per-job'; set 'state.backend' = 'rocksdb'; select * from faker_table_1631781644;
- Click Execute.