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 separately from the running session in SSB, you deploy a SQL job (Flink job) in per-job mode with a dedicated YARN cluster that is configured specifically to that particular production job.
--PROD
set 'execution.target' = 'yarn-per-job';
set 'logging.configuration.file' = '/tmp/log4j.properties';
select * from datagen_table_1631781644;
In the above example, the production mode is indicated as --PROD, and 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.
- Go to your cluster in Cloudera Manager.
- Click on SQL Stream Builder from the list of Services.
- Click on the SQLStreamBuilder Console.
The Streaming SQL Console opens up in a new window.
- Specify a job name in the SQL Job Name field, or click Random Name.
- Add
--PROD
to the SQL window. - Set the execution mode to per-job.
set 'execution.target' = 'yarn-per-job';
- Add additional configuration to the production job.
For the list of configurable parameters, see Session cluster properties section.
- Add a SQL statement you want to
executeExample:
--PROD set 'execution.target' = 'yarn-per-job'; set 'state.backend' = 'rocksdb'; select * from faker_table_1631781644;
- Click Execute.