将一个Azure的Web作业在多个实例上运行? [英] Will an Azure Web job run on multiple instances?

查看:248
本文介绍了将一个Azure的Web作业在多个实例上运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算部署一个网站,以天青,将利用的网上工作的。

I am planning to deploy a website to Azure, that will utilize Web Jobs.

如果该网站扩展到多个实例上运行,我应该期待的作业上的所有实例启动,以及(同时运行),或者我可以期待有只运行作业的一个实例在时间 ?这可以在Azure中进行配置?

If the site is scaled up to run on multiple instances, should I expect the job to be started on all the instances as well (running concurrently), or can I expect there to only be one instance of the job running at a time ? Can this be configured in Azure ?

推荐答案

我假设你使用的是连续WebJobs,而不是手动/预设。在这种情况下,将在所有的实例同时运行。为了让它正确的发生,需要在标准模式下运行,并具备始终打开设置为启用。

I assume you are using Continuous WebJobs and not Manual/Scheduled. In that case, it will run on all the instances at once. For this to happen correctly, you need to be running in Standard mode, and have the Always On setting enabled.

如果您的的希望它在所有实例上运行,你可以通过创建一个名为 settings.job 您一起文件WebJob。它应该包含:

If you don't want it to run on all instances, you can set it to be in 'singleton' mode by creating a file called settings.job alongside your WebJob files. It should contain:

{ "is_singleton": true }

注意,使用捻进程资源管理器用户界面的时候,你是连接到单个实例,而不会看到其他实例中的进程。相反,使用内置在preVIEW门户网站( https://portal.azure.com/ ),这说明进程UI在所有情况下的进程。

Note that when using the Kudu Process Explorer UI, you are connection to a single instance, and won't see processes from other instances. Instead, use the Processes UI built in the Preview Portal (https://portal.azure.com/), which shows processes in all instances.

这篇关于将一个Azure的Web作业在多个实例上运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆