All Products
Search
Document Center

SchedulerX:Specify a tag

Last Updated:Mar 21, 2024

This topic describes how to specify a tag for a job.

Scenarios

This feature is suitable for canary release and stress testing scenarios. For machines in the same application group, some of them may be used for canary release or stress testing, and the job implementation class of these machines is different from that of other machines. However, machines are randomly allocated during job scheduling. If a canary release job is allocated to a common machine, the implementation class may be unavailable.

Traditional solution

In the traditional solution, multiple application groups are created. For example, a dedicated group is configured for machines running canary release jobs. This solution has the following limitations:

  • Normal jobs cannot be scheduled to machines running canary release jobs. The traffic of canary release jobs is small. Dedicated machines for canary release jobs result in a waste of resources.

  • Launching is complicated. After a canary release is passed, the version needs to be launched to all the online machines. However, the job is already configured in the group of machines running canary release jobs. Therefore, you need to create another job in the original group and delete the canary release job.

New solution: specifying tags

You can specify a tag when you register a SchedulerX agent. This topic uses a Spring Boot application as an example to demonstrate how to specify a tag. For more information, see Connect a Spring Boot application to SchedulerX.

spring.schedulerx2.label=gray

Step 1: Verify that a tag is registered

  1. Log on to the SchedulerX console.

  2. In the top navigation bar, select a region.

  3. In the left-side navigation pane, click Application Management.

  4. On the Application Management page, click View Instances in the Operation column. In the Connect to an instance panel, check whether a tag is registered in the tag column.

Step 2: Specify a job to run on machines with the gray tag

  1. Log on to the SchedulerX console.

  2. In the top navigation bar, select a region.

  3. In the left-side navigation pane, click Jobs.

  4. On the Task Management page, find the job that you want to run and click the more in the Operation column. Then, click Specify machine.

  5. On the Specify machine page, set Named Types to tag, select the machines that you want to run the job, and then click OK.

After the canary release is passed, the new job implementation class is available on all of the selected machines. You can delete a specified tag. The tag configuration dynamically takes effect.